Skip to content

Commit

Permalink
7.1
Browse files Browse the repository at this point in the history
Adds v7 to Livecounts.net theme,
fixes goal counter on Livecounts.net theme,
warning when importing from different counters,
+1 sub when "Subscribe" is clicked,
manual counter input box is at bottom left
  • Loading branch information
RandomPerson3465 committed Sep 1, 2024
1 parent e622870 commit 76070da
Show file tree
Hide file tree
Showing 9 changed files with 1,839 additions and 1,055 deletions.
22 changes: 19 additions & 3 deletions counter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const LCEDIT = {
saveVersion: 5,
versionName: "7.0.11",
saveVersion: 6,
versionName: "7.1",
util: {
clamp: (input, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) => {
if (isNaN(input)) input = 0;
Expand Down Expand Up @@ -183,6 +183,7 @@ let defaultCounter = {
gainType: 0,
imageURL: "",
keepChartData: false,
lcNetSubButton: false,
max: Number.MAX_SAFE_INTEGER,
maxChartValues: 450,
maxRate: 0,
Expand Down Expand Up @@ -341,7 +342,8 @@ class Save {
apiInterval: 60,
leeway: 10,
updater: 0
}
},
this.project = "livecountsedit"
}
}

Expand All @@ -364,3 +366,17 @@ function exportToJSON(private = false) {
a.download = `${saveData.title}${private ? '-PRIVATE' : ''}.json`;
a.click();
}

function openTab(e, f) {
var a, b, c;
b = document.getElementsByClassName('tab-content');
for (a = 0; a < b.length; a++) {
b[a].style.display = 'none';
}
c = document.getElementsByClassName('tab-link');
for (a = 0; a < c.length; a++) {
c[a].className = c[a].className.replace(' active', '');
}
document.getElementById(f).style.display = 'block';
e.currentTarget.className += ' active'
}
2 changes: 1 addition & 1 deletion livecountsedit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</div>
</div>
<div class="page-footer">
<span>Version 7.0.11 - <a href="../index.html">Back to main page</a> - <a href="https://github.com/livecountsedit/livecountsedit.github.io/wiki/New-Updates-Not-Working%3F">Not working?</a> - <a href="../about/discord.html">Join the Livecountsedit Discord Server.</a> This site is a parody of popular realtime counters.</span>
<span>Version 7.1 - <a href="../index.html">Back to main page</a> - <a href="https://github.com/livecountsedit/livecountsedit.github.io/wiki/New-Updates-Not-Working%3F">Not working?</a> - <a href="../about/discord.html">Join the Livecountsedit Discord Server.</a> This site is a parody of popular realtime counters.</span>
</div>
<script src="../odometer/odometer.js"></script>
<script src="../highstock.js"></script>
Expand Down
25 changes: 7 additions & 18 deletions livecountsedit/lcedit.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
let chart;

function openTab(e, f) {
var a, b, c;
b = document.getElementsByClassName('tab-content');
for (a = 0; a < b.length; a++) {
b[a].style.display = 'none';
}
c = document.getElementsByClassName('tab-link');
for (a = 0; a < c.length; a++) {
c[a].className = c[a].className.replace(' active', '');
}
document.getElementById(f).style.display = 'block';
e.currentTarget.className += ' active'
}
const saveType = 1;

defaultCounter = Object.assign(defaultCounter, {
bannerURL: "https://lcedit.com/default_banner.png",
Expand All @@ -31,7 +18,7 @@ defaultCounter = Object.assign(defaultCounter, {

let odometers = [];

let saveData = new Save(1)
let saveData = new Save(saveType)
saveData.counters.push(new Counter(1))
counter = saveData.counters[0];

Expand Down Expand Up @@ -250,7 +237,7 @@ function reset(bypass = false) {
document.querySelector("#apiStatusIndicator").innerText = "--"
document.querySelector("#apiStatusIndicator").style.color = "#ffffff"
resetChart(true)
saveData = new Save(1)
saveData = new Save(saveType)
saveData.counters[0] = counter = new Counter(1);
fillForms()
updateStuff()
Expand Down Expand Up @@ -345,8 +332,6 @@ function refreshCount() {
document.querySelector('#count').value = counter.getApparentCount()
}



function importFromJSON(data, bypass=false) {
if (bypass || confirm("Are you sure? This will overwrite your current data.")) {
if (typeof data === 'string') {
Expand All @@ -357,6 +342,10 @@ function importFromJSON(data, bypass=false) {
}
}
if (!data.version || data.version > LCEDIT.saveVersion) return alert('Incompatible version');
if (data.saveType !== saveType) {
if (!bypass && !confirm("You are importing a save from a different counter. The styles from that counter will be applied if possible. Are you sure you want to import it here?")) return;
}
data.saveType = saveType;
if (data.private) {
if (!bypass && !confirm("You are importing a private save file. Please make sure you trust the author before importing!")) return;
} else {
Expand Down
Loading

0 comments on commit 76070da

Please sign in to comment.