Compare commits

..

No commits in common. "5d9b4129730c83c98f9762d821e64d8a220faa77" and "7f521bcde5bb91efe66de9e22841f0ba55737abc" have entirely different histories.

3 changed files with 5 additions and 27 deletions

View File

@ -383,7 +383,7 @@ mark {
} }
.content input[type="checkbox"] { .content input[type="checkbox"] {
vertical-align: baseline; vertical-align: text-top;
} }
.lighter { .lighter {

View File

@ -121,7 +121,6 @@ func NewFilePages(dirname string, index bleve.Index) PagesRepository {
} }
} }
}() }()
return fp return fp
} }
@ -135,7 +134,7 @@ func convertBlocksToListItems(current string, blocks BlockResponse, indent int)
ID: child, ID: child,
Indented: indent, Indented: indent,
Text: blocks.Texts[child], Text: blocks.Texts[child],
Fold: "open", Fold: "open", // TODO: keep Fold state somewhere
Hidden: false, Hidden: false,
}) })
listItems = append(listItems, l...) listItems = append(listItems, l...)
@ -160,7 +159,6 @@ func (fp *FilePages) Get(name string) Page {
var to titleOption var to titleOption
pageNameDate, err := ParseDatePageName(name) pageNameDate, err := ParseDatePageName(name)
if err == nil { if err == nil {
to.date = true to.date = true
to.timeObj = pageNameDate to.timeObj = pageNameDate
@ -323,7 +321,7 @@ func (fp *FilePages) save(msg saveMessage) error {
sw.Start("git") sw.Start("git")
err = saveWithGit(fp, p, summary, author) err = saveWithGit(fp, p, summary, author)
if err != nil { if err != nil {
log.Printf("Error while saving to git: %s", err) log.Printf("Error while saving to git: %w", err)
// return fmt.Errorf("while saving to git: %w", err) // return fmt.Errorf("while saving to git: %w", err)
} }
sw.Stop() sw.Stop()
@ -586,6 +584,7 @@ func saveLinksIncremental(dirname, title string) error {
return err return err
} }
f.Close() f.Close()
return nil return nil
} }

View File

@ -59,7 +59,6 @@ function editor(root, inputData, options) {
normalKeymap.mapKey('Tab', 'indentBlock') normalKeymap.mapKey('Tab', 'indentBlock')
normalKeymap.mapKey('S-Tab', 'indentBlock') normalKeymap.mapKey('S-Tab', 'indentBlock')
normalKeymap.mapKey('C-.', 'toggleBlock') normalKeymap.mapKey('C-.', 'toggleBlock')
normalKeymap.mapKey('C-;', 'toggleTodo')
function createStore(inputData) { function createStore(inputData) {
let data = [ let data = [
@ -196,9 +195,7 @@ function editor(root, inputData, options) {
expandBlock, expandBlock,
collapseBlock, collapseBlock,
toggleBlock, toggleBlock
toggleTodo
}; };
root.classList.add('root') root.classList.add('root')
@ -662,24 +659,6 @@ function editor(root, inputData, options) {
return toggleBlock(event, false) 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) { function countBraces(sset, as) {
let set = _(sset).chain().split('').value() let set = _(sset).chain().split('').value()
let defaults = {} let defaults = {}