| @@ -1,24 +1,13 @@ | ||
| 1 | -/** | |
| 2 | - * Displays an alert for anonymous users at the top of pages marked 'public' | |
| 3 | - * instructing them to log in. Example alert: "Notice: You are browsing this | |
| 4 | - * site anonymously, and only have access to a portion of its content." | |
| 5 | - */ | |
| 6 | - | |
| 7 | -/* global document, auth */ | |
| 8 | -( function( $ ) { | |
| 9 | - | |
| 10 | - $( document ).ready( function() { | |
| 11 | - auth.wpLoginUrl = 'undefined' !== typeof auth.wpLoginUrl ? auth.wpLoginUrl : '/wp-login.php'; | |
| 12 | - auth.publicWarning = 'undefined' !== typeof auth.publicWarning ? auth.publicWarning : false; | |
| 13 | - if ( auth.publicWarning ) { | |
| 14 | - $( '#main' ).prepend(' \ | |
| 15 | - <div id="alert" class="alert alert-info auth-alert"> \ | |
| 16 | - <button type="button" class="close" data-dismiss="alert">×</button> \ | |
| 17 | - ' + auth.anonymousNotice + ' \ | |
| 18 | - <a class="button" href="' + auth.wpLoginUrl + '">' + auth.logIn + '</a> \ | |
| 19 | - </div> \ | |
| 20 | - '); | |
| 21 | - } | |
| 22 | - }); | |
| 23 | - | |
| 24 | -} )( jQuery ); | |
| 1 | +jQuery( document ).ready( function( $ ) { | |
| 2 | + auth.wp_login_url = typeof auth.wp_login_url !== 'undefined' ? auth.wp_login_url : '/wp-login.php'; | |
| 3 | + auth.public_warning = typeof auth.public_warning !== 'undefined' ? auth.public_warning : false; | |
| 4 | + if ( auth.public_warning ) { | |
| 5 | + $( '#main' ).prepend(' \ | |
| 6 | + <div id="alert" class="alert alert-info auth-alert"> \ | |
| 7 | + <button type="button" class="close" data-dismiss="alert">×</button> \ | |
| 8 | + ' + auth.anonymous_notice + ' \ | |
| 9 | + <a class="button" href="' + auth.wp_login_url + '">' + auth.log_in + '</a> \ | |
| 10 | + </div> \ | |
| 11 | + '); | |
| 12 | + } | |
| 13 | +}); | |