23 $title->inNamespace( NS_MEDIAWIKI ) &&
25 $title->getText() ==
'Visualeditor-cite-tool-definition.json' ||
26 $title->getText() ==
'Cite-tool-definition.json'
47 $resourceModules =
$resourceLoader->getConfig()->get(
'ResourceModules' );
50 isset( $resourceModules[
'ext.visualEditor.mediawiki' ] ) ||
53 $testModules[
'qunit'][
'ext.cite.visualEditor.test'] = [
55 'modules/ve-cite/tests/ve.dm.citeExample.js',
56 'modules/ve-cite/tests/ve.dm.Converter.test.js',
57 'modules/ve-cite/tests/ve.dm.InternalList.test.js',
58 'modules/ve-cite/tests/ve.dm.Transaction.test.js',
59 'modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js',
62 'ext.cite.visualEditor',
63 'ext.visualEditor.test'
65 'localBasePath' => dirname( __DIR__ ),
66 'remoteExtPath' =>
'Cite',
81 if ( ! class_exists(
'VisualEditorHooks' ) ) {
85 $dir = dirname( __DIR__ ) . DIRECTORY_SEPARATOR;
88 'localBasePath' =>
$dir .
'modules',
89 'remoteExtPath' =>
'Cite/modules',
91 "ve-cite/ve.dm.MWReferenceModel.js",
92 "ve-cite/ve.dm.MWReferencesListNode.js",
93 "ve-cite/ve.dm.MWReferenceNode.js",
94 "ve-cite/ve.ce.MWReferencesListNode.js",
95 "ve-cite/ve.ce.MWReferenceNode.js",
96 "ve-cite/ve.ui.MWReferencesListCommand.js"
99 "ve-cite/ve.ce.MWReferencesListNode.css",
100 "ve-cite/ve.ce.MWReferenceNode.css"
103 "ext.visualEditor.mwcore"
106 "cite-ve-referenceslist-isempty",
107 "cite-ve-referenceslist-isempty-default",
108 "cite-ve-referenceslist-missingref",
109 "visualeditor-internal-list-diff-default-group-name-mwreference",
110 "visualeditor-internal-list-diff-group-name-mwreference"
119 [
"class" =>
"CiteDataModule" ] );
122 'localBasePath' =>
$dir .
'modules',
123 'remoteExtPath' =>
'Cite/modules',
125 "ve-cite/ve.ui.MWReferenceGroupInputWidget.js",
126 "ve-cite/ve.ui.MWReferenceSearchWidget.js",
127 "ve-cite/ve.ui.MWReferenceResultWidget.js",
128 "ve-cite/ve.ui.MWUseExistingReferenceCommand.js",
129 "ve-cite/ve.ui.MWCitationDialog.js",
130 "ve-cite/ve.ui.MWReferencesListDialog.js",
131 "ve-cite/ve.ui.MWReferenceDialog.js",
132 "ve-cite/ve.ui.MWReferenceDialogTool.js",
133 "ve-cite/ve.ui.MWCitationDialogTool.js",
134 "ve-cite/ve.ui.MWReferenceContextItem.js",
135 "ve-cite/ve.ui.MWReferencesListContextItem.js",
136 "ve-cite/ve.ui.MWCitationContextItem.js",
137 "ve-cite/ve.ui.MWCitationAction.js",
138 "ve-cite/ve.ui.MWReference.init.js"
141 "ve-cite/ve.ui.MWReferenceContextItem.css",
142 "ve-cite/ve.ui.MWReferenceGroupInputWidget.css",
143 "ve-cite/ve.ui.MWReferenceIcons.css",
144 "ve-cite/ve.ui.MWReferenceResultWidget.css",
145 "ve-cite/ve.ui.MWReferenceSearchWidget.css"
148 "oojs-ui.styles.icons-alerts",
149 "oojs-ui.styles.icons-interactions",
150 "ext.cite.visualEditor.core",
151 "ext.cite.visualEditor.data",
154 "ext.visualEditor.mwtransclusion",
155 "ext.visualEditor.mediawiki"
158 "cite-ve-changedesc-ref-group-both",
159 "cite-ve-changedesc-ref-group-from",
160 "cite-ve-changedesc-ref-group-to",
161 "cite-ve-changedesc-reflist-group-both",
162 "cite-ve-changedesc-reflist-group-from",
163 "cite-ve-changedesc-reflist-group-to",
164 "cite-ve-changedesc-reflist-item-id",
165 "cite-ve-dialog-reference-editing-reused",
166 "cite-ve-dialog-reference-options-group-label",
167 "cite-ve-dialog-reference-options-group-placeholder",
168 "cite-ve-dialog-reference-options-name-label",
169 "cite-ve-dialog-reference-options-responsive-label",
170 "cite-ve-dialog-reference-options-section",
171 "cite-ve-dialog-reference-placeholder",
172 "cite-ve-dialog-reference-title",
173 "cite-ve-dialog-reference-useexisting-full-label",
174 "cite-ve-dialog-reference-useexisting-label",
175 "cite-ve-dialog-reference-useexisting-tool",
176 "cite-ve-dialog-referenceslist-contextitem-description-general",
177 "cite-ve-dialog-referenceslist-contextitem-description-named",
178 "cite-ve-dialog-referenceslist-title",
179 "cite-ve-dialogbutton-citation-educationpopup-title",
180 "cite-ve-dialogbutton-citation-educationpopup-text",
181 "cite-ve-dialogbutton-reference-full-label",
182 "cite-ve-dialogbutton-reference-tooltip",
183 "cite-ve-dialogbutton-reference-title",
184 "cite-ve-dialogbutton-referenceslist-tooltip",
185 "cite-ve-reference-input-placeholder",
186 "cite-ve-toolbar-group-label",
187 "cite-ve-othergroup-item"
205 global $wgCiteStoreReferencesData, $wgCiteCacheRawReferencesOnParse;
206 if ( !$wgCiteStoreReferencesData ) {
210 if ( $refData ===
null ) {
213 if ( $wgCiteCacheRawReferencesOnParse ) {
215 $cache = ObjectCache::getMainWANInstance();
221 $ppValue = FormatJson::encode( $refData,
false, FormatJson::ALL_OK );
223 $ppValue = gzencode( $ppValue, 9 );
226 foreach ( $ppValues as $num => $ppValue ) {
227 $key =
'references-' . intval( $num + 1 );
241 global $wgCiteStoreReferencesData, $wgCiteCacheRawReferencesOnParse;
242 if ( !$wgCiteStoreReferencesData || $wgCiteCacheRawReferencesOnParse ) {
246 if ( method_exists(
$linksUpdate,
'getAddedProperties' )
247 && method_exists(
$linksUpdate,
'getRemovedProperties' )
251 if ( !isset( $addedProps[
'references-1'] )
252 && !isset( $removedProps[
'references-1'] )
257 $cache = ObjectCache::getMainWANInstance();
261 $cache->delete( $key, WANObjectCache::MAX_COMMIT_DELAY );
268 $config = ConfigFactory::getDefaultInstance()->makeConfig(
'cite' );
269 $vars[
'wgCiteVisualEditorOtherGroup'] = $config->get(
'CiteVisualEditorOtherGroup' );
270 $vars[
'wgCiteResponsiveReferences'] = $config->get(
'CiteResponsiveReferences' );
283 $config = ConfigFactory::getDefaultInstance()->makeConfig(
'cite' );
284 $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 onResourceLoaderTestModules(array &$testModules, ResourceLoader &$resourceLoader)
Conditionally register the unit testing module for the ext.cite.visualEditor module only if that modu...
static onLinksUpdateComplete(LinksUpdate &$linksUpdate)
Callback for LinksUpdateComplete hook If $wgCiteCacheRawReferencesOnParse is set to false,...
static onResourceLoaderRegisterModules(&$resourceLoader)
Conditionally register resource loader modules that depends on the VisualEditor MediaWiki extension.
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.
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