Compare commits
3 Commits
7f521bcde5
...
5d9b412973
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d9b412973 | |||
| 0cd50f7766 | |||
| 8e101418f3 |
|
|
@ -383,7 +383,7 @@ mark {
|
|||
}
|
||||
|
||||
.content input[type="checkbox"] {
|
||||
vertical-align: text-top;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.lighter {
|
||||
|
|
|
|||
7
file.go
7
file.go
|
|
@ -121,6 +121,7 @@ func NewFilePages(dirname string, index bleve.Index) PagesRepository {
|
|||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return fp
|
||||
}
|
||||
|
||||
|
|
@ -134,7 +135,7 @@ func convertBlocksToListItems(current string, blocks BlockResponse, indent int)
|
|||
ID: child,
|
||||
Indented: indent,
|
||||
Text: blocks.Texts[child],
|
||||
Fold: "open", // TODO: keep Fold state somewhere
|
||||
Fold: "open",
|
||||
Hidden: false,
|
||||
})
|
||||
listItems = append(listItems, l...)
|
||||
|
|
@ -159,6 +160,7 @@ func (fp *FilePages) Get(name string) Page {
|
|||
|
||||
var to titleOption
|
||||
pageNameDate, err := ParseDatePageName(name)
|
||||
|
||||
if err == nil {
|
||||
to.date = true
|
||||
to.timeObj = pageNameDate
|
||||
|
|
@ -321,7 +323,7 @@ func (fp *FilePages) save(msg saveMessage) error {
|
|||
sw.Start("git")
|
||||
err = saveWithGit(fp, p, summary, author)
|
||||
if err != nil {
|
||||
log.Printf("Error while saving to git: %w", err)
|
||||
log.Printf("Error while saving to git: %s", err)
|
||||
// return fmt.Errorf("while saving to git: %w", err)
|
||||
}
|
||||
sw.Stop()
|
||||
|
|
@ -584,7 +586,6 @@ func saveLinksIncremental(dirname, title string) error {
|
|||
return err
|
||||
}
|
||||
f.Close()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ function editor(root, inputData, options) {
|
|||
normalKeymap.mapKey('Tab', 'indentBlock')
|
||||
normalKeymap.mapKey('S-Tab', 'indentBlock')
|
||||
normalKeymap.mapKey('C-.', 'toggleBlock')
|
||||
normalKeymap.mapKey('C-;', 'toggleTodo')
|
||||
|
||||
function createStore(inputData) {
|
||||
let data = [
|
||||
|
|
@ -195,7 +196,9 @@ function editor(root, inputData, options) {
|
|||
|
||||
expandBlock,
|
||||
collapseBlock,
|
||||
toggleBlock
|
||||
toggleBlock,
|
||||
|
||||
toggleTodo
|
||||
};
|
||||
|
||||
root.classList.add('root')
|
||||
|
|
@ -659,6 +662,24 @@ function editor(root, inputData, options) {
|
|||
return toggleBlock(event, false)
|
||||
}
|
||||
|
||||
function toggleTodo(event) {
|
||||
store.update(cursor.getId(store), function (item) {
|
||||
const res = item.text.match(/^#\[\[(TODO|DONE)\]\]/)
|
||||
if (res) {
|
||||
if (res[1] === 'TODO') {
|
||||
item.text = item.text.replace(/#\[\[TODO\]\]\s*/, '#[[DONE]] ')
|
||||
} else {
|
||||
item.text = item.text.replace(/#\[\[DONE\]\]\s*/, '')
|
||||
}
|
||||
} else {
|
||||
item.text = '#[[TODO]] ' + item.text
|
||||
}
|
||||
return item
|
||||
})
|
||||
trigger('change')
|
||||
return false
|
||||
}
|
||||
|
||||
function countBraces(sset, as) {
|
||||
let set = _(sset).chain().split('').value()
|
||||
let defaults = {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user