mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-11-04 04:50:09 +00:00 
			
		
		
		
	split out css + minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									45d8ef11d3
								
							
						
					
					
						commit
						94ef144c0f
					
				
							
								
								
									
										61
									
								
								experiments/outline-editor/editor.css
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										61
									
								
								experiments/outline-editor/editor.css
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,61 @@
 | 
			
		||||
 | 
			
		||||
:root {
 | 
			
		||||
	font-family: sans-serif;
 | 
			
		||||
	font-size: 5mm;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor [tabindex] {
 | 
			
		||||
	position: relative;
 | 
			
		||||
}
 | 
			
		||||
.editor div [tabindex] {
 | 
			
		||||
	margin-left: 2em;
 | 
			
		||||
}
 | 
			
		||||
.editor [tabindex]>span,
 | 
			
		||||
.editor [tabindex]>textarea {
 | 
			
		||||
	--padding: 0.2em;
 | 
			
		||||
 | 
			
		||||
	display: block;
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	/* XXX this is a tiny bit off and using textarea's height here is off too... */
 | 
			
		||||
	min-height: 1em;
 | 
			
		||||
	padding: var(--padding);
 | 
			
		||||
	margin: 0;
 | 
			
		||||
 | 
			
		||||
	font-family: sans-serif;
 | 
			
		||||
	font-size: 5mm;
 | 
			
		||||
	white-space: pre;
 | 
			
		||||
 | 
			
		||||
	outline: none;
 | 
			
		||||
	border: none;
 | 
			
		||||
}
 | 
			
		||||
.editor [tabindex]>textarea {
 | 
			
		||||
	height: calc(2 * var(--padding) + 1em);
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	resize: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* show/hide node's view/code... */
 | 
			
		||||
.editor [tabindex]>span+textarea:not(:focus),
 | 
			
		||||
/* XXX not sure how to do this without :has(..)... */
 | 
			
		||||
.editor [tabindex]:has(>span+textarea:focus)>span:has(+textarea),
 | 
			
		||||
.editor [tabindex]:focus>span+textarea {
 | 
			
		||||
	position: absolute;
 | 
			
		||||
	opacity: 0;
 | 
			
		||||
	top: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor div[collapsed] {
 | 
			
		||||
	border-bottom: solid 1px silver;
 | 
			
		||||
}
 | 
			
		||||
.editor div[collapsed] div {
 | 
			
		||||
	display: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor div:focus {
 | 
			
		||||
	/*outline: solid 0.2em silver;*/
 | 
			
		||||
	outline: none;
 | 
			
		||||
}
 | 
			
		||||
.editor div:focus>span,
 | 
			
		||||
.editor div:focus>textarea {
 | 
			
		||||
	background: silver;
 | 
			
		||||
}
 | 
			
		||||
@ -314,10 +314,10 @@ var Outline = {
 | 
			
		||||
		// indent...
 | 
			
		||||
		Tab: function(evt){
 | 
			
		||||
			evt.preventDefault()
 | 
			
		||||
			var editable = this.get('editable')
 | 
			
		||||
			var edited = this.get('edited')
 | 
			
		||||
			var node = this.indent(!evt.shiftKey)
 | 
			
		||||
			;(editable ?
 | 
			
		||||
				editable
 | 
			
		||||
			;(edited ?
 | 
			
		||||
				edited
 | 
			
		||||
				: node)?.focus() },
 | 
			
		||||
 | 
			
		||||
		// edit mode...
 | 
			
		||||
 | 
			
		||||
@ -1,67 +1,8 @@
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
<link href="editor.css" rel="stylesheet"/>
 | 
			
		||||
<style>
 | 
			
		||||
 | 
			
		||||
:root {
 | 
			
		||||
	font-family: sans-serif;
 | 
			
		||||
	font-size: 5mm;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor [tabindex] {
 | 
			
		||||
	position: relative;
 | 
			
		||||
}
 | 
			
		||||
.editor div [tabindex] {
 | 
			
		||||
	margin-left: 2em;
 | 
			
		||||
}
 | 
			
		||||
.editor [tabindex]>span,
 | 
			
		||||
.editor [tabindex]>textarea {
 | 
			
		||||
	--padding: 0.2em;
 | 
			
		||||
 | 
			
		||||
	display: block;
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	/* XXX this is a tiny bit off and using textarea's height here is off too... */
 | 
			
		||||
	min-height: 1em;
 | 
			
		||||
	padding: var(--padding);
 | 
			
		||||
	margin: 0;
 | 
			
		||||
 | 
			
		||||
	font-family: sans-serif;
 | 
			
		||||
	font-size: 5mm;
 | 
			
		||||
	white-space: pre;
 | 
			
		||||
 | 
			
		||||
	outline: none;
 | 
			
		||||
	border: none;
 | 
			
		||||
}
 | 
			
		||||
.editor [tabindex]>textarea {
 | 
			
		||||
	height: calc(2 * var(--padding) + 1em);
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	resize: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* show/hide node's view/code... */
 | 
			
		||||
.editor [tabindex]>span+textarea:not(:focus),
 | 
			
		||||
/* XXX not sure how to do this without :has(..)... */
 | 
			
		||||
.editor [tabindex]:has(>span+textarea:focus)>span:has(+textarea),
 | 
			
		||||
.editor [tabindex]:focus>span+textarea {
 | 
			
		||||
	position: absolute;
 | 
			
		||||
	opacity: 0;
 | 
			
		||||
	top: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor div[collapsed] {
 | 
			
		||||
	border-bottom: solid 1px silver;
 | 
			
		||||
}
 | 
			
		||||
.editor div[collapsed] div {
 | 
			
		||||
	display: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.editor div:focus {
 | 
			
		||||
	/*outline: solid 0.2em silver;*/
 | 
			
		||||
	outline: none;
 | 
			
		||||
}
 | 
			
		||||
.editor div:focus>span,
 | 
			
		||||
.editor div:focus>textarea {
 | 
			
		||||
	background: silver;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
<script src="generic.js"></script>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user