Pad Not Pinned: Better CSS, moved element outside of the title element, added it in poll, better colors, tippy, and login/register in same window

This commit is contained in:
Caleb James DeLisle
2017-12-08 14:00:53 +01:00
parent 617c4b6044
commit 12b0f3e201
4 changed files with 69 additions and 43 deletions

View File

@@ -731,20 +731,31 @@ define([
if (x.response[0] === true) { return; }
var pnpTitle = Messages._getKey('padNotPinned', ['','','','']);
var pnpMsg = Messages._getKey('padNotPinned', [
'<a href="' + o + '/login" target="blank" title>',
'<a href="' + o + '/login" class="cp-pnp-login" target="blank" title>',
'</a>',
'<a href="' + o + '/register" target="blank" title>',
'<a href="' + o + '/register" class="cp-pnp-register" target="blank" title>',
'</a>'
]);
var msg = $('<span>', {
'class': 'cp-pad-not-pinned',
'title': pnpTitle
var $msg = $('<span>', {
'class': 'cp-pad-not-pinned'
}).append([
$('<span>', {'class': 'fa fa-exclamation-triangle'}),
$('<span>', {'class': 'fa fa-exclamation-triangle', 'title': pnpTitle}),
$('<span>', {'class': 'cp-pnp-msg'}).append(pnpMsg)
]);
$('.cp-toolbar-title').append(msg);
console.log("This pad is not pinned");
$msg.find('a.cp-pnp-login').click(function (ev) {
ev.preventDefault();
Common.setLoginRedirect(function () {
window.parent.location = o + '/login/';
});
});
$msg.find('a.cp-pnp-register').click(function (ev) {
ev.preventDefault();
Common.setLoginRedirect(function () {
window.parent.location = o + '/register/';
});
});
$('.cp-toolbar-top').append($msg);
UI.addTooltips();
});
};