PluginProbe
Authorizer / 2.8.7
Authorizer v2.8.7
3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 2.9.6 All 126 releases
authorizer / js / authorizer-public.js

authorizer-public.js in Authorizer 2.8.7, at js/authorizer-public.js

25 lines 866 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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">&times;</button> \
17 ' + auth.anonymousNotice + ' \
18 <a class="button" href="' + auth.wpLoginUrl + '">' + auth.logIn + '</a> \
19 </div> \
20 ');
21 }
22 });
23
24 } )( jQuery );
25