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',
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 ) {
209 $refData = $linksUpdate->
getParserOutput()->getExtensionData( Cite::EXT_DATA_KEY );
210 if ( $refData ===
null ) {
213 if ( $wgCiteCacheRawReferencesOnParse ) {
215 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
216 $articleID = $linksUpdate->
getTitle()->getArticleID();
217 $key =
$cache->makeKey( Cite::EXT_DATA_KEY, $articleID );
218 $cache->set( $key, $refData, Cite::CACHE_DURATION_ONPARSE );
223 $ppValue = gzencode( $ppValue, 9 );
225 $ppValues = str_split( $ppValue, Cite::MAX_STORAGE_LENGTH );
226 foreach ( $ppValues as $num => $ppValue ) {
227 $key =
'references-' . intval( $num + 1 );
228 $linksUpdate->mProperties[$key] = $ppValue;
230 $linksUpdate->
getParserOutput()->setExtensionData( Cite::EXT_DATA_KEY,
null );
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();
259 $key =
$cache->makeKey( Cite::EXT_DATA_KEY, $articleID );
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' );