From d07633554312b340cb644a61ab5d83bf6e4dd8d1 Mon Sep 17 00:00:00 2001 From: insane210 Date: Sat, 21 Mar 2015 23:39:01 +0100 Subject: [PATCH 01/10] Create screenshot-mode.user.js --- plugins/screenshot-mode.user.js | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 plugins/screenshot-mode.user.js diff --git a/plugins/screenshot-mode.user.js b/plugins/screenshot-mode.user.js new file mode 100644 index 000000000..c7d4d63bf --- /dev/null +++ b/plugins/screenshot-mode.user.js @@ -0,0 +1,49 @@ +// ==UserScript== +// @id iitc-plugin-screenshot-mode@insane210 +// @name IITC plugin: Screenshot mode +// @category Misc +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Hide user interface +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +// use own namespace for plugin +window.plugin.screenshotMode = function() {}; + +window.plugin.screenshotMode.hideUI = function () { + $('#chatcontrols').toggle(); + $('#chat').toggle(); + $('#chatinput').toggle(); + $('#sidebartoggle').toggle(); + $('#scrollwrapper').toggle(); + $('#updatestatus').toggle(); + $('#bkmrksTrigger').toggle(); + $('#bookmarksBox').toggle(); + $('#portal_highlight_select').toggle(); + $('.leaflet-control-container').toggle(); +} + +var setup = function() { + document.addEventListener('keydown', function(e) { + // pressed alt+h + if (e.keyCode == 72 && !e.shiftKey && !e.ctrlKey && e.altKey && !e.metaKey) { + window.plugin.screenshotMode.hideUI(); + } + }, false); + $('#toolbox').append(' Hide UI'); +} + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ From b0b4eece5162252c3e7e9625d746aa209a15909d Mon Sep 17 00:00:00 2001 From: insane210 Date: Mon, 6 Apr 2015 00:11:15 +0200 Subject: [PATCH 02/10] Update and rename screenshot-mode.user.js to custom-ui.user.js --- plugins/custom-ui.user.js | 123 ++++++++++++++++++++++++++++++++ plugins/screenshot-mode.user.js | 49 ------------- 2 files changed, 123 insertions(+), 49 deletions(-) create mode 100644 plugins/custom-ui.user.js delete mode 100644 plugins/screenshot-mode.user.js diff --git a/plugins/custom-ui.user.js b/plugins/custom-ui.user.js new file mode 100644 index 000000000..7f4c01ae0 --- /dev/null +++ b/plugins/custom-ui.user.js @@ -0,0 +1,123 @@ +// ==UserScript== +// @id iitc-plugin-custom-ui@insane210 +// @name IITC plugin: Custom UI +// @category Misc +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Hide user interface elements +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +// use own namespace for plugin +window.plugin.customUI = function() {}; + +window.plugin.customUI.ScreenshotMode = false; + +window.plugin.customUI.loadSettings = function () { + if (localStorage.getItem('customUI') == null) { + var options = { + // id: [enabled, 'name'], + chatcontrols: [true, 'Chattabs'], + chat: [true, 'Chat'], + chatinput: [true, 'Chatinput'], + sidebar: [true, 'Sidebar'], + updatestatus: [true, 'Statusbar'], + bookmarks: [true, 'Bookmarks'], + portal_highlight_select: [true, 'Portal highlighter'], + drawtools: [true, 'Drawtools'], + mouse: [true, 'Mouse pointer'], + }; + + localStorage.setItem('customUI', options); + }; + + window.plugin.customUI.options = localStorage.getItem('customUI'); +} + +window.plugin.customUI.toggleScreenshotMode = function () { + if (window.plugin.customUI.ScreenshotMode) { + $('#chatcontrols').toggle(); + $('#chat').toggle(); + $('#chatinput').toggle(); + $('#sidebartoggle').toggle(); + $('#scrollwrapper').toggle(); + $('#updatestatus').toggle(); + $('#bkmrksTrigger').toggle(); + $('#bookmarksBox').toggle(); + $('#portal_highlight_select').toggle(); + $('.leaflet-control-container').toggle(); + + $('*').css({'cursor': ''}); + + window.plugin.customUI.ScreenshotMode = false; + } else { + $('#chatcontrols').toggle(); + $('#chat').toggle(); + $('#chatinput').toggle(); + $('#sidebartoggle').toggle(); + $('#scrollwrapper').toggle(); + $('#updatestatus').toggle(); + $('#bkmrksTrigger').toggle(); + $('#bookmarksBox').toggle(); + $('#portal_highlight_select').toggle(); + $('.leaflet-control-container').toggle(); + + $('*').css({'cursor': 'none'}); + + window.plugin.customUI.ScreenshotMode = true; + } +} + +window.plugin.customUI.showOptions = function() { + + var html = '' + + '' + + '' + + ''; + // + 'Copy Drawn Items' + // + 'Paste Drawn Items' + // + (window.requestFile != undefined + // ? 'Import Drawn Items' : '') + // + ((typeof android !== 'undefined' && android && android.saveFile) + // ? 'Export Drawn Items' : '') + // + 'Reset Drawn Items' + // + 'Snap to portals'; + + dialog({ + html: html, + id: 'plugin-customUI-options', + dialogClass: 'ui-dialog', + title: 'Custom UI Options' + }); +} + +var setup = function() { + $('head').append(''); + + window.plugin.customUI.loadSettings(); + + document.addEventListener('keydown', function(e) { + // pressed alt+h + if (e.keyCode == 72 && !e.shiftKey && !e.ctrlKey && e.altKey && !e.metaKey) { + window.plugin.customUI.toggleScreenshotMode(); + } + }, false); + $('#toolbox').append(' Custom UI Opt'); +} + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ diff --git a/plugins/screenshot-mode.user.js b/plugins/screenshot-mode.user.js deleted file mode 100644 index c7d4d63bf..000000000 --- a/plugins/screenshot-mode.user.js +++ /dev/null @@ -1,49 +0,0 @@ -// ==UserScript== -// @id iitc-plugin-screenshot-mode@insane210 -// @name IITC plugin: Screenshot mode -// @category Misc -// @version 0.1.0.@@DATETIMEVERSION@@ -// @namespace https://github.com/jonatkins/ingress-intel-total-conversion -// @updateURL @@UPDATEURL@@ -// @downloadURL @@DOWNLOADURL@@ -// @description [@@BUILDNAME@@-@@BUILDDATE@@] Hide user interface -// @include https://www.ingress.com/intel* -// @include http://www.ingress.com/intel* -// @match https://www.ingress.com/intel* -// @match http://www.ingress.com/intel* -// @grant none -// ==/UserScript== - -@@PLUGINSTART@@ - -// PLUGIN START //////////////////////////////////////////////////////// - -// use own namespace for plugin -window.plugin.screenshotMode = function() {}; - -window.plugin.screenshotMode.hideUI = function () { - $('#chatcontrols').toggle(); - $('#chat').toggle(); - $('#chatinput').toggle(); - $('#sidebartoggle').toggle(); - $('#scrollwrapper').toggle(); - $('#updatestatus').toggle(); - $('#bkmrksTrigger').toggle(); - $('#bookmarksBox').toggle(); - $('#portal_highlight_select').toggle(); - $('.leaflet-control-container').toggle(); -} - -var setup = function() { - document.addEventListener('keydown', function(e) { - // pressed alt+h - if (e.keyCode == 72 && !e.shiftKey && !e.ctrlKey && e.altKey && !e.metaKey) { - window.plugin.screenshotMode.hideUI(); - } - }, false); - $('#toolbox').append(' Hide UI'); -} - -// PLUGIN END ////////////////////////////////////////////////////////// - -@@PLUGINEND@@ From b42340890becf094f648ac387c58261ceff65f72 Mon Sep 17 00:00:00 2001 From: insane210 Date: Sat, 25 Apr 2015 18:10:25 +0200 Subject: [PATCH 03/10] Update custom-ui.user.js --- plugins/custom-ui.user.js | 123 ++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 57 deletions(-) diff --git a/plugins/custom-ui.user.js b/plugins/custom-ui.user.js index 7f4c01ae0..a6ea81a3d 100644 --- a/plugins/custom-ui.user.js +++ b/plugins/custom-ui.user.js @@ -20,70 +20,78 @@ // use own namespace for plugin window.plugin.customUI = function() {}; - + window.plugin.customUI.ScreenshotMode = false; window.plugin.customUI.loadSettings = function () { - if (localStorage.getItem('customUI') == null) { - var options = { - // id: [enabled, 'name'], - chatcontrols: [true, 'Chattabs'], - chat: [true, 'Chat'], - chatinput: [true, 'Chatinput'], - sidebar: [true, 'Sidebar'], - updatestatus: [true, 'Statusbar'], - bookmarks: [true, 'Bookmarks'], - portal_highlight_select: [true, 'Portal highlighter'], - drawtools: [true, 'Drawtools'], - mouse: [true, 'Mouse pointer'], - }; - - localStorage.setItem('customUI', options); - }; - - window.plugin.customUI.options = localStorage.getItem('customUI'); -} + if (localStorage.getItem('customUI') === null) { + var options = { + // id: [enabled, 'name'], + chatcontrols: [true, 'Chattabs'], + chat: [true, 'Chat'], + chatinput: [true, 'Chatinput'], + sidebar: [true, 'Sidebar'], + updatestatus: [true, 'Statusbar'], + bookmarks: [true, 'Bookmarks'], + portal_highlight_select: [true, 'Portal highlighter'], + drawtools: [true, 'Drawtools'], + mouse: [true, 'Mouse pointer'], + }; + + localStorage.setItem('customUI', options); + }; + + window.plugin.customUI.options = localStorage.getItem('customUI'); +}; + +window.plugin.customUI.resetSettings = function () { + localStorage.removeItem('customUI'); + + window.plugin.customUI.loadSettings(); +}; window.plugin.customUI.toggleScreenshotMode = function () { if (window.plugin.customUI.ScreenshotMode) { - $('#chatcontrols').toggle(); - $('#chat').toggle(); - $('#chatinput').toggle(); - $('#sidebartoggle').toggle(); - $('#scrollwrapper').toggle(); - $('#updatestatus').toggle(); - $('#bkmrksTrigger').toggle(); - $('#bookmarksBox').toggle(); - $('#portal_highlight_select').toggle(); - $('.leaflet-control-container').toggle(); - - $('*').css({'cursor': ''}); - - window.plugin.customUI.ScreenshotMode = false; + $('#chatcontrols').toggle(); + $('#chat').toggle(); + $('#chatinput').toggle(); + $('#sidebartoggle').toggle(); + $('#scrollwrapper').toggle(); + $('#updatestatus').toggle(); + $('#bkmrksTrigger').toggle(); + $('#bookmarksBox').toggle(); + $('#portal_highlight_select').toggle(); + $('.leaflet-control-container').toggle(); + + $('*').css({'cursor': ''}); + + window.plugin.customUI.ScreenshotMode = false; } else { - $('#chatcontrols').toggle(); - $('#chat').toggle(); - $('#chatinput').toggle(); - $('#sidebartoggle').toggle(); - $('#scrollwrapper').toggle(); - $('#updatestatus').toggle(); - $('#bkmrksTrigger').toggle(); - $('#bookmarksBox').toggle(); - $('#portal_highlight_select').toggle(); - $('.leaflet-control-container').toggle(); - - $('*').css({'cursor': 'none'}); - - window.plugin.customUI.ScreenshotMode = true; + $('#chatcontrols').toggle(); + $('#chat').toggle(); + $('#chatinput').toggle(); + $('#sidebartoggle').toggle(); + $('#scrollwrapper').toggle(); + $('#updatestatus').toggle(); + $('#bkmrksTrigger').toggle(); + $('#bookmarksBox').toggle(); + $('#portal_highlight_select').toggle(); + $('.leaflet-control-container').toggle(); + + $('*').css({'cursor': 'none'}); + + window.plugin.customUI.ScreenshotMode = true; } -} +}; window.plugin.customUI.showOptions = function() { - var html = '' - + '' - + '' - + ''; + var html = 'Reset Settings' + + '
' + + '' + + '' + + '' + + ''; // + 'Copy Drawn Items' // + 'Paste Drawn Items' // + (window.requestFile != undefined @@ -99,16 +107,17 @@ window.plugin.customUI.showOptions = function() { dialogClass: 'ui-dialog', title: 'Custom UI Options' }); -} +}; var setup = function() { $('head').append(''); - + window.plugin.customUI.loadSettings(); - + document.addEventListener('keydown', function(e) { // pressed alt+h if (e.keyCode == 72 && !e.shiftKey && !e.ctrlKey && e.altKey && !e.metaKey) { @@ -116,7 +125,7 @@ var setup = function() { } }, false); $('#toolbox').append(' Custom UI Opt'); -} +}; // PLUGIN END ////////////////////////////////////////////////////////// From 4b5d343b308d466be79ae2c888d89ec69c3a21eb Mon Sep 17 00:00:00 2001 From: insane210 Date: Sun, 17 May 2015 00:54:08 +0200 Subject: [PATCH 04/10] Update and rename custom-ui.user.js to hide-ui.user.js --- plugins/custom-ui.user.js | 132 ----------------------------- plugins/hide-ui.user.js | 172 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 172 insertions(+), 132 deletions(-) delete mode 100644 plugins/custom-ui.user.js create mode 100644 plugins/hide-ui.user.js diff --git a/plugins/custom-ui.user.js b/plugins/custom-ui.user.js deleted file mode 100644 index a6ea81a3d..000000000 --- a/plugins/custom-ui.user.js +++ /dev/null @@ -1,132 +0,0 @@ -// ==UserScript== -// @id iitc-plugin-custom-ui@insane210 -// @name IITC plugin: Custom UI -// @category Misc -// @version 0.1.0.@@DATETIMEVERSION@@ -// @namespace https://github.com/jonatkins/ingress-intel-total-conversion -// @updateURL @@UPDATEURL@@ -// @downloadURL @@DOWNLOADURL@@ -// @description [@@BUILDNAME@@-@@BUILDDATE@@] Hide user interface elements -// @include https://www.ingress.com/intel* -// @include http://www.ingress.com/intel* -// @match https://www.ingress.com/intel* -// @match http://www.ingress.com/intel* -// @grant none -// ==/UserScript== - -@@PLUGINSTART@@ - -// PLUGIN START //////////////////////////////////////////////////////// - -// use own namespace for plugin -window.plugin.customUI = function() {}; - -window.plugin.customUI.ScreenshotMode = false; - -window.plugin.customUI.loadSettings = function () { - if (localStorage.getItem('customUI') === null) { - var options = { - // id: [enabled, 'name'], - chatcontrols: [true, 'Chattabs'], - chat: [true, 'Chat'], - chatinput: [true, 'Chatinput'], - sidebar: [true, 'Sidebar'], - updatestatus: [true, 'Statusbar'], - bookmarks: [true, 'Bookmarks'], - portal_highlight_select: [true, 'Portal highlighter'], - drawtools: [true, 'Drawtools'], - mouse: [true, 'Mouse pointer'], - }; - - localStorage.setItem('customUI', options); - }; - - window.plugin.customUI.options = localStorage.getItem('customUI'); -}; - -window.plugin.customUI.resetSettings = function () { - localStorage.removeItem('customUI'); - - window.plugin.customUI.loadSettings(); -}; - -window.plugin.customUI.toggleScreenshotMode = function () { - if (window.plugin.customUI.ScreenshotMode) { - $('#chatcontrols').toggle(); - $('#chat').toggle(); - $('#chatinput').toggle(); - $('#sidebartoggle').toggle(); - $('#scrollwrapper').toggle(); - $('#updatestatus').toggle(); - $('#bkmrksTrigger').toggle(); - $('#bookmarksBox').toggle(); - $('#portal_highlight_select').toggle(); - $('.leaflet-control-container').toggle(); - - $('*').css({'cursor': ''}); - - window.plugin.customUI.ScreenshotMode = false; - } else { - $('#chatcontrols').toggle(); - $('#chat').toggle(); - $('#chatinput').toggle(); - $('#sidebartoggle').toggle(); - $('#scrollwrapper').toggle(); - $('#updatestatus').toggle(); - $('#bkmrksTrigger').toggle(); - $('#bookmarksBox').toggle(); - $('#portal_highlight_select').toggle(); - $('.leaflet-control-container').toggle(); - - $('*').css({'cursor': 'none'}); - - window.plugin.customUI.ScreenshotMode = true; - } -}; - -window.plugin.customUI.showOptions = function() { - - var html = 'Reset Settings' + - '
' + - '' + - '' + - '' + - ''; - // + 'Copy Drawn Items' - // + 'Paste Drawn Items' - // + (window.requestFile != undefined - // ? 'Import Drawn Items' : '') - // + ((typeof android !== 'undefined' && android && android.saveFile) - // ? 'Export Drawn Items' : '') - // + 'Reset Drawn Items' - // + 'Snap to portals'; - - dialog({ - html: html, - id: 'plugin-customUI-options', - dialogClass: 'ui-dialog', - title: 'Custom UI Options' - }); -}; - -var setup = function() { - $('head').append(''); - - window.plugin.customUI.loadSettings(); - - document.addEventListener('keydown', function(e) { - // pressed alt+h - if (e.keyCode == 72 && !e.shiftKey && !e.ctrlKey && e.altKey && !e.metaKey) { - window.plugin.customUI.toggleScreenshotMode(); - } - }, false); - $('#toolbox').append(' Custom UI Opt'); -}; - -// PLUGIN END ////////////////////////////////////////////////////////// - -@@PLUGINEND@@ diff --git a/plugins/hide-ui.user.js b/plugins/hide-ui.user.js new file mode 100644 index 000000000..ae647d12e --- /dev/null +++ b/plugins/hide-ui.user.js @@ -0,0 +1,172 @@ +// ==UserScript== +// @id iitc-plugin-hide-ui@insane210 +// @name IITC plugin: Hide UI +// @category Misc +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Hide user interface elements +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +// use own namespace for plugin +window.plugin.hideUI = function() {}; + +// store current state of screenshot mode +window.plugin.hideUI.ScreenshotMode = false; + + +// write settings to local storage +window.plugin.hideUI.saveSettings = function () { + localStorage.setItem('hideUI', JSON.stringify(window.plugin.hideUI.options)); +}; + + +// load settings from local storage +window.plugin.hideUI.loadSettings = function () { + // if settings not available, create new object with default values + if (localStorage.getItem('hideUI') === null) { + var options = { + // id: [boolean enabled, string name], + chatwrapper: [true, 'Chat'], + sidebarwrapper: [true, 'Sidebar'], + updatestatus: [true, 'Statusbar'], + bookmarksBox: [true, 'Bookmarks Box'], + portal_highlight_select: [true, 'Portal highlighter'], + drawtools: [true, 'Drawtools'], + }; + + localStorage.setItem('hideUI', JSON.stringify(options)); + }; + + window.plugin.hideUI.options = JSON.parse(localStorage.getItem('hideUI')); +}; + + +// reset settings back to default values +window.plugin.hideUI.resetSettings = function () { + localStorage.removeItem('hideUI'); + + window.plugin.hideUI.loadSettings(); +}; + + +// hide or show UI elements depending on settings +window.plugin.hideUI.applySettings = function () { + for (var key in window.plugin.hideUI.options) { + if (window.plugin.hideUI.options.hasOwnProperty(key)) { + var option = window.plugin.hideUI.options[key]; + + if (option.hasOwnProperty('0')){ + if (option[0] === true) { + $('#'+key).show(); + } else { + $('#'+key).hide(); + }; + } + } + } +}; + + +// switch screenshot mode on or off +window.plugin.hideUI.toggleScreenshotMode = function () { + if (window.plugin.hideUI.ScreenshotMode) { + $('#chatwrapper').show(); + $('#sidebarwrapper').show(); + $('#updatestatus').show(); + $('#bkmrksTrigger').show(); + $('#bookmarksBox').show(); + $('#portal_highlight_select').show(); + $('#leaflet-control-container').show(); + + $('*').css({'cursor': ''}); + + window.plugin.hideUI.ScreenshotMode = false; + } else { + $('#chatwrapper').hide(); + $('#sidebarwrapper').hide(); + $('#updatestatus').hide(); + $('#bkmrksTrigger').hide(); + $('#bookmarksBox').hide(); + $('#portal_highlight_select').hide(); + $('#leaflet-control-container').hide(); + + $('*').css({'cursor': 'none'}); + + window.plugin.hideUI.ScreenshotMode = true; + } +}; + + +window.plugin.hideUI.showOptions = function() { + + var html = 'Reset Settings' + + '
' + + '
Always hide:
'; + + for (var key in window.plugin.hideUI.options) { + if (window.plugin.hideUI.options.hasOwnProperty(key)) { + var option = window.plugin.hideUI.options[key]; + + if (option.hasOwnProperty('0')){ + html += '