AndyRussG has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/392735 )
Change subject: Add client-side setDebug() method ...................................................................... Add client-side setDebug() method Bug: T180478 Change-Id: Iecece883eca7e507edfc613c2c481c8ce8d8e25a --- M resources/subscribing/ext.centralNotice.display.js M resources/subscribing/ext.centralNotice.display.state.js 2 files changed, 27 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/35/392735/1 diff --git a/resources/subscribing/ext.centralNotice.display.js b/resources/subscribing/ext.centralNotice.display.js index 9ced44b..4798bcb 100644 --- a/resources/subscribing/ext.centralNotice.display.js +++ b/resources/subscribing/ext.centralNotice.display.js @@ -712,6 +712,17 @@ }, /** + * Set a string with information for debugging. (All strings set here will be + * sent to the server via the debug parameter on the record impression call). + * + * @param {string} str A string with the debugging information; should not + * contain pipe characters ('|'). + */ + setDebug: function ( str ) { + cn.internal.state.setDebug( str ); + }, + + /** * Request that, if possible, the record impression call be delayed until a * promise is resolved. If the promise does not resolve before * MAX_RECORD_IMPRESSION_DELAY milliseconds after the banner is injected, diff --git a/resources/subscribing/ext.centralNotice.display.state.js b/resources/subscribing/ext.centralNotice.display.state.js index 407e048..a4b234c 100644 --- a/resources/subscribing/ext.centralNotice.display.state.js +++ b/resources/subscribing/ext.centralNotice.display.state.js @@ -405,11 +405,26 @@ if ( tests.length === 1 ) { state.data.testIdentifiers = identifier; } else { - state.data.testIdentifiers.concat( ',' + identifier ); + state.data.testIdentifiers += ',' + identifier; } } }, + /** + * Set a string with information for debugging. (All strings set here will be + * added to state data). + * + * @param {string} str A string with the debugging information; should not + * contain pipe characters ('|'). + */ + setDebug: function ( str ) { + if ( !state.data.debug ) { + state.data.debug = str; + } else { + state.data.debug += '|' + str; + } + }, + lookupReasonCode: function ( reasonName ) { if ( reasonName in REASONS ) { return REASONS[ reasonName ]; -- To view, visit https://gerrit.wikimedia.org/r/392735 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecece883eca7e507edfc613c2c481c8ce8d8e25a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: AndyRussG <andrew.green...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits