mirror of
https://github.com/flynx/pWiki.git
synced 2025-11-01 19:40:10 +00:00
refactoring .system/edit...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
bec3f76f1d
commit
01ad4b4221
104
pwiki/page.js
104
pwiki/page.js
@ -2093,30 +2093,36 @@ module.System = {
|
|||||||
edit: {
|
edit: {
|
||||||
// XXX not sure if we should use .title or .name here...
|
// XXX not sure if we should use .title or .name here...
|
||||||
text: object.doc`
|
text: object.doc`
|
||||||
|
<macro titleeditor>
|
||||||
|
<h1>
|
||||||
|
<span class="title-editor"
|
||||||
|
wikiwords="no"
|
||||||
|
contenteditable
|
||||||
|
oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
|
||||||
|
@source(./title)
|
||||||
|
</span>
|
||||||
|
</h1>
|
||||||
|
</macro>
|
||||||
|
<macro texteditor>
|
||||||
|
<pre class="editor"
|
||||||
|
wikiwords="no"
|
||||||
|
contenteditable
|
||||||
|
oninput="saveLiveContent(\'@source(s ./path)\', this.innerText)"
|
||||||
|
><quote filter="quote-tags" src="."/></pre>
|
||||||
|
</macro>
|
||||||
|
<macro editor join="@source(file-separator)">
|
||||||
|
@macro(titleeditor .)
|
||||||
|
@macro(texteditor .)
|
||||||
|
</macro>
|
||||||
|
|
||||||
<slot pre>
|
<slot pre>
|
||||||
<title>@source(../title) (edit)</title>
|
<title>@source(../title) (edit)</title>
|
||||||
</slot>
|
</slot>
|
||||||
|
|
||||||
<slot parent>../..</slot>
|
<slot parent>../..</slot>
|
||||||
<slot location>@source(../location/!)</slot>
|
<slot location>@source(../location/!)</slot>
|
||||||
<slot edit/>
|
<slot edit/>
|
||||||
|
|
||||||
<slot content>
|
<slot content>
|
||||||
<macro src=".." join="@source(file-separator)">
|
<macro editor src=".."/>
|
||||||
<h1>
|
|
||||||
<span class="title-editor"
|
|
||||||
wikiwords="no"
|
|
||||||
contenteditable
|
|
||||||
oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
|
|
||||||
@source(./title)
|
|
||||||
</span>
|
|
||||||
</h1>
|
|
||||||
<pre class="editor"
|
|
||||||
wikiwords="no"
|
|
||||||
contenteditable
|
|
||||||
oninput="saveLiveContent(\'@source(s ./path)\', this.innerText)"
|
|
||||||
><quote filter="quote-tags" src="."/></pre>
|
|
||||||
</macro>
|
|
||||||
</slot>`},
|
</slot>`},
|
||||||
/*/
|
/*/
|
||||||
edit: {
|
edit: {
|
||||||
@ -2156,26 +2162,21 @@ module.System = {
|
|||||||
text: object.doc`
|
text: object.doc`
|
||||||
@load(./edit)
|
@load(./edit)
|
||||||
|
|
||||||
<slot content>
|
<macro texteditor>
|
||||||
<macro src=".." join="@source(file-separator)">
|
<div class="editor"
|
||||||
<h1>
|
wikiwords="no"
|
||||||
<span class="title-editor"
|
contenteditable
|
||||||
wikiwords="no"
|
class="native-editor"
|
||||||
contenteditable
|
oninput="saveLiveContent('@source(s ./path)/html', this.innerHTML)">
|
||||||
oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
|
@quote(./html)
|
||||||
@source(./title)
|
</div>
|
||||||
</span>
|
</macro>
|
||||||
</h1>
|
|
||||||
<div class="editor"
|
|
||||||
wikiwords="no"
|
|
||||||
contenteditable
|
|
||||||
class="native-editor"
|
|
||||||
oninput="saveLiveContent('@source(s ./path)/html', this.innerHTML)">
|
|
||||||
@quote(./html)
|
|
||||||
</div>
|
|
||||||
</macro>
|
|
||||||
</slot>
|
|
||||||
|
|
||||||
|
<!-- NOTE: we need to redefine this to make the overloaded
|
||||||
|
texteditor macro visible... -->
|
||||||
|
<slot content>
|
||||||
|
<macro editor src=".."/>
|
||||||
|
</slot>
|
||||||
<slot footer>
|
<slot footer>
|
||||||
<div style="text-align:right">
|
<div style="text-align:right">
|
||||||
<b>visual</b>
|
<b>visual</b>
|
||||||
@ -2186,25 +2187,20 @@ module.System = {
|
|||||||
text: object.doc`
|
text: object.doc`
|
||||||
@load(./edit)
|
@load(./edit)
|
||||||
|
|
||||||
<slot content>
|
<macro texteditor>
|
||||||
<macro src=".." join="@source(file-separator)">
|
<pre class="editor"
|
||||||
<h1>
|
wikiwords="no"
|
||||||
<span class="title-editor"
|
contenteditable
|
||||||
wikiwords="no"
|
class="native-editor"
|
||||||
contenteditable
|
oninput="saveLiveContent('@source(s ./path)', this.innerText)"
|
||||||
oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
|
><quote filter="quote-tags" src="."/></pre>
|
||||||
@source(./title)
|
</macro>
|
||||||
</span>
|
|
||||||
</h1>
|
|
||||||
<pre class="editor"
|
|
||||||
wikiwords="no"
|
|
||||||
contenteditable
|
|
||||||
class="native-editor"
|
|
||||||
oninput="saveLiveContent('@source(s ./path)', this.innerText)"
|
|
||||||
><quote filter="quote-tags" src="."/></pre>
|
|
||||||
</macro>
|
|
||||||
</slot>
|
|
||||||
|
|
||||||
|
<!-- NOTE: we need to redefine this to make the overloaded
|
||||||
|
texteditor macro visible... -->
|
||||||
|
<slot content>
|
||||||
|
<macro editor src=".."/>
|
||||||
|
</slot>
|
||||||
<slot footer>
|
<slot footer>
|
||||||
<div style="text-align:right">
|
<div style="text-align:right">
|
||||||
<a href="#../ed-visual">visual</a>
|
<a href="#../ed-visual">visual</a>
|
||||||
|
|||||||
@ -401,7 +401,7 @@ require(['./browser'], function(browser){
|
|||||||
var titles = [...document.querySelectorAll('title')]
|
var titles = [...document.querySelectorAll('title')]
|
||||||
titles[0].innerHTML =
|
titles[0].innerHTML =
|
||||||
`${titles.length > 1 ?
|
`${titles.length > 1 ?
|
||||||
titles.at(-1).innerHTML
|
titles.at(-1).innerText
|
||||||
: this.title} — pWiki`
|
: this.title} — pWiki`
|
||||||
// scroll to anchor element...
|
// scroll to anchor element...
|
||||||
this.hash
|
this.hash
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user