Minor updates
This commit is contained in:
parent
64621d4375
commit
f3668df846
@ -7,25 +7,6 @@ let simple = () => {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
let nested = () => {
|
|
||||||
// This uses each for context switching and uses a nested links parameter
|
|
||||||
let template = Handlebars.compile(`
|
|
||||||
<ul>
|
|
||||||
{{#each links}}
|
|
||||||
<li><a href='{{href}}' target='_blank'>{{text}}</a></li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>`)
|
|
||||||
return template({
|
|
||||||
links: [{
|
|
||||||
'href': 'https://handlebarsjs.com/guide',
|
|
||||||
'text': 'Handlebars official guide'
|
|
||||||
}, {
|
|
||||||
'href': 'https://io.sivert.pw',
|
|
||||||
'text': 'Awesome blog!'
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is how handlebars comments work
|
// This is how handlebars comments work
|
||||||
let comments = Handlebars.compile(`
|
let comments = Handlebars.compile(`
|
||||||
{{! This comment will not show up in the output}}
|
{{! This comment will not show up in the output}}
|
||||||
@ -33,29 +14,65 @@ let comments = Handlebars.compile(`
|
|||||||
{{!-- This comment may contain mustaches like }} --}}
|
{{!-- This comment may contain mustaches like }} --}}
|
||||||
inspect element here!`)()
|
inspect element here!`)()
|
||||||
|
|
||||||
|
// This uses each for context switching and uses a nested links parameter
|
||||||
|
let nested = Handlebars.compile(`
|
||||||
|
<ul>
|
||||||
|
{{#each links}}
|
||||||
|
<li><a href='{{href}}' target='_blank'>{{text}}</a></li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>`)({
|
||||||
|
links: [{
|
||||||
|
'href': 'https://handlebarsjs.com/guide',
|
||||||
|
'text': 'Handlebars official guide'
|
||||||
|
}, {
|
||||||
|
'href': 'https://io.sivert.pw',
|
||||||
|
'text': 'Awesome blog!'
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
// Simple helper
|
// Simple helper
|
||||||
Handlebars.registerHelper('censor', (str) => {
|
Handlebars.registerHelper('censor', (str) => {
|
||||||
return str.replaceAll('fuck', 'f***').replaceAll('hell', 'h***')
|
return str.replaceAll('fuck', 'f***').replaceAll('hell', 'h***')
|
||||||
})
|
})
|
||||||
|
|
||||||
// Block helper
|
// Block helper
|
||||||
Handlebars.registerHelper('', (items, options) => {
|
Handlebars.registerHelper('noop', (options) => {
|
||||||
|
return options.fn(this)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Handlebars registered partial
|
// Handlebars registered partial
|
||||||
Handlebars.registerPartial('', '')
|
Handlebars.registerPartial('people', `
|
||||||
|
<ul>
|
||||||
inlinePartial = `
|
{{#each members}}
|
||||||
{{#*inline "inlinePartial"}}
|
<li>{{name}} age {{age}} from {{home}}</li>
|
||||||
|
{{/each}}
|
||||||
{{/inline}}`
|
balle!
|
||||||
|
</ul>`)
|
||||||
|
|
||||||
// Calling non-existent partials with block syntax uses the block content as fallback
|
// Calling non-existent partials with block syntax uses the block content as fallback
|
||||||
let advanced = () => {
|
let advanced = Handlebars.compile(`
|
||||||
return Handlebars.compile(`
|
{{censor profanity}}
|
||||||
{{censor profanity}}`)({'profanity': 'fuckin hell man!'})
|
|
||||||
}
|
{{#> people members}}
|
||||||
|
<b>Some thing went wrong, man!</b>
|
||||||
|
{{/people}}
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{{#each members}}
|
||||||
|
<li>{{name}} age {{age}} from {{home}}</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>`)({
|
||||||
|
'profanity': 'fuckin hell man!',
|
||||||
|
'members': [{
|
||||||
|
'home': 'Never Never Land',
|
||||||
|
'name': 'Peter',
|
||||||
|
'age': 120
|
||||||
|
}, {
|
||||||
|
'home': 'Trollhättan',
|
||||||
|
'name': 'Clark',
|
||||||
|
'age': 75
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
// Run "main" after all is loaded
|
// Run "main" after all is loaded
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
@ -64,18 +81,24 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
output.id = 'output'
|
output.id = 'output'
|
||||||
document.getElementById('meta').append(output)
|
document.getElementById('meta').append(output)
|
||||||
|
|
||||||
|
// When creating a partials you may use {{> @partial-block }} to capture the block content
|
||||||
|
Handlebars.registerPartial('layout', '<br /><div>{{> content }}</div>')
|
||||||
|
|
||||||
// Here we use those "triple mustaches"!
|
// Here we use those "triple mustaches"!
|
||||||
let template = Handlebars.compile(`
|
let template = Handlebars.compile(`
|
||||||
<br /><div>
|
{{#> layout}}
|
||||||
<h4>Examples output:</h4>
|
{{#*inline "content"}}
|
||||||
<h5>Functions:</h5>
|
<h4>Examples output:</h4>
|
||||||
<p>Simple: {{{simple}}}</p>
|
<h5>Functions:</h5>
|
||||||
<p>Nested: {{{nested}}}</p>
|
<p>Simple: {{{simple}}}</p>
|
||||||
<p>Comments: {{{comments}}}</p>
|
<p>Nested: {{{nested}}}</p>
|
||||||
<p>Advanced: {{{advanced}}}</p></div>`)
|
<p>Comments: {{{comments}}}</p>
|
||||||
|
<p>Advanced: {{{advanced}}}</p>
|
||||||
|
{{/inline}}
|
||||||
|
{{/layout}}`)
|
||||||
|
|
||||||
// Render and insert the template above
|
// Render and insert the template above
|
||||||
document.getElementById('output').innerHTML = template({
|
output.innerHTML = template({
|
||||||
simple: simple(), nested: nested(), comments: comments, advanced: advanced()
|
simple: simple(), nested: nested, comments: comments, advanced: advanced
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.chroma { padding: .1vh 0 0; margin: 0 0 .7vh }
|
.chroma {
|
||||||
.chroma { padding: .1vh 0 0; margin: 0 0 .7vh }
|
padding: .1vh 0 0; margin: 0 0 .7vh; min-height: 3.3vh;
|
||||||
.chroma { color: #ffffff; background-color: #111111 }
|
color: #ffffff; background-color: #111111 }
|
||||||
.chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0 }
|
.chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0 }
|
||||||
.chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0 }
|
.chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0 }
|
||||||
.chroma .hl { background-color: #ffffcc }
|
.chroma .hl { background-color: #ffffcc }
|
||||||
|
@ -3,6 +3,7 @@ enableInlineShortcodes: true
|
|||||||
enableRobotsTXT: true
|
enableRobotsTXT: true
|
||||||
enableGitInfo: true
|
enableGitInfo: true
|
||||||
enableEmoji: true
|
enableEmoji: true
|
||||||
|
unsafe: true
|
||||||
frontmatter:
|
frontmatter:
|
||||||
lastmod: ["lastmod", ":git", "date", "publishDate"]
|
lastmod: ["lastmod", ":git", "date", "publishDate"]
|
||||||
build:
|
build:
|
||||||
|
@ -10,4 +10,4 @@ title: SQLAlchemy
|
|||||||
description:
|
description:
|
||||||
---
|
---
|
||||||
|
|
||||||
[SQLAlchemy docs](https://docs.sqlalchemy.org/en/14/orm/quickstart.html)
|
[SQLAlchemy docs](https://docs.sqlalchemy.org/en/latest/orm/quickstart.html)
|
||||||
|
@ -29,8 +29,8 @@ It's possible for super/pro users to instantly complete speaking only lessons on
|
|||||||
4. Profit. (Instant perfect lesson!)
|
4. Profit. (Instant perfect lesson!)
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
The bug here seems to be that the iOS prompt for *possibly* taking the user to the apps permissions in settings, but rather does nothing.
|
The bug here seems to be that the first in app prompt for microphone access does nothing, except telling the end user to *please* give up mic perms.
|
||||||
Later we do actually get that iOS prompt on the first lesson.
|
Later we do actually get that iOS prompt on the first actual lesson.
|
||||||
The Duoling app skips all the speaking lessons as it usually would when denied microphone access.
|
The Duoling app skips all the speaking lessons as it usually would when denied microphone access.
|
||||||
But this of course is a big problem when all the lessons are speaking lessons.
|
But this of course is a big problem when all the lessons are speaking lessons.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user