Skip to content

Commit

Permalink
Merge pull request #641 from xscreach/feature/changelog
Browse files Browse the repository at this point in the history
Changelog
  • Loading branch information
modos189 authored Jul 10, 2023
2 parents 23c077e + 3d48de3 commit f979fe2
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 20 deletions.
66 changes: 48 additions & 18 deletions core/code/dialog_about.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,22 @@ window.aboutIITC = function() {
}

function createDialogContent() {
var html = ''
+ '<div><b>About IITC</b></div> '
+ '<div>Ingress Intel Total Conversion</div> '
+ '<hr>'
+ '<div>'
+ ' <a href="'+'@url_homepage@'+'" target="_blank">IITC Homepage</a> |'
+ ' <a href="'+'@url_tg@'+'" target="_blank">Telegram channel</a><br />'
+ ' On the script’s homepage you can:'
+ ' <ul>'
+ ' <li>Find Updates</li>'
+ ' <li>Get Plugins</li>'
+ ' <li>Report Bugs</li>'
+ ' <li>Contribute!</li>'
+ ' </ul>'
+ '</div>'
+ '<hr>'
+ '<div>Version: ' + getIITCVersion() + '</div>';
var html = `<div><b>About IITC</b></div>
<div>Ingress Intel Total Conversion</div>
<hr>
<div>
<a href="@url_homepage@" target="_blank">IITC Homepage</a> |
<a href="@url_tg@" target="_blank">Telegram channel</a><br />
On the script’s homepage you can:
<ul>
<li>Find Updates</li>
<li>Get Plugins</li>
<li>Report Bugs</li>
<li>Contribute!</li>
</ul>
</div>
<hr>
<div>Version: ${getIITCVersion()} ${createChangelog(window.script_info)}</div>`;

if (isShortOnLocalStorage()) {
html += '<div class="warning">You are running low on LocalStorage memory.<br/>Please free some space to prevent data loss.</div>';
Expand Down Expand Up @@ -75,6 +74,8 @@ function convertPluginInfo(info, index) {
// (atm: IITC-Mobile for iOS)
var result = {
build: info.buildName,
changelog: info.changelog,
id: info.pluginId,
name: info.pluginId,
date: info.dateTimeVersion,
error: info.error,
Expand Down Expand Up @@ -103,8 +104,33 @@ function convertPluginInfo(info, index) {
return result;
}

function createChangelog(plugin) {
var id = 'plugin-changelog-' + plugin.id;
return (
`<a onclick="$('#${id}').toggle()">changelog</a>` +
`<ul id="${id}" style="display: none;">` +
plugin.changelog
.map(function (logEntry) {
return (
'<li>' +
logEntry.version +
'<ul>' +
logEntry.changes
.map(function (change) {
return `<li>${change}</li>`;
})
.join('') +
'</ul></li>'
);
})
.join('') +
'</ul>'
);
}

function pluginInfoToString(p, extra) {
var info = {
changelog: '',
class: '',
description: p.description || '',
name: p.name,
Expand All @@ -120,7 +146,11 @@ function pluginInfoToString(p, extra) {
info.description = p.error;
}

return L.Util.template('<li class="{class}" title="{description}">{name}{verinfo}</li>', info);
if (p.changelog) {
info.changelog = createChangelog(p);
}

return L.Util.template('<li class="{class}" title="{description}">{name}{verinfo} {changelog}</li>', info);
}


Expand Down
8 changes: 7 additions & 1 deletion core/total-conversion-build.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// @author jonatkins
// @name IITC: Ingress intel map total conversion
// @version 0.35.1
// @version 0.36.0
// @description Total conversion for the ingress intel map.
// @run-at document-end


window.script_info = plugin_info;
window.script_info.changelog = [
{
version: '0.36.0',
changes: ['Ability to define and display changelog'],
},
];

// REPLACE ORIG SITE ///////////////////////////////////////////////////
if (document.documentElement.getAttribute('itemscope') !== null) {
Expand Down
9 changes: 8 additions & 1 deletion plugins/machina-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
// @version 1.0.0
// @description Show locations of Machina activities

/* exported setup --eslint */
/* exported setup, changelog --eslint */
/* global L */

var changelog = [
{
version: '1.0.0',
changes: ['First version'],
},
];

// ensure plugin framework is there, even if iitc is not yet loaded
if (typeof window.plugin !== 'function') window.plugin = function () {};

Expand Down
8 changes: 8 additions & 0 deletions plugins/player-activity-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
// @version 0.12.2
// @description Draw trails for the path a user took onto the map based on status messages in COMMs. Uses up to three hours of data. Does not request chat data on its own, even if that would be useful.

/* exported setup, changelog --eslint */

var changelog = [
{
version: '0.12.2',
changes: ['🐛 - Exclude __MACHINA__ actions'],
},
];

window.PLAYER_TRACKER_MAX_TIME = 3*60*60*1000; // in milliseconds
window.PLAYER_TRACKER_MIN_ZOOM = 9;
Expand Down
1 change: 1 addition & 0 deletions pluginwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

setup = """
setup.info = plugin_info; //add the script info data to the function as a property
if (typeof changelog !== 'undefined') setup.info.changelog = changelog;
if(!window.bootPlugins) window.bootPlugins = [];
window.bootPlugins.push(setup);
// if IITC has already booted, immediately run the 'setup' function
Expand Down

0 comments on commit f979fe2

Please sign in to comment.