From c6a6dc3105b05d490a0ecda0d93c3d95d03ffe2d Mon Sep 17 00:00:00 2001 From: fkloft Date: Thu, 3 Jul 2014 19:07:11 +0200 Subject: [PATCH] Privacy view: accesskey (9) + fixes - collapse chat before entering privacy view - don't allow chat to expand when in privacy view - disallow pointer events for the leaflet-control placeholder so ic can be clicked through --- code/boot.js | 3 ++- plugins/privacy-view.user.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/boot.js b/code/boot.js index a435f95d..da7d59ae 100644 --- a/code/boot.js +++ b/code/boot.js @@ -159,7 +159,8 @@ window.setupMap = function() { // TODO? move the actual IITC DOM into the leaflet control areas, so dummy
s aren't needed if(!isSmartphone()) { // chat window area - $(window.map._controlCorners['bottomleft']).append($('
').width(708).height(108).addClass('leaflet-control').css('margin','0')); + $(window.map._controlCorners['bottomleft']).append( + $('
').width(708).height(108).addClass('leaflet-control').css({'pointer-events': 'none', 'margin': '0'})); } var addLayers = {}; diff --git a/plugins/privacy-view.user.js b/plugins/privacy-view.user.js index 8f7fcd91..cf4a053c 100644 --- a/plugins/privacy-view.user.js +++ b/plugins/privacy-view.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id iitc-plugin-privacy-view@Scrool // @name IITC plugin: Privacy view on Intel -// @version 1.0.0.@@DATETIMEVERSION@@ +// @version 1.0.1.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @description [@@BUILDNAME@@-@@BUILDDATE@@] Hide info from intel which shouldn't leak to players of the other faction. // @updateURL @@UPDATEURL@@ @@ -25,6 +25,8 @@ window.plugin.privacyView.chatExpanded = function() { }; window.plugin.privacyView.toggle = function() { + if($('#chat').hasClass('expand')) window.plugin.privacyView.wrapChatToggle(); + var b = $('body'); var t = $('#privacycontrols .toggle'); if(b.hasClass('privacy_active')) { @@ -40,6 +42,8 @@ window.plugin.privacyView.toggle = function() { }; window.plugin.privacyView.wrapChatToggle = function() { + if($(document.body).hasClass('privacy_active')) return; + window.chat.toggle(); var c = $('#chat, #chatcontrols'); if(c.hasClass('expand')) { @@ -99,7 +103,7 @@ window.plugin.privacyView.setup = function() { $('#chatcontrols a:first').click(window.plugin.privacyView.wrapChatToggle); $('#chatcontrols').before('
' + - ' ' + + ' ' + '
'); $('#privacycontrols a').click(window.plugin.privacyView.toggle);