mobile: show portal counts in nav drawer
This commit is contained in:
parent
1279179407
commit
69aad81933
BIN
mobile/res/drawable-hdpi/ic_action_data_usage.png
Normal file
BIN
mobile/res/drawable-hdpi/ic_action_data_usage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 633 B |
BIN
mobile/res/drawable-mdpi/ic_action_data_usage.png
Normal file
BIN
mobile/res/drawable-mdpi/ic_action_data_usage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 464 B |
BIN
mobile/res/drawable-xhdpi/ic_action_data_usage.png
Normal file
BIN
mobile/res/drawable-xhdpi/ic_action_data_usage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 848 B |
BIN
mobile/res/drawable-xxhdpi/ic_action_data_usage.png
Normal file
BIN
mobile/res/drawable-xxhdpi/ic_action_data_usage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -2,7 +2,7 @@
|
|||||||
// @id iitc-plugin-portals-count@yenky
|
// @id iitc-plugin-portals-count@yenky
|
||||||
// @name IITC plugin: Show total counts of portals
|
// @name IITC plugin: Show total counts of portals
|
||||||
// @category Info
|
// @category Info
|
||||||
// @version 0.0.9.@@DATETIMEVERSION@@
|
// @version 0.0.10.@@DATETIMEVERSION@@
|
||||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||||
// @updateURL @@UPDATEURL@@
|
// @updateURL @@UPDATEURL@@
|
||||||
// @downloadURL @@DOWNLOADURL@@
|
// @downloadURL @@DOWNLOADURL@@
|
||||||
@ -19,6 +19,8 @@
|
|||||||
// PLUGIN START ////////////////////////////////////////////////////////
|
// PLUGIN START ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/* whatsnew
|
/* whatsnew
|
||||||
|
* 0.0.10 : show in nav drawer on mobile devices
|
||||||
|
* 0.0.9 : fix for new intel map
|
||||||
* 0.0.8 : use dialog() instead of alert()
|
* 0.0.8 : use dialog() instead of alert()
|
||||||
* 0.0.6 : ignoring outside bounds portals (even if close to)
|
* 0.0.6 : ignoring outside bounds portals (even if close to)
|
||||||
* 0.0.5 : changed table layout, added some colors
|
* 0.0.5 : changed table layout, added some colors
|
||||||
@ -26,7 +28,6 @@
|
|||||||
* 0.0.3 : fixed incorrect rounded portal levels, adjusted viewport
|
* 0.0.3 : fixed incorrect rounded portal levels, adjusted viewport
|
||||||
* 0.0.2 : fixed counts to be reset after scrolling
|
* 0.0.2 : fixed counts to be reset after scrolling
|
||||||
* 0.0.1 : initial release, show count of portals
|
* 0.0.1 : initial release, show count of portals
|
||||||
* todo :
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// use own namespace for plugin
|
// use own namespace for plugin
|
||||||
@ -97,17 +98,39 @@ window.plugin.portalcounts.getPortals = function(){
|
|||||||
counts += '<tr><td>No Portals in range!</td></tr>';
|
counts += '<tr><td>No Portals in range!</td></tr>';
|
||||||
counts += '</table>';
|
counts += '</table>';
|
||||||
|
|
||||||
|
|
||||||
var total = window.plugin.portalcounts.enlP + window.plugin.portalcounts.resP + window.plugin.portalcounts.neuP;
|
var total = window.plugin.portalcounts.enlP + window.plugin.portalcounts.resP + window.plugin.portalcounts.neuP;
|
||||||
|
var title = total + ' ' + (total == 1 ? 'portal' : 'portals');
|
||||||
|
|
||||||
|
if(typeof android !== 'undefined' && android && android.addPane) {
|
||||||
|
$('<div id="portalcounts" class="mobile">'
|
||||||
|
+ '<div class="ui-dialog-titlebar"><span class="ui-dialog-title ui-dialog-title-active">' + title + '</span></div>'
|
||||||
|
+ counts
|
||||||
|
+ '</div>').appendTo(document.body);
|
||||||
|
} else {
|
||||||
dialog({
|
dialog({
|
||||||
html: '<div id="portalcounts">' + counts + '</div>',
|
html: '<div id="portalcounts">' + counts + '</div>',
|
||||||
title: 'Portal counts: ' + total + ' ' + (total == 1 ? 'portal' : 'portals'),
|
title: 'Portal counts: ' + title,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.plugin.portalcounts.onPaneChanged = function(pane) {
|
||||||
|
if(pane == "plugin-portalcounts")
|
||||||
|
window.plugin.portalcounts.getPortals();
|
||||||
|
else
|
||||||
|
$("#portalcounts").remove()
|
||||||
|
};
|
||||||
|
|
||||||
var setup = function() {
|
var setup = function() {
|
||||||
|
if(typeof android !== 'undefined' && android && android.addPane) {
|
||||||
|
android.addPane("plugin-portalcounts", "Portal counts", "ic_action_data_usage");
|
||||||
|
addHook("paneChanged", window.plugin.portalcounts.onPaneChanged);
|
||||||
|
} else {
|
||||||
$('#toolbox').append(' <a onclick="window.plugin.portalcounts.getPortals()" title="Display a summary of portals in the current view">Portal counts</a>');
|
$('#toolbox').append(' <a onclick="window.plugin.portalcounts.getPortals()" title="Display a summary of portals in the current view">Portal counts</a>');
|
||||||
|
}
|
||||||
|
|
||||||
$('head').append('<style>' +
|
$('head').append('<style>' +
|
||||||
|
'#portalcounts.mobile {background: transparent; border: 0 none !important; height: 100% !important; width: 100% !important; left: 0 !important; top: 0 !important; position: absolute; overflow: auto; }' +
|
||||||
'#portalcounts table {margin-top:5px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' +
|
'#portalcounts table {margin-top:5px; border-collapse: collapse; empty-cells: show; width:100%; clear: both;}' +
|
||||||
'#portalcounts table td, #portalcounts table th {border-bottom: 1px solid #0b314e; padding:3px; color:white; background-color:#1b415e}' +
|
'#portalcounts table td, #portalcounts table th {border-bottom: 1px solid #0b314e; padding:3px; color:white; background-color:#1b415e}' +
|
||||||
'#portalcounts table tr.res th { background-color: #005684; }' +
|
'#portalcounts table tr.res th { background-color: #005684; }' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user