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',
61 'localBasePath' => dirname( __DIR__ ),
62 'remoteExtPath' =>
'Cite',
74 if ( !ExtensionRegistry::getInstance()->isLoaded(
'VisualEditor' ) ) {
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',
120 "ve-cite/ve.ui.MWReferenceGroupInputWidget.js",
121 "ve-cite/ve.ui.MWReferenceSearchWidget.js",
122 "ve-cite/ve.ui.MWReferenceResultWidget.js",
123 "ve-cite/ve.ui.MWUseExistingReferenceCommand.js",
124 "ve-cite/ve.ui.MWCitationDialog.js",
125 "ve-cite/ve.ui.MWReferencesListDialog.js",
126 "ve-cite/ve.ui.MWReferenceDialog.js",
127 "ve-cite/ve.ui.MWReferenceDialogTool.js",
128 "ve-cite/ve.ui.MWCitationDialogTool.js",
129 "ve-cite/ve.ui.MWReferenceContextItem.js",
130 "ve-cite/ve.ui.MWReferencesListContextItem.js",
131 "ve-cite/ve.ui.MWCitationContextItem.js",
132 "ve-cite/ve.ui.MWCitationAction.js",
133 "ve-cite/ve.ui.MWReference.init.js",
134 "ve-cite/ve.ui.MWCitationNeededContextItem.js",
137 "ve-cite/ve.ui.MWReferenceDialog.css",
138 "ve-cite/ve.ui.MWReferenceContextItem.css",
139 "ve-cite/ve.ui.MWReferenceGroupInputWidget.css",
140 "ve-cite/ve.ui.MWReferenceResultWidget.css",
141 "ve-cite/ve.ui.MWReferenceSearchWidget.css"
144 "oojs-ui.styles.icons-alerts",
145 "oojs-ui.styles.icons-editing-citation",
146 "oojs-ui.styles.icons-interactions",
147 "ext.cite.visualEditor.core",
148 "ext.cite.visualEditor.data",
151 "ext.visualEditor.mwtransclusion",
152 "ext.visualEditor.mediawiki"
155 "cite-ve-changedesc-ref-group-both",
156 "cite-ve-changedesc-ref-group-from",
157 "cite-ve-changedesc-ref-group-to",
158 "cite-ve-changedesc-reflist-group-both",
159 "cite-ve-changedesc-reflist-group-from",
160 "cite-ve-changedesc-reflist-group-to",
161 "cite-ve-changedesc-reflist-item-id",
162 "cite-ve-changedesc-reflist-responsive-set",
163 "cite-ve-changedesc-reflist-responsive-unset",
164 "cite-ve-citationneeded-button",
165 "cite-ve-citationneeded-description",
166 "cite-ve-citationneeded-title",
167 "cite-ve-dialog-reference-editing-reused",
168 "cite-ve-dialog-reference-editing-reused-long",
169 "cite-ve-dialog-reference-options-group-label",
170 "cite-ve-dialog-reference-options-group-placeholder",
171 "cite-ve-dialog-reference-options-name-label",
172 "cite-ve-dialog-reference-options-responsive-label",
173 "cite-ve-dialog-reference-options-section",
174 "cite-ve-dialog-reference-placeholder",
175 "cite-ve-dialog-reference-title",
176 "cite-ve-dialog-reference-useexisting-tool",
177 "cite-ve-dialog-referenceslist-contextitem-description-general",
178 "cite-ve-dialog-referenceslist-contextitem-description-named",
179 "cite-ve-dialog-referenceslist-title",
180 "cite-ve-dialogbutton-citation-educationpopup-title",
181 "cite-ve-dialogbutton-citation-educationpopup-text",
182 "cite-ve-dialogbutton-reference-full-label",
183 "cite-ve-dialogbutton-reference-tooltip",
184 "cite-ve-dialogbutton-reference-title",
185 "cite-ve-dialogbutton-referenceslist-tooltip",
186 "cite-ve-reference-input-placeholder",
187 "cite-ve-toolbar-group-label",
188 "cite-ve-othergroup-item"
205 global $wgCiteStoreReferencesData, $wgCiteCacheRawReferencesOnParse;
206 if ( !$wgCiteStoreReferencesData ) {
210 if ( $refData ===
null ) {
213 if ( $wgCiteCacheRawReferencesOnParse ) {
215 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
216 $articleID = $linksUpdate->
getTitle()->getArticleID();
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 );
228 $linksUpdate->mProperties[$key] = $ppValue;
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 = MediaWikiServices::getInstance()->getMainWANObjectCache();
258 $articleID = $linksUpdate->
getTitle()->getArticleID();
261 $cache->delete( $key, WANObjectCache::MAX_COMMIT_DELAY );
269 $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig(
'cite' );
270 $vars[
'wgCiteVisualEditorOtherGroup'] = $config->get(
'CiteVisualEditorOtherGroup' );
271 $vars[
'wgCiteResponsiveReferences'] = $config->get(
'CiteResponsiveReferences' );
283 $config = MediaWikiServices::getInstance()->getConfigFactory()->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 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.
getTitle()
Return the title object of the page being updated.
getAddedProperties()
Fetch page properties added by this LinksUpdate.
getParserOutput()
Returns parser output.
getRemovedProperties()
Fetch page properties removed by this LinksUpdate.
ResourceLoader is a loading system for JavaScript and CSS resources.
Represents a title within MediaWiki.