mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-28 17:40:07 +00:00
Compare commits
2 Commits
1fe978703f
...
ec195505cc
| Author | SHA1 | Date | |
|---|---|---|---|
| ec195505cc | |||
| 6f71b9c347 |
@ -357,7 +357,9 @@ var templates = {
|
||||
// body...
|
||||
// XXX only do this if we have nested elements...
|
||||
elem.collapsed = true
|
||||
|
||||
|
||||
elem.ignore = true
|
||||
|
||||
// button...
|
||||
return header },
|
||||
// XXX focus button -- see todo...
|
||||
@ -532,6 +534,7 @@ var quoted = {
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// XXX add ability to skip subtree from status calculation...
|
||||
var tasks = {
|
||||
__proto__: plugin,
|
||||
|
||||
@ -558,6 +561,8 @@ var tasks = {
|
||||
return res }, {})) },
|
||||
|
||||
// State...
|
||||
// NOTE: this will not count checkboxes under '[ignore]', this is
|
||||
// useful for not ounting items withing templates and the like...
|
||||
updateStatus: function(editor, node){
|
||||
node = editor.get(node)
|
||||
if(node == null){
|
||||
@ -566,10 +571,16 @@ var tasks = {
|
||||
.querySelector('.view')
|
||||
.querySelector('.completion')
|
||||
if(state){
|
||||
var checkboxes =
|
||||
node.querySelectorAll('input[type=checkbox]').length
|
||||
// XXX should we check ignore value here???
|
||||
- node.querySelectorAll('[ignore] input[type=checkbox]').length
|
||||
var checkboxes_checked =
|
||||
node.querySelectorAll('input[type=checkbox]:checked').length
|
||||
// XXX should we check ignore value here???
|
||||
- node.querySelectorAll('[ignore] input[type=checkbox]:checked').length
|
||||
var c =
|
||||
((node.querySelectorAll('input[type=checkbox]:checked').length
|
||||
/ node.querySelectorAll('input[type=checkbox]').length)
|
||||
* 100)
|
||||
((checkboxes_checked / checkboxes) * 100)
|
||||
.toFixed(0)
|
||||
!isNaN(c)
|
||||
&& state.setAttribute('completion', c +'%') }
|
||||
@ -1045,6 +1056,7 @@ var JSONOutline = {
|
||||
__block_attrs__: {
|
||||
id: 'attr',
|
||||
collapsed: 'attr',
|
||||
ignore: 'attr',
|
||||
focused: 'cls',
|
||||
},
|
||||
|
||||
|
||||
@ -50,6 +50,7 @@ var setup = function(){
|
||||
-
|
||||
- ## Bugs:
|
||||
focused:: true
|
||||
- BUG: refreshes under FF sometimes produce partial/inconsistent views...
|
||||
- BUG: need to account for hidden elements when cursoring between elements
|
||||
- to reproduce::
|
||||
- XXX move from/to this element
|
||||
@ -210,10 +211,18 @@ var setup = function(){
|
||||
- [ ] B
|
||||
- [ ] C
|
||||
- and a shorthand for todo:
|
||||
- TODO in lists like this new items will be created with a todo template
|
||||
- TODO in lists like this new items will be created with a todo
|
||||
template automatically (???)
|
||||
- [ ] A
|
||||
- [ ] B
|
||||
- [ ] C
|
||||
- Need to ignore the template subtree in `[%]` calculation... DONE
|
||||
collapsed:: true
|
||||
- Example [%] (should be 50%)
|
||||
- TEMPLATE new
|
||||
- [ ]
|
||||
- [x] Done
|
||||
- [ ] Undone
|
||||
- Time to think about a standalone client -- at least to edit own notes as a test...
|
||||
- _also this would be a nice opportunity to start the move to a newer electron version_
|
||||
- Deployment:
|
||||
@ -726,7 +735,7 @@ var setup = function(){
|
||||
- [ ] ASAP
|
||||
- [ ]
|
||||
-
|
||||
- [ ] example item
|
||||
- Q: should we include button text in item???
|
||||
- Attributes:
|
||||
id:: attributes
|
||||
- collapsed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user