mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-11-04 04:50:09 +00:00 
			
		
		
		
	refactoring .system/edit...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									bec3f76f1d
								
							
						
					
					
						commit
						01ad4b4221
					
				@ -2093,16 +2093,7 @@ module.System = {
 | 
			
		||||
	edit: {
 | 
			
		||||
		// XXX not sure if we should use .title or .name here...
 | 
			
		||||
		text: object.doc`
 | 
			
		||||
			<slot pre>
 | 
			
		||||
				<title>@source(../title) (edit)</title>
 | 
			
		||||
			</slot>
 | 
			
		||||
 | 
			
		||||
			<slot parent>../..</slot>
 | 
			
		||||
			<slot location>@source(../location/!)</slot>
 | 
			
		||||
			<slot edit/>
 | 
			
		||||
 | 
			
		||||
			<slot content>
 | 
			
		||||
				<macro src=".." join="@source(file-separator)">
 | 
			
		||||
			<macro titleeditor>
 | 
			
		||||
				<h1>
 | 
			
		||||
					<span class="title-editor"
 | 
			
		||||
							wikiwords="no"
 | 
			
		||||
@ -2111,12 +2102,27 @@ module.System = {
 | 
			
		||||
						@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>
 | 
			
		||||
				<title>@source(../title) (edit)</title>
 | 
			
		||||
			</slot>
 | 
			
		||||
			<slot parent>../..</slot>
 | 
			
		||||
			<slot location>@source(../location/!)</slot>
 | 
			
		||||
			<slot edit/>
 | 
			
		||||
			<slot content>
 | 
			
		||||
				<macro editor src=".."/>
 | 
			
		||||
			</slot>`},
 | 
			
		||||
	/*/
 | 
			
		||||
	edit: {
 | 
			
		||||
@ -2156,16 +2162,7 @@ module.System = {
 | 
			
		||||
		text: object.doc`
 | 
			
		||||
			@load(./edit)
 | 
			
		||||
 | 
			
		||||
			<slot content>
 | 
			
		||||
				<macro src=".." join="@source(file-separator)">
 | 
			
		||||
					<h1>
 | 
			
		||||
						<span class="title-editor"
 | 
			
		||||
								wikiwords="no"
 | 
			
		||||
								contenteditable 
 | 
			
		||||
								oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
 | 
			
		||||
							@source(./title)
 | 
			
		||||
						</span>
 | 
			
		||||
					</h1>
 | 
			
		||||
			<macro texteditor>
 | 
			
		||||
				<div class="editor"
 | 
			
		||||
						wikiwords="no"
 | 
			
		||||
						contenteditable
 | 
			
		||||
@ -2174,8 +2171,12 @@ module.System = {
 | 
			
		||||
					@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>
 | 
			
		||||
				<div style="text-align:right">
 | 
			
		||||
					<b>visual</b> 
 | 
			
		||||
@ -2186,16 +2187,7 @@ module.System = {
 | 
			
		||||
		text: object.doc`
 | 
			
		||||
			@load(./edit)
 | 
			
		||||
 | 
			
		||||
			<slot content>
 | 
			
		||||
				<macro src=".." join="@source(file-separator)">
 | 
			
		||||
					<h1>
 | 
			
		||||
						<span class="title-editor"
 | 
			
		||||
								wikiwords="no"
 | 
			
		||||
								contenteditable 
 | 
			
		||||
								oninput="saveContent(\'@source(s ./path)/title\', this.innerText)">
 | 
			
		||||
							@source(./title)
 | 
			
		||||
						</span>
 | 
			
		||||
					</h1>
 | 
			
		||||
			<macro texteditor>
 | 
			
		||||
				<pre class="editor"
 | 
			
		||||
						wikiwords="no"
 | 
			
		||||
						contenteditable
 | 
			
		||||
@ -2203,8 +2195,12 @@ module.System = {
 | 
			
		||||
						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>
 | 
			
		||||
				<div style="text-align:right">
 | 
			
		||||
					<a href="#../ed-visual">visual</a> 
 | 
			
		||||
 | 
			
		||||
@ -401,7 +401,7 @@ require(['./browser'], function(browser){
 | 
			
		||||
			var titles = [...document.querySelectorAll('title')]
 | 
			
		||||
			titles[0].innerHTML = 
 | 
			
		||||
				`${titles.length > 1 ? 
 | 
			
		||||
					titles.at(-1).innerHTML 
 | 
			
		||||
					titles.at(-1).innerText
 | 
			
		||||
					: this.title} — pWiki`
 | 
			
		||||
			// scroll to anchor element...
 | 
			
		||||
			this.hash
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user