mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 07:32:59 +00:00 
			
		
		
		
	Starting to introduce list views
These are custom modules for visualising list manipulations and navigations
This commit is contained in:
		| @@ -22,7 +22,9 @@ exports.info = { | ||||
| 		templateText: {byName: true, type: "text"}, | ||||
| 		editTemplate: {byName: true, type: "tiddler"}, | ||||
| 		editTemplateText: {byName: true, type: "text"}, | ||||
| 		emptyMessage: {byName: true, type: "text"} | ||||
| 		emptyMessage: {byName: true, type: "text"}, | ||||
| 		listviewTiddler: {byName: true, type: "tiddler"}, | ||||
| 		listview: {byName: true, type: "text"} | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| @@ -59,6 +61,22 @@ exports.executeMacro = function() { | ||||
| 	return this.listFrame; | ||||
| }; | ||||
|  | ||||
| exports.postRenderInDom = function() { | ||||
| 	// Instantiate the list view | ||||
| 	var listviewName; | ||||
| 	if(this.hasParameter("listviewTiddler")) { | ||||
| 		listviewName = this.wiki.getTextReference(this.params.listviewTiddler); | ||||
| 	} | ||||
| 	if(!listviewName && this.hasParameter("listview")) { | ||||
| 		listviewName = this.params.listview; | ||||
| 	} | ||||
| 	var ListView = this.wiki.macros.list.listviews[listviewName]; | ||||
| 	this.listview = ListView ? new ListView(this) : null; | ||||
| 	if(this.listview) { | ||||
| 		this.listview.test(); | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| exports.getTiddlerList = function() { | ||||
| 	var filter; | ||||
| 	if(this.hasParameter("type")) { | ||||
|   | ||||
							
								
								
									
										25
									
								
								core/modules/macros/list/listviews/classic.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								core/modules/macros/list/listviews/classic.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| /*\ | ||||
| title: $:/core/modules/macros/list/listviews/classic.js | ||||
| type: application/javascript | ||||
| module-type: listview | ||||
|  | ||||
| Views the list as a linear sequence | ||||
|  | ||||
| \*/ | ||||
| (function(){ | ||||
|  | ||||
| /*jslint node: true, browser: true */ | ||||
| /*global $tw: false */ | ||||
| "use strict"; | ||||
|  | ||||
| function ClassicListView(listMacro) { | ||||
| 	this.listMacro = listMacro; | ||||
| }; | ||||
|  | ||||
| ClassicListView.prototype.test = function() { | ||||
| 	alert("In ClassicListView"); | ||||
| }; | ||||
|  | ||||
| exports["classic"] = ClassicListView; | ||||
|  | ||||
| })(); | ||||
		Reference in New Issue
	
	Block a user
	 Jeremy Ruston
					Jeremy Ruston