mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 02:50:08 +00:00 
			
		
		
		
	now text editor is a textarea, still experimenting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									cedd1bbb79
								
							
						
					
					
						commit
						5e7707696a
					
				| @ -1878,6 +1878,7 @@ object.Constructor('CachedPage', Page, { | |||||||
| //---------------------------------------------------------------------
 | //---------------------------------------------------------------------
 | ||||||
| 
 | 
 | ||||||
| var wikiword = require('./dom/wikiword') | var wikiword = require('./dom/wikiword') | ||||||
|  | var textarea = require('./dom/textarea') | ||||||
| 
 | 
 | ||||||
| var pWikiPageElement = | var pWikiPageElement = | ||||||
| module.pWikiPageElement =  | module.pWikiPageElement =  | ||||||
| @ -1892,6 +1893,7 @@ object.Constructor('pWikiPageElement', Page, { | |||||||
| 	domFilters: { | 	domFilters: { | ||||||
| 		// XXX see Page.filters.wikiword for notes...
 | 		// XXX see Page.filters.wikiword for notes...
 | ||||||
| 		wikiword: wikiword.wikiWordText, | 		wikiword: wikiword.wikiWordText, | ||||||
|  | 		textarea: textarea.setupTextarea, | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 	// XXX CACHE
 | 	// XXX CACHE
 | ||||||
| @ -2068,6 +2070,7 @@ module.System = { | |||||||
| 				+'</pre>'  | 				+'</pre>'  | ||||||
| 			+'</macro>'}, | 			+'</macro>'}, | ||||||
| 	//*/
 | 	//*/
 | ||||||
|  | 	/* XXX textarea or contenteditable -- the later has annoying editor features... | ||||||
| 	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` | ||||||
| @ -2080,11 +2083,13 @@ module.System = { | |||||||
| 
 | 
 | ||||||
| 			<slot content> | 			<slot content> | ||||||
| 				<macro src=".." join="@source(file-separator)"> | 				<macro src=".." join="@source(file-separator)"> | ||||||
| 					<h1 class="title-editor" | 					<h1> | ||||||
|  | 						<span class="title-editor" | ||||||
| 								wikiwords="no" | 								wikiwords="no" | ||||||
| 								contenteditable  | 								contenteditable  | ||||||
| 								oninput="saveContent(\'@source(s ./path)/title\', this.innerText)"> | 								oninput="saveContent(\'@source(s ./path)/title\', this.innerText)"> | ||||||
| 							@source(./title) | 							@source(./title) | ||||||
|  | 						</span> | ||||||
| 					</h1> | 					</h1> | ||||||
| 					<pre class="editor" | 					<pre class="editor" | ||||||
| 							wikiwords="no" | 							wikiwords="no" | ||||||
| @ -2093,6 +2098,36 @@ module.System = { | |||||||
| 					><quote filter="quote-tags" src="."/></pre>  | 					><quote filter="quote-tags" src="."/></pre>  | ||||||
| 				</macro> | 				</macro> | ||||||
| 			</slot>`}, | 			</slot>`}, | ||||||
|  | 	/*/ | ||||||
|  | 	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 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> | ||||||
|  | 					<textarea class="editor" | ||||||
|  | 							style="width:100%;" | ||||||
|  | 							wikiwords="no" | ||||||
|  | 							contenteditable | ||||||
|  | 							oninput="saveLiveContent(\'@source(s ./path)\', this.value)" | ||||||
|  | 					><quote filter="quote-tags" src="."/></textarea>  | ||||||
|  | 				</macro> | ||||||
|  | 			</slot>`}, | ||||||
|  | 	//*/
 | ||||||
| 
 | 
 | ||||||
| 	// XXX debug...
 | 	// XXX debug...
 | ||||||
| 	_path: {text: '@source(./path/! join=" ")'}, | 	_path: {text: '@source(./path/! join=" ")'}, | ||||||
|  | |||||||
| @ -150,9 +150,15 @@ body.loading .page.spinner span { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | textarea { | ||||||
|  | 	font-size: 1.2em; | ||||||
|  | 	border: none; | ||||||
|  | 	resize: none; | ||||||
|  | } | ||||||
| [contenteditable] { | [contenteditable] { | ||||||
| 	outline: 0px solid transparent; | 	outline: 0px solid transparent; | ||||||
| } | } | ||||||
|  | textarea:empty:after, | ||||||
| [contenteditable]:empty:after { | [contenteditable]:empty:after { | ||||||
| 	display: block; | 	display: block; | ||||||
| 	content: 'Empty'; | 	content: 'Empty'; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user