Sonar recommendations
This commit is contained in:
parent
3fd0a25c70
commit
2876fc914f
@ -78,10 +78,10 @@ body.author .ac_choice label.text {
|
||||
}
|
||||
body.users .ac_choice label.text:hover {
|
||||
cursor: pointer;
|
||||
box-shadow: 0 0 5px blue inset, 0 0 5px blue;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 0 0.2em;
|
||||
body.users .ac_choice input[type="radio"]:checked + label.text {
|
||||
box-shadow: 0 0 5px red inset, 0 0 5px red !important;
|
||||
}
|
||||
|
||||
.ac_choice input[type=radio] {
|
||||
@ -99,13 +99,6 @@ body.users .ac_choice label.text:hover {
|
||||
color: inherit;
|
||||
content: attr(placeholder);
|
||||
}
|
||||
body.users .ac_choice label.text:hover {
|
||||
box-shadow: 0 0 5px blue inset, 0 0 5px blue;
|
||||
}
|
||||
body.users .ac_choice input[type="radio"]:checked + label.text {
|
||||
box-shadow: 0 0 5px red inset, 0 0 5px red !important;
|
||||
}
|
||||
|
||||
.ac_choice a.gotoChoice {
|
||||
float: left;
|
||||
font-size: x-large;
|
||||
|
@ -12,7 +12,7 @@ const sleep = (seconds) => new Promise(resolve => {
|
||||
/*
|
||||
* From the current URL generate an UUID
|
||||
*/
|
||||
getUuidFromUrl = (pathname = document.location.pathname) =>
|
||||
const getUuidFromUrl = (pathname = document.location.pathname) =>
|
||||
pathname
|
||||
.split('')
|
||||
.reverse()
|
||||
|
@ -6,7 +6,7 @@ const tons = [264, 275, 297, 316.8, 330, 352, 371.25, 396, 412.5, 440, 475.2, 49
|
||||
/*
|
||||
* Play one note
|
||||
*/
|
||||
note = (context, freq, counter) => {
|
||||
const note = (context, freq, counter) => {
|
||||
// console.log("Note n°", counter, freq)
|
||||
|
||||
const oscil = context.createOscillator()
|
||||
@ -21,7 +21,6 @@ note = (context, freq, counter) => {
|
||||
// All are in seconds
|
||||
const start = counter / notesPerSecond
|
||||
const duration = .5
|
||||
const ramp = .2 / notesPerSecond / 3 // Exponential increase
|
||||
|
||||
// Increase volume
|
||||
gainNode.gain.setValueAtTime(1, start)
|
||||
@ -35,7 +34,7 @@ note = (context, freq, counter) => {
|
||||
/*
|
||||
* Launch notes based on the current URL
|
||||
*/
|
||||
launchNotes = (event, counter = 0, uuid = getUuidFromUrl()) => {
|
||||
const launchNotes = (event, counter = 0, uuid = getUuidFromUrl()) => {
|
||||
if (counter >= uuid.length || counter >= 5) return
|
||||
|
||||
const context = new (window.AudioContext || window.webkitAudioContext)();
|
||||
|
@ -1,8 +1,8 @@
|
||||
const propUrl = document.body.dataset.editUrl + '.prop'
|
||||
|
||||
preparePropertyEdition = (node) => node.dataset.old = node.innerText
|
||||
const preparePropertyEdition = (node) => node.dataset.old = node.innerText
|
||||
|
||||
updateProperty = (node) => {
|
||||
const updateProperty = (node) => {
|
||||
if (node.dataset.old == node.innerText) return
|
||||
|
||||
const body = `${node.dataset.property}: ${node.innerText.trim()}`
|
||||
@ -15,7 +15,7 @@ updateProperty = (node) => {
|
||||
|
||||
const pages = document.getElementById('pages')
|
||||
|
||||
prepareChoiceEdition = (node) => {
|
||||
const prepareChoiceEdition = (node) => {
|
||||
// Load list of pages from which authors can select results' page
|
||||
if (node.list && !node.dataset.old && !pages.children.length)
|
||||
fetch('/pages.txt', { cache: 'no-store' })
|
||||
@ -46,7 +46,7 @@ prepareChoiceEdition = (node) => {
|
||||
}
|
||||
}
|
||||
|
||||
createChoice = (node) => {
|
||||
const createChoice = (node) => {
|
||||
if (node.nextSibling
|
||||
&& (!node.querySelector('label.text').innerText
|
||||
|| !node.querySelector('input[type=text]').value)) {
|
||||
@ -64,9 +64,9 @@ createChoice = (node) => {
|
||||
setupChoiceEdition()
|
||||
}
|
||||
|
||||
createPage = (title) => {
|
||||
const createPage = (title) => {
|
||||
// Page automatic creation, later there should be a mechanism to remove eventual orphans :)
|
||||
option = pages.appendChild(document.createElement('option'))
|
||||
const option = pages.appendChild(document.createElement('option'))
|
||||
option.dataset.title = title
|
||||
option.dataset.url = uuid()
|
||||
option.innerText = title
|
||||
@ -77,7 +77,7 @@ createPage = (title) => {
|
||||
return option
|
||||
}
|
||||
|
||||
readPage = (node) => {
|
||||
const readPage = (node) => {
|
||||
const title = node.querySelector('input[type=text]').value.trim()
|
||||
let option = pages.querySelector(`option[data-title='${title}']`)
|
||||
if (!option) {
|
||||
@ -87,7 +87,7 @@ readPage = (node) => {
|
||||
return `"[${node.querySelector('label.text').innerText.trim()}](${option.dataset.url})"`
|
||||
}
|
||||
|
||||
updateChoice = (node) => {
|
||||
const updateChoice = (node) => {
|
||||
if (node.dataset.old == (node.innerText || node.value)) return
|
||||
|
||||
const choice = node.closest('.ac_choice')
|
||||
@ -98,7 +98,7 @@ updateChoice = (node) => {
|
||||
.catch(error => console.error('Error editing property', error))
|
||||
}
|
||||
|
||||
deleteChoice = (node) => {
|
||||
const deleteChoice = (node) => {
|
||||
const choice = node.closest('.ac_choice')
|
||||
const property = choice.querySelector('label').dataset.property
|
||||
const index = Array.from(node.closest('form').children).indexOf(choice)
|
||||
@ -110,7 +110,7 @@ deleteChoice = (node) => {
|
||||
}
|
||||
|
||||
// Utility method
|
||||
uuid = () => {
|
||||
const uuid = () => {
|
||||
const temp_url = URL.createObjectURL(new Blob())
|
||||
const uuid = temp_url.toString()
|
||||
URL.revokeObjectURL(temp_url)
|
||||
|
@ -30,7 +30,7 @@ document.querySelectorAll('body [data-property]')
|
||||
node.onblur = () => updateProperty(node)
|
||||
})
|
||||
|
||||
setupChoiceEdition = () => {
|
||||
const setupChoiceEdition = () => {
|
||||
document.querySelectorAll('body.author .ac_choice label.text, body.author .ac_choice input[type=text]')
|
||||
.forEach(node => {
|
||||
node.contentEditable = true
|
||||
@ -45,9 +45,6 @@ setupChoiceEdition = () => {
|
||||
|
||||
document.querySelectorAll('body.author .ac_choice button.delete')
|
||||
.forEach(node => node.onclick = () => deleteChoice(node))
|
||||
|
||||
window.getSelection().removeAllRanges()
|
||||
const range = document.createRange()
|
||||
}
|
||||
|
||||
document.addEventListener('paste', (e) => {
|
||||
@ -55,7 +52,7 @@ document.addEventListener('paste', (e) => {
|
||||
|
||||
e.preventDefault()
|
||||
const text = (e.originalEvent || e).clipboardData.getData('text/plain')
|
||||
window.document.execCommand('insertText', false, text)
|
||||
document.execCommand('insertText', false, text)
|
||||
})
|
||||
|
||||
setupChoiceEdition()
|
||||
|
@ -1,7 +0,0 @@
|
||||
{{ range .Ancestors.Reverse }}
|
||||
{{ if and (not .IsHome) (not .Parent.IsHome) }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{- .Title -}}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
Loading…
Reference in New Issue
Block a user