At our company many content can be accessed without being logged in. Unfortunately many users just start to search for any stuff but do not recognize that they re browsing anonymous and therefor not getting all possible results.
Thats why we re thinking about making missing login more obvious, as example change the header to red or add a banner...
Any ideas how to get this running?
Many thanks,
Hans-Hermann
AJS.toInit(function() { var msg = "booh! log in!"; var $container; // is the messageContainer already visable? if($('#messageContainer')[0]) { $container = $('#messageContainer') } else { $container = $('<ul id="messageContainer"></div>') .prependTo('#full-height-container'); } var $msgContainer = $('<li id="confluence-message-websudo-message" class="confluence-messages noteMessage"></li>') .appendTo($container); // if AJS finds no username, the person should be anon if(!AJS.params.remoteUser) { var $msg = $('<div class="aui-message warning "><span class="aui-icon icon-warning"></span></div>') .appendTo($container); $('<span></span>') .text(msg) .appendTo($msg); } });
This adds a warning banner similar to the one you get when in the admin panel, if there is no username present (e.g anon user)
Hmm, sounds interesting!
But where to put this stuff into? In the "Custom HTML"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An eariler question indicated that older verisons of confluence does not run javascript when added via the Custom HTML.
I've tested the script on confluence 5.4 by adding the following to one of the custom html boxes.
<script> AJS.toInit(function() { var msg = "booh! log in!"; var $container; // is the messageContainer already visable? if($('#messageContainer')[0]) { $container = $('#messageContainer') } else { $container = $('<ul id="messageContainer"></div>') .prependTo('#full-height-container'); } var $msgContainer = $('<li id="confluence-message-websudo-message" class="confluence-messages noteMessage"></li>') .appendTo($container); // if AJS finds no username, the person should be anon if(!AJS.params.remoteUser) { var $msg = $('<div class="aui-message warning "><span class="aui-icon icon-warning"></span></div>') .appendTo($container); $('<span></span>') .text(msg) .appendTo($msg); } }); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.