jenkins-bot has submitted this change and it was merged. Change subject: Reformat the license warning only if available ......................................................................
Reformat the license warning only if available If the WikiEditor is enabled for Semantic Forms Text Area Input there is no license warning div around. Change-Id: I8d39f8d47a73cdc2d4be198061e8f68f22c0c308 --- M modules/jquery.wikiEditor.publish.js 1 file changed, 16 insertions(+), 14 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/jquery.wikiEditor.publish.js b/modules/jquery.wikiEditor.publish.js index c736000..bbd539f 100644 --- a/modules/jquery.wikiEditor.publish.js +++ b/modules/jquery.wikiEditor.publish.js @@ -72,22 +72,24 @@ } ); /* REALLY DIRTY HACK! */ - // Reformat the copyright warning stuff - var copyWarnHTML = $( '#editpage-copywarn p' ).html(); - // TODO: internationalize by splitting on other characters that end statements - var copyWarnStatements = copyWarnHTML.split( '. ' ); - var newCopyWarnHTML = '<ul>'; - for ( i = 0; i < copyWarnStatements.length; i++ ) { - if ( copyWarnStatements[i] !== '' ) { - var copyWarnStatement = $.trim( copyWarnStatements[i] ).replace( /\.*$/, '' ); - newCopyWarnHTML += '<li>' + copyWarnStatement + '.</li>'; + // Reformat the copyright warning stuff, if available + if ( $( '#editpage-copywarn p' ).length ) { + var copyWarnHTML = $( '#editpage-copywarn p' ).html(); + // TODO: internationalize by splitting on other characters that end statements + var copyWarnStatements = copyWarnHTML.split( '. ' ); + var newCopyWarnHTML = '<ul>'; + for ( i = 0; i < copyWarnStatements.length; i++ ) { + if ( copyWarnStatements[i] !== '' ) { + var copyWarnStatement = $.trim( copyWarnStatements[i] ).replace( /\.*$/, '' ); + newCopyWarnHTML += '<li>' + copyWarnStatement + '.</li>'; + } } + newCopyWarnHTML += '</ul>'; + // No list if there's only one element + $( this ).find( '.wikiEditor-publish-dialog-copywarn' ).html( + copyWarnStatements.length > 1 ? newCopyWarnHTML : copyWarnHTML + ); } - newCopyWarnHTML += '</ul>'; - // No list if there's only one element - $( this ).find( '.wikiEditor-publish-dialog-copywarn' ).html( - copyWarnStatements.length > 1 ? newCopyWarnHTML : copyWarnHTML - ); /* END OF REALLY DIRTY HACK */ if ( $( '#wpMinoredit' ).length === 0 ) { -- To view, visit https://gerrit.wikimedia.org/r/98249 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d39f8d47a73cdc2d4be198061e8f68f22c0c308 Gerrit-PatchSet: 18 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: Dev-zero <t...@dev-zero.ch> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Dev-zero <t...@dev-zero.ch> Gerrit-Reviewer: GOIII <george.orwell....@outlook.com> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: TheDJ <hartman.w...@gmail.com> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits