diff options
Diffstat (limited to 'extensions/WikiEditor/modules/jquery.wikiEditor.publish.js')
-rw-r--r-- | extensions/WikiEditor/modules/jquery.wikiEditor.publish.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js index c7360006..bbd539f4 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js @@ -72,22 +72,24 @@ fn: { } ); /* 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 ) { |