mirror of
https://github.com/GuySandler/CanvasRefined.git
synced 2026-06-20 17:39:54 +02:00
better todolist 5
Dark mode refactor, view more, started UI settings
This commit is contained in:
parent
312257493a
commit
b5bcd19466
10
README.md
10
README.md
@ -55,14 +55,16 @@ Better Canvas introduces improvements to the Canvas user interface:
|
||||
|
||||
## Newly added features
|
||||
- GPA presets
|
||||
- Scheduled Reminder Popups (broken)
|
||||
- Searching themes (the original didn't actually impliment that)
|
||||
- Scheduled Reminder Popups (broken)
|
||||
- backend stuff:
|
||||
- Searching themes (the original didn't actually impliment that)
|
||||
- made the dark mode into a css file instead of a reallllllly long string
|
||||
- Card Styles (image size, card roundness, card spacing, width, height, theme compatible)
|
||||
- Custom Background (by URL, theme compatible)
|
||||
- NEW Better todo list (todo: hover preview, cutoff, maybe fix some missing ones)
|
||||
- Popup UI revamp
|
||||
- NEW Better todo list (todo: hover preview, cutoff)
|
||||
|
||||
## Planned Features (by priority)
|
||||
- popup UI revamp
|
||||
- widgets (music, timer)
|
||||
- better sidebar
|
||||
- better notes
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
"message": "Color Coded Tab Icons"
|
||||
},
|
||||
"todo_colors": {
|
||||
"message": "Use Card Colors"
|
||||
"message": "Hide Recent Feedback"
|
||||
},
|
||||
"gpa_calc_cumulative": {
|
||||
"message": "Show Cumulative GPA"
|
||||
|
||||
78
cleaningoldcss.py
Normal file
78
cleaningoldcss.py
Normal file
@ -0,0 +1,78 @@
|
||||
import os
|
||||
|
||||
def format_minified_css(minified_css):
|
||||
formatted = []
|
||||
indent_level = 0
|
||||
in_string = False
|
||||
string_char = ''
|
||||
|
||||
# Clean up any existing odd spacing
|
||||
minified_css = minified_css.replace('\n', '').replace('\r', '').replace('\t', '')
|
||||
|
||||
i = 0
|
||||
while i < len(minified_css):
|
||||
char = minified_css[i]
|
||||
|
||||
# Handle strings to avoid formatting inside content: "" or urls
|
||||
if in_string:
|
||||
formatted.append(char)
|
||||
if char == string_char and minified_css[i-1] != '\\':
|
||||
in_string = False
|
||||
elif char in ('"', "'"):
|
||||
in_string = True
|
||||
string_char = char
|
||||
formatted.append(char)
|
||||
|
||||
elif char == '{':
|
||||
indent_level += 1
|
||||
formatted.append(' {\n' + (' ' * indent_level))
|
||||
|
||||
elif char == '}':
|
||||
indent_level = max(0, indent_level - 1)
|
||||
# Clean up trailing indents from empty blocks
|
||||
if formatted[-1].endswith(' '):
|
||||
formatted[-1] = formatted[-1][:-4]
|
||||
if not formatted[-1].endswith('\n'):
|
||||
formatted.append('\n')
|
||||
formatted.append((' ' * indent_level) + '}\n\n')
|
||||
|
||||
elif char == ';':
|
||||
formatted.append(';\n' + (' ' * indent_level))
|
||||
|
||||
elif char == ',':
|
||||
if indent_level == 0:
|
||||
# Break long comma-separated selectors onto new lines
|
||||
formatted.append(',\n')
|
||||
else:
|
||||
formatted.append(', ')
|
||||
|
||||
else:
|
||||
# Skip extra spaces at the start of a newly indented line
|
||||
if char == ' ' and (not formatted or formatted[-1].endswith(' ') or formatted[-1].endswith('\n')):
|
||||
pass
|
||||
else:
|
||||
formatted.append(char)
|
||||
|
||||
i += 1
|
||||
|
||||
return "".join(formatted)
|
||||
|
||||
if __name__ == "__main__":
|
||||
input_file = "./css/darkmodecss.js"
|
||||
output_file = "./css/darkmodecss_formatted.js"
|
||||
|
||||
print(f"Reading from {input_file}...")
|
||||
|
||||
if not os.path.exists(input_file):
|
||||
print(f"Error: Create an '{input_file}' file in this directory and paste your minified CSS inside it.")
|
||||
exit(1)
|
||||
|
||||
with open(input_file, "r", encoding="utf-8") as f:
|
||||
minified = f.read()
|
||||
|
||||
formatted = format_minified_css(minified)
|
||||
|
||||
with open(output_file, "w", encoding="utf-8") as f:
|
||||
f.write(formatted)
|
||||
|
||||
print(f"Done! Formatted CSS saved to {output_file}")
|
||||
1190
css/darkmodecss.js
Normal file
1190
css/darkmodecss.js
Normal file
File diff suppressed because it is too large
Load Diff
1
css/darkmodecss_old.js
Normal file
1
css/darkmodecss_old.js
Normal file
File diff suppressed because one or more lines are too long
@ -209,29 +209,29 @@
|
||||
<div class="sub-option">
|
||||
<input type="checkbox" id="hover_preview" name="hover_preview">
|
||||
<label for="hover_preview" class="sub-text" data-i18n="hover_preview">Hover to preview
|
||||
details</label>
|
||||
details</label> <!-- TODO -->
|
||||
</div>
|
||||
<div class="sub-option">
|
||||
<input type="checkbox" id="hide_completed" name="hide_completed">
|
||||
<label for="hide_completed" class="sub-text" data-i18n="hide_completed">Hide
|
||||
completed</label>
|
||||
completed</label> <!-- TO REMOVE replace with "own scrollbar" -->
|
||||
</div>
|
||||
<div class="sub-option">
|
||||
<input type="checkbox" id="todo_hr24" name="todo_hr24">
|
||||
<label for="todo_hr24" class="sub-text" data-i18n="24hrformat">Use 24hr format</label>
|
||||
<label for="todo_hr24" class="sub-text" data-i18n="24hrformat">Use 24hr format</label> <!-- TODO -->
|
||||
</div>
|
||||
<div class="sub-option">
|
||||
<input type="checkbox" id="todo_overdues" name="todo_overdues">
|
||||
<label for="todo_overdues" class="sub-text" data-i18n="show_past_due">Show past due</label>
|
||||
<label for="todo_overdues" class="sub-text" data-i18n="show_past_due">Show past due</label> <!-- TO REMOVE and replace with full height -->
|
||||
</div>
|
||||
<div class="sub-option">
|
||||
<input type="checkbox" id="todo_colors" name="todo_colors">
|
||||
<label for="todo_colors" class="sub-text" data-i18n="todo_colors">Use card colors</label>
|
||||
<input type="checkbox" id="todo_hide_feedback" name="todo_hide_feedback">
|
||||
<label for="todo_hide_feedback" class="sub-text" data-i18n="todo_hide_feedback">Hide Recent Feedback</label> <!-- TO REMOVE and replace with recent feedback -->
|
||||
</div>
|
||||
<div style="margin-top: 5px">
|
||||
<span class="sub-text" data-i18n="max_items">Max items to show: </span><span
|
||||
id="numTodoItems"></span>
|
||||
<input type="range" min="1" max="7" id="numTodoItemsSlider">
|
||||
<input type="range" min="1" max="12" id="numTodoItemsSlider">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -47,7 +47,7 @@ chrome.runtime.onInstalled.addListener(function () {
|
||||
"custom_assignments_overflow": ["custom_assignments"],
|
||||
"grade_hover": false,
|
||||
"hide_completed": false,
|
||||
"num_todo_items": 4,
|
||||
"num_todo_items": 10,
|
||||
"custom_font": { "link": "", "family": "" },
|
||||
"hover_preview": true,
|
||||
"full_width": null,
|
||||
@ -74,7 +74,7 @@ chrome.runtime.onInstalled.addListener(function () {
|
||||
"dark_mode_fix": [],
|
||||
"assignment_states": {},
|
||||
"tab_icons": false,
|
||||
"todo_colors": false,
|
||||
"todo_hide_feedback": false,
|
||||
"device_dark": false,
|
||||
"cumulative_gpa": { "name": "Cumulative GPA", "hidden": false, "weight": "dnc", "credits": 999, "gr": 3.21 },
|
||||
"show_updates": false,
|
||||
|
||||
322
js/content.js
322
js/content.js
File diff suppressed because one or more lines are too long
145
js/popup.js
145
js/popup.js
@ -1,6 +1,6 @@
|
||||
const syncedSwitches = ['remind', 'tab_icons', 'hide_feedback', 'dark_mode', 'remlogo', 'full_width', 'auto_dark', 'assignments_due', 'gpa_calc', 'gradient_cards', 'disable_color_overlay', 'dashboard_grades', 'dashboard_notes', 'better_todo', 'condensed_cards'];
|
||||
const syncedSubOptions = [
|
||||
"todo_colors",
|
||||
"todo_hide_feedback",
|
||||
"device_dark",
|
||||
"relative_dues",
|
||||
"card_overdues",
|
||||
@ -76,7 +76,7 @@ const defaultOptions = {
|
||||
"custom_assignments_overflow": ["custom_assignments"],
|
||||
"grade_hover": false,
|
||||
"hide_completed": false,
|
||||
"num_todo_items": 4,
|
||||
"num_todo_items": 10,
|
||||
"custom_font": { "link": "", "family": "" },
|
||||
"hover_preview": true,
|
||||
"full_width": null,
|
||||
@ -103,7 +103,7 @@ const defaultOptions = {
|
||||
"dark_mode_fix": [],
|
||||
"assignment_states": {},
|
||||
"tab_icons": false,
|
||||
"todo_colors": false,
|
||||
"todo_hide_feedback": false,
|
||||
"device_dark": false,
|
||||
"cumulative_gpa": { "name": "Cumulative GPA", "hidden": false, "weight": "dnc", "credits": 999, "gr": 3.21 },
|
||||
"show_updates": false,
|
||||
@ -277,35 +277,116 @@ function setupCustomBackgroundLink(initial) {
|
||||
function setup() {
|
||||
|
||||
const menu = {
|
||||
"switches": syncedSwitches,
|
||||
"checkboxes": ['browser_show_likes', 'gpa_calc_weighted', 'gpa_calc_cumulative', /*'card_method_date',*/ 'show_updates', 'todo_colors', 'device_dark', 'relative_dues', 'card_overdues', 'todo_overdues', 'gpa_calc_prepend', 'auto_dark', 'assignment_date_format', 'todo_hr24', 'grade_hover', 'hide_completed', 'hover_preview', 'scheduledReminder', 'customCardStyles'],
|
||||
"tabs": {
|
||||
"advanced-settings": { "setup": displayAdvancedCards, "tab": ".advanced" },
|
||||
"gpa-bounds-btn": { "setup": displayGPABounds, "tab": ".gpa-bounds-container" },
|
||||
"custom-font-btn": { "setup": displayCustomFont, "tab": ".custom-font-container" },
|
||||
"card-colors-btn": { "setup": null, "tab": ".card-colors-container" },
|
||||
"customize-dark-btn": { "setup": displayDarkModeFixUrls, "tab": ".customize-dark" },
|
||||
"import-export-btn": { "setup": displayThemeList, "tab": ".import-export" },
|
||||
"report-issue-btn": { "setup": displayErrors, "tab": ".report-issue-container" },
|
||||
"updates-btn": { "setup": null, "tab": ".updates-container" }
|
||||
},
|
||||
"special": [
|
||||
{ "identifier": "auto_dark_start", "setup": (initial) => setupAutoDarkInput(initial, "auto_dark_start") },
|
||||
{ "identifier": "auto_dark_end", "setup": (initial) => setupAutoDarkInput(initial, "auto_dark_end") },
|
||||
{ "identifier": "num_assignments", "setup": (initial) => setupAssignmentsSlider(initial) },
|
||||
{ "identifier": "num_todo_items", "setup": (initial) => setupTodoSlider(initial) },
|
||||
{ "identifier": "card_limit", "setup": (initial) => setupCardLimitSlider(initial) },
|
||||
{ "identifier": "card_method_dashboard", "setup": (initial) => setupDashboardMethod(initial) },
|
||||
{ "identifier": "custom_styles", "setup": (initial) => setupCustomStyle(initial) },
|
||||
{ "identifier": "scheduledReminderTime", "setup": (initial) => setupScheduledReminderInput(initial) },
|
||||
{ "identifier": "imageSize", "setup": (initial) => setupImageSizeInput(initial) },
|
||||
{ "identifier": "cardRoundness", "setup": (initial) => setupCardRoundnessInput(initial) },
|
||||
{ "identifier": "cardSpacing", "setup": (initial) => setupCardSpacingInput(initial) },
|
||||
{ "identifier": "cardWidth", "setup": (initial) => setupCardWidthInput(initial) },
|
||||
{ "identifier": "cardHeight", "setup": (initial) => setupCardHeightInput(initial) },
|
||||
{ "identifier": "customBackgroundLink", "setup": (initial) => setupCustomBackgroundLink(initial)},
|
||||
],
|
||||
}
|
||||
switches: syncedSwitches,
|
||||
checkboxes: [
|
||||
"browser_show_likes",
|
||||
"gpa_calc_weighted",
|
||||
"gpa_calc_cumulative",
|
||||
/*'card_method_date',*/ "show_updates",
|
||||
"todo_hide_feedback",
|
||||
"device_dark",
|
||||
"relative_dues",
|
||||
"card_overdues",
|
||||
"todo_overdues",
|
||||
"gpa_calc_prepend",
|
||||
"auto_dark",
|
||||
"assignment_date_format",
|
||||
"todo_hr24",
|
||||
"grade_hover",
|
||||
"hide_completed",
|
||||
"hover_preview",
|
||||
"scheduledReminder",
|
||||
"customCardStyles",
|
||||
],
|
||||
tabs: {
|
||||
"advanced-settings": {
|
||||
setup: displayAdvancedCards,
|
||||
tab: ".advanced",
|
||||
},
|
||||
"gpa-bounds-btn": {
|
||||
setup: displayGPABounds,
|
||||
tab: ".gpa-bounds-container",
|
||||
},
|
||||
"custom-font-btn": {
|
||||
setup: displayCustomFont,
|
||||
tab: ".custom-font-container",
|
||||
},
|
||||
"card-colors-btn": { setup: null, tab: ".card-colors-container" },
|
||||
"customize-dark-btn": {
|
||||
setup: displayDarkModeFixUrls,
|
||||
tab: ".customize-dark",
|
||||
},
|
||||
"import-export-btn": {
|
||||
setup: displayThemeList,
|
||||
tab: ".import-export",
|
||||
},
|
||||
"report-issue-btn": {
|
||||
setup: displayErrors,
|
||||
tab: ".report-issue-container",
|
||||
},
|
||||
"updates-btn": { setup: null, tab: ".updates-container" },
|
||||
},
|
||||
special: [
|
||||
{
|
||||
identifier: "auto_dark_start",
|
||||
setup: (initial) =>
|
||||
setupAutoDarkInput(initial, "auto_dark_start"),
|
||||
},
|
||||
{
|
||||
identifier: "auto_dark_end",
|
||||
setup: (initial) =>
|
||||
setupAutoDarkInput(initial, "auto_dark_end"),
|
||||
},
|
||||
{
|
||||
identifier: "num_assignments",
|
||||
setup: (initial) => setupAssignmentsSlider(initial),
|
||||
},
|
||||
{
|
||||
identifier: "num_todo_items",
|
||||
setup: (initial) => setupTodoSlider(initial),
|
||||
},
|
||||
{
|
||||
identifier: "card_limit",
|
||||
setup: (initial) => setupCardLimitSlider(initial),
|
||||
},
|
||||
{
|
||||
identifier: "card_method_dashboard",
|
||||
setup: (initial) => setupDashboardMethod(initial),
|
||||
},
|
||||
{
|
||||
identifier: "custom_styles",
|
||||
setup: (initial) => setupCustomStyle(initial),
|
||||
},
|
||||
{
|
||||
identifier: "scheduledReminderTime",
|
||||
setup: (initial) => setupScheduledReminderInput(initial),
|
||||
},
|
||||
{
|
||||
identifier: "imageSize",
|
||||
setup: (initial) => setupImageSizeInput(initial),
|
||||
},
|
||||
{
|
||||
identifier: "cardRoundness",
|
||||
setup: (initial) => setupCardRoundnessInput(initial),
|
||||
},
|
||||
{
|
||||
identifier: "cardSpacing",
|
||||
setup: (initial) => setupCardSpacingInput(initial),
|
||||
},
|
||||
{
|
||||
identifier: "cardWidth",
|
||||
setup: (initial) => setupCardWidthInput(initial),
|
||||
},
|
||||
{
|
||||
identifier: "cardHeight",
|
||||
setup: (initial) => setupCardHeightInput(initial),
|
||||
},
|
||||
{
|
||||
identifier: "customBackgroundLink",
|
||||
setup: (initial) => setupCustomBackgroundLink(initial),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
chrome.storage.sync.get(menu.switches, sync => {
|
||||
menu.switches.forEach(option => {
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://*/*"],
|
||||
"js": ["js/content.js"],
|
||||
"js": ["css/darkmodecss.js", "js/content.js"],
|
||||
"css": ["css/content.css"],
|
||||
"run_at": "document_start"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user