Commit 6d0323a3 authored by Ken Hawkins's avatar Ken Hawkins
Browse files

Improve emoji positioning and styling

parent 915d9d71
...@@ -7,9 +7,12 @@ var analyticsResults = new Object(); ...@@ -7,9 +7,12 @@ var analyticsResults = new Object();
// various reusable icons // various reusable icons
// var iconWarning = '<span class="icon icon-generic is-invalid-label" data-icon="l"> </span>', // var iconWarning = '<span class="icon icon-generic is-invalid-label" data-icon="l"> </span>',
var iconWarning = '🤔', var iconPrefix = '<span class="icon-indicator">',
iconSoSo = '😇', iconSuffix = '</span><br/>';
iconSuccess = '🎉';
var iconWarning = iconPrefix + '🤔' + iconSuffix,
iconSoSo = iconPrefix + '😇' + iconSuffix,
iconSuccess = iconPrefix + '🎉' + iconSuffix;
// extract the pub date from the url // extract the pub date from the url
...@@ -208,7 +211,7 @@ function render_query_overview(target,dimensions,metrics,filters,shared) { ...@@ -208,7 +211,7 @@ function render_query_overview(target,dimensions,metrics,filters,shared) {
'<small><a target="_blank" href="http://news.embl.de' + analyticsResults[i].url + '">'+ analyticsResults[i].url+'</a></small>'+ '<small><a target="_blank" href="http://news.embl.de' + analyticsResults[i].url + '">'+ analyticsResults[i].url+'</a></small>'+
'<br/><small><a class="readmore" href="https://analytics.google.com/analytics/web/#report/content-pages/a21480202w75912813p91186979/%3Fexplorer-table.filter%3D' + encodeURIComponent(analyticsResults[i].url) + '" target="_blank">View GA for this URL</small>' + '<br/><small><a class="readmore" href="https://analytics.google.com/analytics/web/#report/content-pages/a21480202w75912813p91186979/%3Fexplorer-table.filter%3D' + encodeURIComponent(analyticsResults[i].url) + '" target="_blank">View GA for this URL</small>' +
'</td>' + '</td>' +
'<td>' + analyticsResults[i].pageViews + '<br/>' + success + '<td>' + success + analyticsResults[i].pageViews +
'</td><td class="tr-referals small"></td><td class="tr-ui-regions"></td><td class="tr-time-on-page"></td><td class="tr-leave-rate"></td></tr>'); '</td><td class="tr-referals small"></td><td class="tr-ui-regions"></td><td class="tr-time-on-page"></td><td class="tr-leave-rate"></td></tr>');
...@@ -316,7 +319,7 @@ function render_query_ui_regions(target,dimensions,metrics,filters,shared,result ...@@ -316,7 +319,7 @@ function render_query_ui_regions(target,dimensions,metrics,filters,shared,result
if (engagementPercent < 2) { if (engagementPercent < 2) {
success = iconWarning; success = iconWarning;
} }
$(target + ' td.tr-ui-regions').append(success); $(target + ' td.tr-ui-regions').prepend(success);
// $(target + ' td.tr-ui-regions').append('Engagement %: ' + + '<br/>'); // $(target + ' td.tr-ui-regions').append('Engagement %: ' + + '<br/>');
}); });
} }
...@@ -349,7 +352,7 @@ function render_query_page_time(target,dimensions,metrics,filters,shared,resultP ...@@ -349,7 +352,7 @@ function render_query_page_time(target,dimensions,metrics,filters,shared,resultP
$(target + ' td.tr-time-on-page').append('' + timeOnPage + '<br/>' + success ); $(target + ' td.tr-time-on-page').append('' +success + timeOnPage);
}); });
} }
...@@ -381,7 +384,7 @@ function render_query_leave_rate(target,dimensions,metrics,filters,shared,result ...@@ -381,7 +384,7 @@ function render_query_leave_rate(target,dimensions,metrics,filters,shared,result
var leaveRate = Math.round((receivedData[0][1]) * 100) / 100; var leaveRate = Math.round((receivedData[0][1]) * 100) / 100;
$(target + ' td.tr-leave-rate').append('' + leaveRate +'% <br/>' + success); $(target + ' td.tr-leave-rate').append(success + leaveRate +'%');
// update table sorting // update table sorting
...@@ -389,7 +392,7 @@ function render_query_leave_rate(target,dimensions,metrics,filters,shared,result ...@@ -389,7 +392,7 @@ function render_query_leave_rate(target,dimensions,metrics,filters,shared,result
// add pie graph // add pie graph
var uniqueID = Math.floor(Math.random() * 1000); var uniqueID = Math.floor(Math.random() * 1000);
$(target + ' td.tr-leave-rate').prepend('<div id="leave-container-'+uniqueID+'"></div>'); $(target + ' td.tr-leave-rate').append('<div id="leave-container-'+uniqueID+'"></div>');
var labels = new Array(); var labels = new Array();
var data = []; var data = [];
......
...@@ -93,6 +93,9 @@ ...@@ -93,6 +93,9 @@
table tbody td { table tbody td {
vertical-align: top; vertical-align: top;
} }
.icon-indicator {
font-size: 1.5rem;
}
</style> </style>
<!-- Load the components and their dependencies. --> <!-- Load the components and their dependencies. -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment