Skip to content

Commit

Permalink
initializing a latest branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermatt1337 committed Apr 17, 2024
1 parent e9c24ad commit 0750e92
Show file tree
Hide file tree
Showing 7 changed files with 461 additions and 159 deletions.
55 changes: 50 additions & 5 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,58 @@
<style>
/* Add your custom CSS styles here */
</style>
<link rel="stylesheet" href="styles/options.css">
</head>
<body>
<h1>Extension Options</h1>

<form>
<!-- Add your options fields here -->
</form>
<div id="appArea" class="appArea">
<h1>Extension Options</h1>
<form><div class="optionsForm">
<p>Customize the chart appearance and data:</p>
<label for="chartTitle">Chart Title:</label>
<input type="text" id="chartTitle" name="chartTitle">
<br>
<label for="showTitle">Show Title:</label>
<input type="checkbox" id="showTitle" name="showTitle" checked>
<br>
<label for="showAxisLabels">Show Axis Labels:</label>
<input type="checkbox" id="showAxisLabels" name="showAxisLabels" checked>
<br>
<label for="showValues">Show Values:</label>
<input type="checkbox" id="showValues" name="showValues" checked>
<br>
<label for="showTickmarks">Show Tickmarks:</label>
<input type="checkbox" id="showTickmarks" name="showTickmarks" checked>
<br>
<label for="chartType">Chart Type:</label>
<select id="chartType" name="chartType">
<option value="line">Line Chart</option>
<option value="bar">Bar Chart</option>
<option value="pie">Pie Chart</option>
</select>
<br>
<label for="chartColor">Chart Color:</label>
<input type="color" id="chartColor" name="chartColor">
<br>
<label for="timeMeasure">Time Measure:</label>
<select id="timeMeasure" name="timeMeasure">
<option value="month">Month</option>
<option value="quarter">Quarter</option>
<option value="year">Year</option>
</select>
<br>
<button type="submit" id="saveOptionsButton">Save</button>
<button type="reset" id="resetButton">Reset</button>
</form></div>
<div id="statusLog" class="optionsLog">
<textarea class="statusLog"></textarea>
</div>

</div>

<script src="scripts/options.js"></script>
<script>
document.getElementById('saveOptionsButton').addEventListener('click', save_options);
</script>

</body>
</html>
4 changes: 2 additions & 2 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ <h1>RSI-Histogram</h1>
<div id="status"></div>
<label for="optionsButton">Change your chart options:</label>
<button id="optionsButton" type="button">Options</button>
<label for="resetButton">Reset your chart:</label>
<button id="resetButton" type="button">Reset</button>
<label for="downloadButton">Download your chart:</label>
<button id="downloadButton" type="button">Download</button>

<script src="scripts/popup.js"></script>
<script src="scripts/chart.umd.min.js"></script>
Expand Down
17 changes: 17 additions & 0 deletions scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,21 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
}

// Handle other actions...
});

// Set the default options when the extension is installed
chrome.runtime.onInstalled.addListener(function(details) {
if (details.reason == "install") {
var defaultOptions = {
chartType: 'line', // default chart type
showTitle: true, // default to show title
showAxisLabels: true, // default to show axis labels
showValues: true, // default to show values
showTickmarks: true, // default to show tickmarks
timeMeasure: 'month' // default time measure
};
chrome.storage.sync.set({options: defaultOptions}, function() {
console.log('Default options set.');
});
}
});
Loading

0 comments on commit 0750e92

Please sign in to comment.