LSP: explain IH-system on login page untill turned off through localStorage (if browser supports)
This commit is contained in:
parent
f417df5de5
commit
a2ab708aef
3 changed files with 33 additions and 5 deletions
|
@ -90,7 +90,10 @@ body {
|
||||||
#message > a {
|
#message > a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
color: #505050;
|
color: #505050;
|
||||||
|
}
|
||||||
|
a {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
#ih-button, #ih-button.active:hover {
|
#ih-button, #ih-button.active:hover {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
15
lsp/main.js
15
lsp/main.js
|
@ -1455,10 +1455,8 @@ $(function(){
|
||||||
|
|
||||||
|
|
||||||
$('#ih-button').click(function(){
|
$('#ih-button').click(function(){
|
||||||
if (ih) {
|
$('.ih-balloon').remove();
|
||||||
$('.ih-balloon').remove();
|
if (!ih) {
|
||||||
}
|
|
||||||
else {
|
|
||||||
getWikiData('/wiki/Integrated_Help',function(data){
|
getWikiData('/wiki/Integrated_Help',function(data){
|
||||||
settings.ih = {
|
settings.ih = {
|
||||||
raw: data.find('#mw-content-text').contents(),
|
raw: data.find('#mw-content-text').contents(),
|
||||||
|
@ -1499,3 +1497,12 @@ $(window).on('hashchange', function(e) {
|
||||||
}
|
}
|
||||||
ignoreHashChange = false;
|
ignoreHashChange = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function localStorageSupported() {
|
||||||
|
//does this browser support it?
|
||||||
|
try {
|
||||||
|
return 'localStorage' in window && window['localStorage'] !== null;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
18
lsp/pages.js
18
lsp/pages.js
|
@ -68,6 +68,24 @@ function showTab(tabName,streamName) {
|
||||||
$('#server').val(adr[1]);
|
$('#server').val(adr[1]);
|
||||||
$('#credentials-username').val(adr[0]);
|
$('#credentials-username').val(adr[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//new here? message
|
||||||
|
if ((!localStorageSupported) || (!localStorage['MistServer_notnew'])) {
|
||||||
|
var $msg = $('<div>').addClass('ih-balloon').addClass('pageinfo').html(
|
||||||
|
'<p>New here?<br>Click the Integrated Help logo for more information about the current page.</p>'
|
||||||
|
);
|
||||||
|
if (localStorageSupported()) {
|
||||||
|
$msg.append(
|
||||||
|
$('<a>').text('Don\'t show this again.').click(function(){
|
||||||
|
localStorage['MistServer_notnew'] = 1;
|
||||||
|
$(this).closest('.ih-balloon').remove();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$('#page').prepend($msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'create new account':
|
case 'create new account':
|
||||||
$('#menu').css('visibility', 'hidden');
|
$('#menu').css('visibility', 'hidden');
|
||||||
|
|
Loading…
Add table
Reference in a new issue