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: {
 | 
						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`
 | 
				
			||||||
			<slot pre>
 | 
								<macro titleeditor>
 | 
				
			||||||
				<title>@source(../title) (edit)</title>
 | 
					 | 
				
			||||||
			</slot>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			<slot parent>../..</slot>
 | 
					 | 
				
			||||||
			<slot location>@source(../location/!)</slot>
 | 
					 | 
				
			||||||
			<slot edit/>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			<slot content>
 | 
					 | 
				
			||||||
				<macro src=".." join="@source(file-separator)">
 | 
					 | 
				
			||||||
				<h1>
 | 
									<h1>
 | 
				
			||||||
					<span class="title-editor"
 | 
										<span class="title-editor"
 | 
				
			||||||
							wikiwords="no"
 | 
												wikiwords="no"
 | 
				
			||||||
@ -2111,12 +2102,27 @@ module.System = {
 | 
				
			|||||||
						@source(./title)
 | 
											@source(./title)
 | 
				
			||||||
					</span>
 | 
										</span>
 | 
				
			||||||
				</h1>
 | 
									</h1>
 | 
				
			||||||
 | 
								</macro>
 | 
				
			||||||
 | 
								<macro texteditor>
 | 
				
			||||||
				<pre class="editor"
 | 
									<pre class="editor"
 | 
				
			||||||
						wikiwords="no"
 | 
											wikiwords="no"
 | 
				
			||||||
						contenteditable
 | 
											contenteditable
 | 
				
			||||||
						oninput="saveLiveContent(\'@source(s ./path)\', this.innerText)"
 | 
											oninput="saveLiveContent(\'@source(s ./path)\', this.innerText)"
 | 
				
			||||||
					><quote filter="quote-tags" src="."/></pre> 
 | 
										><quote filter="quote-tags" src="."/></pre> 
 | 
				
			||||||
			</macro>
 | 
								</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>`},
 | 
								</slot>`},
 | 
				
			||||||
	/*/
 | 
						/*/
 | 
				
			||||||
	edit: {
 | 
						edit: {
 | 
				
			||||||
@ -2156,16 +2162,7 @@ module.System = {
 | 
				
			|||||||
		text: object.doc`
 | 
							text: object.doc`
 | 
				
			||||||
			@load(./edit)
 | 
								@load(./edit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<slot content>
 | 
								<macro texteditor>
 | 
				
			||||||
				<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>
 | 
					 | 
				
			||||||
				<div class="editor"
 | 
									<div class="editor"
 | 
				
			||||||
						wikiwords="no"
 | 
											wikiwords="no"
 | 
				
			||||||
						contenteditable
 | 
											contenteditable
 | 
				
			||||||
@ -2174,8 +2171,12 @@ module.System = {
 | 
				
			|||||||
					@quote(./html)
 | 
										@quote(./html)
 | 
				
			||||||
				</div>
 | 
									</div>
 | 
				
			||||||
			</macro>
 | 
								</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,16 +2187,7 @@ module.System = {
 | 
				
			|||||||
		text: object.doc`
 | 
							text: object.doc`
 | 
				
			||||||
			@load(./edit)
 | 
								@load(./edit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<slot content>
 | 
								<macro texteditor>
 | 
				
			||||||
				<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>
 | 
					 | 
				
			||||||
				<pre class="editor"
 | 
									<pre class="editor"
 | 
				
			||||||
						wikiwords="no"
 | 
											wikiwords="no"
 | 
				
			||||||
						contenteditable
 | 
											contenteditable
 | 
				
			||||||
@ -2203,8 +2195,12 @@ module.System = {
 | 
				
			|||||||
						oninput="saveLiveContent('@source(s ./path)', this.innerText)"
 | 
											oninput="saveLiveContent('@source(s ./path)', this.innerText)"
 | 
				
			||||||
					><quote filter="quote-tags" src="."/></pre> 
 | 
										><quote filter="quote-tags" src="."/></pre> 
 | 
				
			||||||
			</macro>
 | 
								</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