Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniques040 #416

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e40f8d9
Adding support for scouted and droned portals
MysticJay Jul 21, 2020
e910348
Highlighters
MysticJay Jul 27, 2020
d25d2bc
sorting portalslist fixed
MysticJay Jul 29, 2020
9c3f0e4
sorting uniques fixed
MysticJay Jul 29, 2020
3c81052
First commit
c-schmitz Apr 2, 2016
9d241b0
Fixed linebreaks
c-schmitz Apr 2, 2016
39c895b
Create README.md
c-schmitz Apr 2, 2016
1c2be75
-Added import - will never delete, only update portals
c-schmitz Apr 3, 2016
9065df4
Updated README
c-schmitz Apr 3, 2016
02677ee
Fixed include/match header lines for the new Intel URL. (#1)
koljanowak Nov 1, 2018
776d6de
Uniques-Export
MysticJay Aug 7, 2020
4915487
0.3.9 beta 1
MysticJay Aug 14, 2020
261df5c
UNIQUES 0.3.9beta2
MysticJay Aug 16, 2020
9df1f89
UNIQUES 0.3.9rc1
MysticJay Aug 19, 2020
85d4606
Cleanup
MysticJay Aug 20, 2020
d8bc646
PortalList-Dialog fixed
MysticJay Aug 26, 2020
010d107
Typo fix
MysticJay Aug 31, 2020
7dc6fc9
abandoned dialog
MysticJay Aug 31, 2020
40f4761
Update uniques.js
MysticJay Sep 10, 2020
0f906e4
Import fixed
MysticJay Oct 26, 2020
77f0150
Undoing indentation
MysticJay Dec 18, 2020
684360e
indentation of headers
MysticJay Dec 28, 2020
72b151d
Bump version to 0.4.0
MysticJay Jan 1, 2021
6bdde02
include uniques.css
MysticJay Jan 16, 2021
0e186c9
New visits in COMM
MysticJay Jan 17, 2021
7abfc34
removing confirm
MysticJay Jan 21, 2021
4688eb8
unified highlighter names
MysticJay Feb 11, 2021
251efa2
UI fixes
MysticJay Feb 11, 2021
d967382
Apply suggestions from code review done (@Johnd0e)
MysticJay Feb 15, 2021
bacb3dc
Code style fixes
MysticJay Feb 15, 2021
01b481e
Code style
MysticJay Feb 15, 2021
c25d7d2
style fixes
MysticJay Feb 18, 2021
2f633fa
propertyNames
MysticJay Feb 21, 2021
6b95ed8
Code-style fixes
MysticJay Feb 21, 2021
4f0efc8
Update uniques.css
MysticJay Feb 21, 2021
630890e
Update plugins/uniques.js
MysticJay Aug 3, 2023
c2ee7f0
Update uniques.css
MysticJay Aug 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions IngressUniqueExporter.user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// ==UserScript==
// @id iitc-plugin-uniqueinfo-exporter@c-schmitz
// @name IITC plugin: Unique Info Import/Export
// @category Misc
// @version 0.0.0.3
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL https://github.com/c-schmitz/iitc-unique-export/raw/master/IngressUniqueExporter.user.js
// @downloadURL https://github.com/c-schmitz/iitc-unique-export/raw/master/IngressUniqueExporter.user.js
// @description Import/exports the unique capture/visits info to/from a JSON file. This plugin requires the IITC Unique plugin to be installed.
// @include https://intel.ingress.com/*
// @include http://intel.ingress.com/*
// @match https://intel.ingress.com/*
// @match http://intel.ingress.com/*
// @grant none
// ==/UserScript==

function wrapper() {
// in case IITC is not available yet, define the base plugin object
if (typeof window.plugin !== "function") {
window.plugin = function() {};
}
// base context for plugin
window.plugin.uniqueinfo = function() {};
var self = window.plugin.uniqueinfo;
self.save = function save() {
if (!confirm("Please only confirm this if you know what you are doing!!\nAre you sure you want to save your Unique visits/captures back to IITC?")) return;

window.plugin.uniques.uniques=$.parseJSON( $('#taUCExportImport').val() );
window.plugin.sync.updateMap('uniques', 'uniques', Object.keys(window.plugin.uniques.uniques));
}

self.gen = function gen() {

sExportUniqueJSON='{'+"\n";
aoPortals=window.plugin.uniques.uniques;
visited=captured=0;
$.each(aoPortals,function(PUID){
aPortal=window.plugin.uniques.uniques[PUID];
if (aPortal.visited) visited++;
if (aPortal.captured) captured++;
});
sExportUniqueJSON=JSON.stringify(window.plugin.uniques.uniques,null,4);

var dialog = window.dialog({
title: "Ingress unique visits/captures JSON export",
html: '<span>Find all of your visited/captured portals as JSON below (visited: '+visited+' - captured: '+captured+'):</span>'
+ '<textarea id="taUCExportImport" style="width: 570px; height: ' + ($(window).height() - 230) + 'px; margin-top: 5px;"></textarea><a onclick=\"window.plugin.uniqueinfo.save();\" title=\"Save unique UV/UC info to IITC.\">Save</a>'
}).parent();
$(".ui-dialog-buttonpane", dialog).remove();
// width first, then centre
dialog.css("width", 600).css({
"top": ($(window).height() - dialog.height()) / 2,
"left": ($(window).width() - dialog.width()) / 2
});
$("#taUCExportImport").val(sExportUniqueJSON);
return dialog;
}
// setup function called by IITC
self.setup = function init() {
// add controls to toolbox
var link = $("<a onclick=\"window.plugin.uniqueinfo.gen();\" title=\"Export/import a JSON of portals and their unique visit/capture status.\">UV/UC export/import</a>");
$("#toolbox").append(link);
// delete setup to ensure init can't be run again
delete self.setup;
}
// IITC plugin setup
if (window.iitcLoaded && typeof self.setup === "function") {
self.setup();
} else if (window.bootPlugins) {
window.bootPlugins.push(self.setup);
} else {
window.bootPlugins = [self.setup];
}
}
// inject plugin into page
var script = document.createElement("script");
script.appendChild(document.createTextNode("(" + wrapper + ")();"));
(document.body || document.head || document.documentElement).appendChild(script);
52 changes: 5 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,8 @@
Ingress Intel Total Conversion (IITC)
=====================================
# iitc-unique-export

<!-- [START badges] -->
[![Build Status](https://img.shields.io/travis/com/iitc-ce/ingress-intel-total-conversion/master?label=beta)](https://travis-ci.com/IITC-CE/ingress-intel-total-conversion)
[![Build Status](https://img.shields.io/travis/com/iitc-ce/ingress-intel-total-conversion/test-builds?label=test-builds)](https://travis-ci.com/IITC-CE/ingress-intel-total-conversion)
[![Docs Status](https://readthedocs.org/projects/iitc-ce/badge/?version=latest)](https://readthedocs.org/projects/iitc-ce/)
[![LICENSE](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
<!-- [END badges] -->
This is an IITC plugin to export/import your unique captures/visits from/to IITC as a JSON format.
The Uniques plugins and a functioning syncronisation is required, of course.

IITC is a browser add-on that modifies the Ingress intel map.
It is faster than the standard site, and offers many more features.
It is available for desktop browsers, such as Firefox and Chrome, and as a mobile application.
The exported/imported data consists of the Unique Portal ID, visited and captured status, all in JSON format.

**IITC "Community Edition"** (**_IITC-CE_**) started by [modos189](https://github.com/modos189) to continue development of stalled [iitc-project](https://github.com/iitc-project/ingress-intel-total-conversion).

**[Website](https://iitc.app/) | [Documentation](https://iitc-ce.rtfd.io/) | [Telegram channel](https://t.me/iitc_news)**


## Users

Install IITC: https://iitc.app/

Latest news, release announcements, etc:
- https://www.reddit.com/r/IITC/
- https://t.me/iitc_news

[Report](https://github.com/IITC-CE/ingress-intel-total-conversion/issues/new) an issue: [wiki/Reporting-Bugs](https://github.com/IITC-CE/ingress-intel-total-conversion/wiki/Reporting-Bugs)


## Developers

See [Contribution Guidelines](https://github.com/IITC-CE/ingress-intel-total-conversion/wiki/CONTRIBUTING.md)
and [Quickstart](https://github.com/IITC-CE/ingress-intel-total-conversion/wiki/HACKING.md#quickstart).


## Related projects

- **https://iitc.app**: IITC-CE homepage, template developed [here][iitc.app].

- **[IITC-Button]**: browser extension, the easiest (though not sole) way to use IITC on desktop.

- **[IITC Mobile]**: Android app developed [here](https://github.com/IITC-CE/ingress-intel-total-conversion/tree/master/mobile).

- **[IITC-Mobile for iOS]**: 3rd-party application, developed by [_Yangkun Zhang_](https://github.com/HubertZhang).

[iitc.app]: https://github.com/IITC-CE/iitc.app
[IITC-Button]: https://github.com/IITC-CE/IITC-Button
[IITC Mobile]: https://github.com/IITC-CE/ingress-intel-total-conversion/wiki/IITC-Mobile-(Android-app)
[IITC-Mobile for iOS]: https://github.com/HubertZhang/IITC-Mobile
Please note that when saving (=importing) the list of uniques any existing uniques will never be deleted, only updated.
4 changes: 4 additions & 0 deletions plugins/uniques.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
margin-top: -5px;
margin-bottom: -5px;
}

.ui-dialog.ui-dialog-portallist {
max-width: max-width: calc(100vw - 2px);
}
MysticJay marked this conversation as resolved.
Show resolved Hide resolved
Loading