mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-25 09:30:28 +00:00
Rename "viewer" modules to "fieldviewer"
This commit is contained in:
parent
91bebe7b7f
commit
5ced636abf
@ -49,10 +49,10 @@ exports.executeMacro = function() {
|
||||
// Figure out which viewer to use
|
||||
// TODO: Tiddler field modules should be able to specify a field type from which the viewer is derived
|
||||
if(tiddler && this.params.format) {
|
||||
var viewer = this.wiki.macros.view.viewers[this.params.format];
|
||||
var viewer = this.wiki.macros.view.fieldviewers[this.params.format];
|
||||
}
|
||||
if(!viewer) {
|
||||
viewer = this.wiki.macros.view.viewers["text"];
|
||||
viewer = this.wiki.macros.view.fieldviewers["text"];
|
||||
}
|
||||
// Call the viewer to generate the content
|
||||
return viewer(tiddler,field,value,this);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/macros/view/viewers/date.js
|
||||
type: application/javascript
|
||||
module-type: viewer
|
||||
module-type: fieldviewer
|
||||
|
||||
A viewer for viewing tiddler fields as a date
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/macros/view/viewers/link.js
|
||||
type: application/javascript
|
||||
module-type: viewer
|
||||
module-type: fieldviewer
|
||||
|
||||
A viewer for viewing tiddler fields as a link
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/macros/view/viewers/text.js
|
||||
type: application/javascript
|
||||
module-type: viewer
|
||||
module-type: fieldviewer
|
||||
|
||||
A viewer for viewing tiddler fields as plain text
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/macros/view/viewers/transclude.js
|
||||
type: application/javascript
|
||||
module-type: viewer
|
||||
module-type: fieldviewer
|
||||
|
||||
A viewer that transcludes the tiddler whose title is specified in the viewed field
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: $:/core/modules/macros/view/viewers/wikified.js
|
||||
type: application/javascript
|
||||
module-type: viewer
|
||||
module-type: fieldviewer
|
||||
|
||||
A viewer for viewing tiddler fields as wikified text
|
||||
|
||||
|
@ -33,7 +33,7 @@ exports.startup = function() {
|
||||
// Set up the wiki store
|
||||
$tw.wiki.initMacros();
|
||||
$tw.wiki.initEditors();
|
||||
$tw.wiki.initViewers();
|
||||
$tw.wiki.initFieldViewers();
|
||||
$tw.wiki.initStoryViews();
|
||||
$tw.wiki.initParsers();
|
||||
// Set up the command modules
|
||||
|
@ -533,14 +533,14 @@ exports.initEditors = function(moduleType) {
|
||||
};
|
||||
|
||||
/*
|
||||
Install viewer modules for the edit macro
|
||||
Install field viewer modules for the edit macro
|
||||
*/
|
||||
exports.initViewers = function(moduleType) {
|
||||
moduleType = moduleType || "viewer";
|
||||
exports.initFieldViewers = function(moduleType) {
|
||||
moduleType = moduleType || "fieldviewer";
|
||||
var viewMacro = this.macros.view;
|
||||
if(viewMacro) {
|
||||
viewMacro.viewers = {};
|
||||
$tw.modules.applyMethods(moduleType,viewMacro.viewers);
|
||||
viewMacro.fieldviewers = {};
|
||||
$tw.modules.applyMethods(moduleType,viewMacro.fieldviewers);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user