text
stringlengths
0
14.1k
else
label = ""notes""
$('note-count').innerHTML = ""This post has <a href=\""/note/history?post_id="" + Note.post_id + ""\"">"" + Note.all.length + "" "" + label + ""</a>""
} else {
$('note-count').innerHTML = """"
}
},
// Create a new note
create: function() {
if (Note.debug) {
console.debug(""Note.create"")
}
Note.show()
var insertion_position = Note.getInsertionPosition()
var top = insertion_position[0]
var left = insertion_position[1]
var html = ''
html += '<div class=""note-box unsaved"" style=""width: 150px; height: 150px; '
html += 'top: ' + top + 'px; '
html += 'left: ' + left + 'px;"" '
html += 'id=""note-box-' + Note.counter + '"">'
html += '<div class=""note-corner"" id=""note-corner-' + Note.counter + '""></div>'
html += '</div>'
html += '<div class=""note-body"" title=""Click to edit"" id=""note-body-' + Note.counter + '""></div>'
$(""note-container"").insert({bottom: html})
var note = new Note(Note.counter, true, """")
Note.all.push(note)
Note.counter -= 1
},
// Find a suitable position to insert new notes
getInsertionPosition: function() {
if (Note.debug) {
console.debug(""Note.getInsertionPosition"")
}
// We want to show the edit box somewhere on the screen, but not outside the image.
var scroll_x = $(""image"").cumulativeScrollOffset()[0]
var scroll_y = $(""image"").cumulativeScrollOffset()[1]
var image_left = $(""image"").positionedOffset()[0]
var image_top = $(""image"").positionedOffset()[1]
var image_right = image_left + $(""image"").width
var image_bottom = image_top + $(""image"").height
var left = 0
var top = 0
if (scroll_x > image_left) {
left = scroll_x
} else {
left = image_left
}
if (scroll_y > image_top) {
top = scroll_y
} else {
top = image_top + 20
}
if (top > image_bottom) {
top = image_top + 20
}
return [top, left]
}
})
" isc
decred/dcrd blockchain/indexers/indexsubscriber.go 10267 "// Copyright (c) 2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package indexers
import (
""context""
""fmt""
""sync""
""sync/atomic""
""github.com/decred/dcrd/blockchain/v4/internal/progresslog""
""github.com/decred/dcrd/database/v3""
""github.com/decred/dcrd/dcrutil/v4""
)
// IndexNtfnType represents an index notification type.
type IndexNtfnType int
const (
// ConnectNtfn indicates the index notification signals a block
// connected to the main chain.
ConnectNtfn IndexNtfnType = iota
// DisconnectNtfn indicates the index notification signals a block
// disconnected from the main chain.
DisconnectNtfn
)