Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at creating a generic checklist component
The idea is that checklist-like modules would all share an underlying checklist implementation (ie: Todo and Todoist) to avoid duplication.
- Loading branch information
Chris Cummer
committed
Jul 12, 2018
1 parent
236005a
commit 4ad25ed
Showing
8 changed files
with
237 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package wtf | ||
|
||
type ChecklistItem struct { | ||
Checked bool | ||
Text string | ||
} | ||
|
||
func (item *ChecklistItem) CheckMark() string { | ||
if item.Checked { | ||
return Config.UString("wtf.mods.todo.checkedIcon", "x") | ||
} else { | ||
return " " | ||
} | ||
} | ||
|
||
func (item *ChecklistItem) Toggle() { | ||
item.Checked = !item.Checked | ||
} |
Oops, something went wrong.