[MediaWiki-commits] [Gerrit] Make citoid-template-type-map.json message always exist - change (mediawiki...Citoid)
jenkins-bot has submitted this change and it was merged. Change subject: Make citoid-template-type-map.json message always exist .. Make citoid-template-type-map.json message always exist Bug: T138574 Change-Id: I75489d8cf3ab2b8d088f24323e806ab29930caf3 --- M i18n/en.json M i18n/qqq.json M modules/ve.ui.Citoid.init.js 3 files changed, 11 insertions(+), 8 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index c8bf905..1fa9b4c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,5 +19,6 @@ "citoid-desc": "Provides access points between the citoid service and MediaWiki", "citoid-referencecontextitem-convert-button": "Convert", "citoid-referencecontextitem-convert-message": "This reference consists of just an external link. You can use the \"{{int:citoid-referencecontextitem-convert-button}}\" button below to generate a properly formatted reference.", + "citoid-template-type-map.json": "null", "citoid-unknown-error": "An unknown error has occured that prevented us from creating a citation. Please try again later." } \ No newline at end of file diff --git a/i18n/qqq.json b/i18n/qqq.json index 2b8d75e..635b271 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -28,5 +28,6 @@ "citoid-desc": "{{desc|name=Citoid|url=https://www.mediawiki.org/wiki/Citoid}};, "citoid-referencecontextitem-convert-button": "Label for the button to convert a plain reference to a Citoid reference.\n{{Identical|Convert}}", "citoid-referencecontextitem-convert-message": "Message explaining the functionality of the button to convert a plain reference to a Citoid reference.", + "citoid-template-type-map.json": "JSON object containing mapping of different document types to the wiki's template names. Each template must have TemplateData defined to map Citoid's fields to the template's fields. Document types: book, bookSection, journalArticle, magazineArticle, newspaperArticle, thesis, letter, manuscript, interview, film, artwork, webpage, report, bill, hearing, patent, statute, email, map, blogPost, instantMessage, forumPost, audioRecording, presentation, videoRecording, tvBroadcast, radioBroadcast, podcast, computerProgram, conferencePaper, document, encyclopediaArticle, dictionaryEntry", "citoid-unknown-error": "Error message indicating that the service to create citations has returned an error or is temporarily malfunctioning, asking the user to try again later." } diff --git a/modules/ve.ui.Citoid.init.js b/modules/ve.ui.Citoid.init.js index 6c1d2db..881ec74 100644 --- a/modules/ve.ui.Citoid.init.js +++ b/modules/ve.ui.Citoid.init.js @@ -1,18 +1,19 @@ ( function () { - var i, j, jLen, toolGroups, citeIndex, target; + var i, j, jLen, toolGroups, citeIndex, target, map; // Don't create tool unless the configuration message is present try { - JSON.parse( mw.message( 'citoid-template-type-map.json' ).plain() ); + map = JSON.parse( mw.message( 'citoid-template-type-map.json' ).plain() ); } catch ( e ) { // Temporary hack for T93800 try { - JSON.parse( mw.message( 'citoid-template-type-map-backup.json' ).plain() ); - } catch ( e2 ) { - // Unregister the tool - ve.ui.toolFactory.unregister( ve.ui.CiteFromIdInspectorTool ); - return; - } + map = JSON.parse( mw.message( 'citoid-template-type-map-backup.json' ).plain() ); + } catch ( e2 ) {} + } + if ( !map ) { + // Unregister the tool + ve.ui.toolFactory.unregister( ve.ui.CiteFromIdInspectorTool ); + return; } // HACK: Find the position of the current citation toolbar definition -- To view, visit https://gerrit.wikimedia.org/r/295971 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I75489d8cf3ab2b8d088f24323e806ab29930caf3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Citoid Gerrit-Branch: master Gerrit-Owner: Alex MonkGerrit-Reviewer: Jforrester Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make citoid-template-type-map.json message always exist - change (mediawiki...Citoid)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/295971 Change subject: Make citoid-template-type-map.json message always exist .. Make citoid-template-type-map.json message always exist Bug: T138574 Change-Id: I75489d8cf3ab2b8d088f24323e806ab29930caf3 --- M i18n/en.json M i18n/qqq.json M modules/ve.ui.Citoid.init.js 3 files changed, 11 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Citoid refs/changes/71/295971/1 diff --git a/i18n/en.json b/i18n/en.json index c8bf905..1fa9b4c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,5 +19,6 @@ "citoid-desc": "Provides access points between the citoid service and MediaWiki", "citoid-referencecontextitem-convert-button": "Convert", "citoid-referencecontextitem-convert-message": "This reference consists of just an external link. You can use the \"{{int:citoid-referencecontextitem-convert-button}}\" button below to generate a properly formatted reference.", + "citoid-template-type-map.json": "null", "citoid-unknown-error": "An unknown error has occured that prevented us from creating a citation. Please try again later." } \ No newline at end of file diff --git a/i18n/qqq.json b/i18n/qqq.json index 2b8d75e..635b271 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -28,5 +28,6 @@ "citoid-desc": "{{desc|name=Citoid|url=https://www.mediawiki.org/wiki/Citoid}};, "citoid-referencecontextitem-convert-button": "Label for the button to convert a plain reference to a Citoid reference.\n{{Identical|Convert}}", "citoid-referencecontextitem-convert-message": "Message explaining the functionality of the button to convert a plain reference to a Citoid reference.", + "citoid-template-type-map.json": "JSON object containing mapping of different document types to the wiki's template names. Each template must have TemplateData defined to map Citoid's fields to the template's fields. Document types: book, bookSection, journalArticle, magazineArticle, newspaperArticle, thesis, letter, manuscript, interview, film, artwork, webpage, report, bill, hearing, patent, statute, email, map, blogPost, instantMessage, forumPost, audioRecording, presentation, videoRecording, tvBroadcast, radioBroadcast, podcast, computerProgram, conferencePaper, document, encyclopediaArticle, dictionaryEntry", "citoid-unknown-error": "Error message indicating that the service to create citations has returned an error or is temporarily malfunctioning, asking the user to try again later." } diff --git a/modules/ve.ui.Citoid.init.js b/modules/ve.ui.Citoid.init.js index 6c1d2db..881ec74 100644 --- a/modules/ve.ui.Citoid.init.js +++ b/modules/ve.ui.Citoid.init.js @@ -1,18 +1,19 @@ ( function () { - var i, j, jLen, toolGroups, citeIndex, target; + var i, j, jLen, toolGroups, citeIndex, target, map; // Don't create tool unless the configuration message is present try { - JSON.parse( mw.message( 'citoid-template-type-map.json' ).plain() ); + map = JSON.parse( mw.message( 'citoid-template-type-map.json' ).plain() ); } catch ( e ) { // Temporary hack for T93800 try { - JSON.parse( mw.message( 'citoid-template-type-map-backup.json' ).plain() ); - } catch ( e2 ) { - // Unregister the tool - ve.ui.toolFactory.unregister( ve.ui.CiteFromIdInspectorTool ); - return; - } + map = JSON.parse( mw.message( 'citoid-template-type-map-backup.json' ).plain() ); + } catch ( e2 ) {} + } + if ( !map ) { + // Unregister the tool + ve.ui.toolFactory.unregister( ve.ui.CiteFromIdInspectorTool ); + return; } // HACK: Find the position of the current citation toolbar definition -- To view, visit https://gerrit.wikimedia.org/r/295971 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75489d8cf3ab2b8d088f24323e806ab29930caf3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Citoid Gerrit-Branch: master Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits