diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index ce61c6a6..536085f0 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -112,13 +112,17 @@ window.plugin.portalslist.displayPL = function() { html = '
Nothing to show!
'; }; - dialog({ - html: '
' + html + '
', - dialogClass: 'ui-dialog-portalslist', - title: 'Portal list: ' + window.plugin.portalslist.listPortals.length + ' ' + (window.plugin.portalslist.listPortals.length == 1 ? 'portal' : 'portals'), - id: 'portal-list', - width: 700 - }); + if(typeof android !== 'undefined' && android && android.addPane) { + $('
' + html + '
').appendTo(document.body); + } else { + dialog({ + html: '
' + html + '
', + dialogClass: 'ui-dialog-portalslist', + title: 'Portal list: ' + window.plugin.portalslist.listPortals.length + ' ' + (window.plugin.portalslist.listPortals.length == 1 ? 'portal' : 'portals'), + id: 'portal-list', + width: 700 + }); + } //run the name resolving process //resolvePlayerNames(); @@ -224,9 +228,23 @@ window.plugin.portalslist.getPortalLink = function(portal,guid) { return div; } +window.plugin.portalslist.onPaneChanged = function(pane) { + if(pane == "plugin-portalslist") + window.plugin.portalslist.displayPL(); + else + $("#portalslist").remove() +}; + var setup = function() { - $('#toolbox').append(' Portals list'); + if(typeof android !== 'undefined' && android && android.addPane) { + android.addPane("plugin-portalslist", "Portals list", "ic_action_view_as_list"); + addHook("paneChanged", window.plugin.portalslist.onPaneChanged); + } else { + $('#toolbox').append(' Portals list'); + } + $('head').append('