mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-11-04 04:50:09 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			ada5c33665
			...
			1a0e7b9d69
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1a0e7b9d69 | |||
| 9d83f807da | 
@ -221,6 +221,8 @@
 | 
				
			|||||||
				/* clickable things in view */
 | 
									/* clickable things in view */
 | 
				
			||||||
				& a,
 | 
									& a,
 | 
				
			||||||
				& pre,
 | 
									& pre,
 | 
				
			||||||
 | 
					                & button,
 | 
				
			||||||
 | 
					                & select,
 | 
				
			||||||
				& input {
 | 
									& input {
 | 
				
			||||||
					pointer-events: auto;
 | 
										pointer-events: auto;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
				
			|||||||
@ -309,6 +309,46 @@ var attributes = {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -      
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// XXX make this collapsed...
 | 
				
			||||||
 | 
					// XXX handle cursor marker...
 | 
				
			||||||
 | 
					var templates = {
 | 
				
			||||||
 | 
						__proto__: plugin,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						nodeFromTemplate: function(){
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						__pre_parse__: function(text, editor, elem){
 | 
				
			||||||
 | 
							if(!text.startsWith('TEMPLATE')){
 | 
				
			||||||
 | 
								return text }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							text = text
 | 
				
			||||||
 | 
								.replace(/^TEMPLATE/, '')
 | 
				
			||||||
 | 
							var [header, ...lines] = text.split(/\n/g)
 | 
				
			||||||
 | 
							 header = 
 | 
				
			||||||
 | 
								`<button>${
 | 
				
			||||||
 | 
									header.trim() == '' ?
 | 
				
			||||||
 | 
										'new'
 | 
				
			||||||
 | 
										: header.trim()
 | 
				
			||||||
 | 
								}</button>`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// body...
 | 
				
			||||||
 | 
							// XXX only do this if we have nested elements...
 | 
				
			||||||
 | 
							elem.collapsed = true
 | 
				
			||||||
 | 
							// XXX
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							// button...
 | 
				
			||||||
 | 
							return header },
 | 
				
			||||||
 | 
						// XXX focus button...
 | 
				
			||||||
 | 
						__focusin__: function(evt, editor, elem){
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						// XXX handle button???
 | 
				
			||||||
 | 
						__click__: function(evt, editor, elem){
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -      
 | 
					// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -      
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// XXX revise headings...
 | 
					// XXX revise headings...
 | 
				
			||||||
@ -967,6 +1007,7 @@ var JSONOutline = {
 | 
				
			|||||||
	// XXX split out DOM-specific plugins into Outline.plugins...
 | 
						// XXX split out DOM-specific plugins into Outline.plugins...
 | 
				
			||||||
	pre_plugins: [
 | 
						pre_plugins: [
 | 
				
			||||||
		attributes,
 | 
							attributes,
 | 
				
			||||||
 | 
					        templates,
 | 
				
			||||||
		blocks,
 | 
							blocks,
 | 
				
			||||||
		quoted,
 | 
							quoted,
 | 
				
			||||||
	],
 | 
						],
 | 
				
			||||||
 | 
				
			|||||||
@ -155,6 +155,46 @@ var setup = function(){
 | 
				
			|||||||
        |text|text|text|
 | 
					        |text|text|text|
 | 
				
			||||||
  -
 | 
					  -
 | 
				
			||||||
- ## ToDo:
 | 
					- ## ToDo:
 | 
				
			||||||
 | 
					  - Item templates:
 | 
				
			||||||
 | 
					    - inline
 | 
				
			||||||
 | 
					      - TEMPLATE
 | 
				
			||||||
 | 
					        text [cursor]
 | 
				
			||||||
 | 
					      - TEMPLATE title
 | 
				
			||||||
 | 
					        text [cursor]
 | 
				
			||||||
 | 
					    - sub-tree 
 | 
				
			||||||
 | 
					      - TEMPLATE title
 | 
				
			||||||
 | 
					        - text [cursor]
 | 
				
			||||||
 | 
					    - multi-template
 | 
				
			||||||
 | 
					      - TEMPLATE title A
 | 
				
			||||||
 | 
					        text [cursor]
 | 
				
			||||||
 | 
					      - TEMPLATE title B
 | 
				
			||||||
 | 
					        - text [cursor]
 | 
				
			||||||
 | 
					    - renders as:
 | 
				
			||||||
 | 
					      - <button>title</button>
 | 
				
			||||||
 | 
					      - <select>
 | 
				
			||||||
 | 
					          <option>title A</option>
 | 
				
			||||||
 | 
					          <option>title B</option>
 | 
				
			||||||
 | 
					        </select><button>new</button>
 | 
				
			||||||
 | 
					    - action:
 | 
				
			||||||
 | 
					      - duplicate template text / subtree (w.o. markers)
 | 
				
			||||||
 | 
					      - select / place cursor at cursor marker
 | 
				
			||||||
 | 
						- TODO:
 | 
				
			||||||
 | 
					      - nested templates??
 | 
				
			||||||
 | 
					      - global templates -- or should this be an external macro???
 | 
				
			||||||
 | 
					      - revise syntax
 | 
				
			||||||
 | 
					      - templated lists -- a list that uses a template for it's items
 | 
				
			||||||
 | 
					        - something like:
 | 
				
			||||||
 | 
					          - or here there is an explicit item template
 | 
				
			||||||
 | 
					            - TEMPLATE new
 | 
				
			||||||
 | 
					              - [ ] [cursor]
 | 
				
			||||||
 | 
					            - [ ] A
 | 
				
			||||||
 | 
					            - [ ] B
 | 
				
			||||||
 | 
					            - [ ] C
 | 
				
			||||||
 | 
					        - and a shorthand for todo:
 | 
				
			||||||
 | 
					          - TODO in lists like this new items will be created with a todo template
 | 
				
			||||||
 | 
					            - [ ] A
 | 
				
			||||||
 | 
					            - [ ] B
 | 
				
			||||||
 | 
					            - [ ] C
 | 
				
			||||||
  - Time to think about a standalone client -- at least to edit own notes as a test...
 | 
					  - Time to think about a standalone client -- at least to edit own notes as a test...
 | 
				
			||||||
    - _also this would be a nice opportunity to start the move to a newer electron version_
 | 
					    - _also this would be a nice opportunity to start the move to a newer electron version_
 | 
				
			||||||
    - Deployment:
 | 
					    - Deployment:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user