- improved "notice panel" on login page, Show panel on first visit only per release

This commit is contained in:
Exodus4D
2016-09-24 19:48:13 +02:00
parent 36ceecad4b
commit c1bf70388a
6 changed files with 107 additions and 6 deletions

View File

@@ -59,6 +59,9 @@ define([
galleryThumbContainerId: 'pf-landing-gallery-thumb-container', // id for gallery thumb images
galleryCarouselId: 'pf-landing-gallery-carousel', // id for "carousel" element
// notification panel
notificationPanelId: 'pf-notification-panel', // id for "notification panel" (e.g. last update information)
// server panel
serverPanelId: 'pf-server-panel', // id for EVE Online server status panel
@@ -446,6 +449,48 @@ define([
}).fail(handleAjaxErrorResponse);
};
/**
* show "notification panel" to user
* -> checks if panel not already shown
*/
var initNotificationPanel = function(){
var storageKey = 'notification_panel';
var currentVersion = $('body').data('version');
var showNotificationPanel = function(){
var data = {};
requirejs(['text!templates/ui/notice.html', 'mustache'], function(template, Mustache) {
var content = Mustache.render(template, data);
var notificationPanel = $('#' + config.notificationPanelId);
notificationPanel.html(content);
notificationPanel.velocity('transition.slideUpIn', {
duration: 300,
complete: function(){
// mark panel as "shown"
Util.getLocalStorage().setItem(storageKey, currentVersion);
}
});
});
};
Util.getLocalStorage().getItem(storageKey).then(function(data){
// check if panel was shown before
if(data){
if(data !== this.version){
// show current panel
showNotificationPanel();
}
}else{
// show current panel
showNotificationPanel();
}
}.bind({
version: currentVersion
}));
};
/**
* load character data from cookie information
* -> all validation is done server side!
@@ -682,6 +727,10 @@ define([
// init server status information
initServerStatus();
// init notification panel
initNotificationPanel();
// init character select
initCharacterSelect();
// init page observer

File diff suppressed because one or more lines are too long

View File

@@ -59,6 +59,9 @@ define([
galleryThumbContainerId: 'pf-landing-gallery-thumb-container', // id for gallery thumb images
galleryCarouselId: 'pf-landing-gallery-carousel', // id for "carousel" element
// notification panel
notificationPanelId: 'pf-notification-panel', // id for "notification panel" (e.g. last update information)
// server panel
serverPanelId: 'pf-server-panel', // id for EVE Online server status panel
@@ -446,6 +449,48 @@ define([
}).fail(handleAjaxErrorResponse);
};
/**
* show "notification panel" to user
* -> checks if panel not already shown
*/
var initNotificationPanel = function(){
var storageKey = 'notification_panel';
var currentVersion = $('body').data('version');
var showNotificationPanel = function(){
var data = {};
requirejs(['text!templates/ui/notice.html', 'mustache'], function(template, Mustache) {
var content = Mustache.render(template, data);
var notificationPanel = $('#' + config.notificationPanelId);
notificationPanel.html(content);
notificationPanel.velocity('transition.slideUpIn', {
duration: 300,
complete: function(){
// mark panel as "shown"
Util.getLocalStorage().setItem(storageKey, currentVersion);
}
});
});
};
Util.getLocalStorage().getItem(storageKey).then(function(data){
// check if panel was shown before
if(data){
if(data !== this.version){
// show current panel
showNotificationPanel();
}
}else{
// show current panel
showNotificationPanel();
}
}.bind({
version: currentVersion
}));
};
/**
* load character data from cookie information
* -> all validation is done server side!
@@ -682,6 +727,10 @@ define([
// init server status information
initServerStatus();
// init notification panel
initNotificationPanel();
// init character select
initCharacterSelect();
// init page observer

View File

@@ -1,9 +1,8 @@
{* Login notice information *}
<div class="row text-center">
<div class="col-xs-12 col-md-8 col-md-offset-2 pf-landing-pricing-panel">
<div class="panel panel-primary pricing-big">
<div class="panel panel-info pricing-big">
<div class="panel-heading" >
<h3 class="panel-title">Release v1.1.5</h3>
<h3 class="panel-title">New release v1.1.5</h3>
</div>
<div class="panel-body no-padding text-align-center">
<div class="price-features" style="min-height: inherit;">

View File

@@ -137,8 +137,8 @@
</div>
</div>
{* splash page *}
<include href="templates/ui/notice.html"/>
{* splash page -> shown by Javascript *}
<div id="pf-notification-panel"></div>
</div>
</section>

View File

@@ -405,6 +405,10 @@
}
}
}
#pf-notification-panel{
display: none;
}
}
// demo map -------------------------------------------------------------------