1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 17:40:29 +00:00

Rename "viewer" modules to "fieldviewer"

This commit is contained in:
Jeremy Ruston 2012-10-23 16:40:22 +01:00
parent 91bebe7b7f
commit 5ced636abf
9 changed files with 13 additions and 13 deletions

View File

@ -49,10 +49,10 @@ exports.executeMacro = function() {
// Figure out which viewer to use // Figure out which viewer to use
// TODO: Tiddler field modules should be able to specify a field type from which the viewer is derived // TODO: Tiddler field modules should be able to specify a field type from which the viewer is derived
if(tiddler && this.params.format) { 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) { if(!viewer) {
viewer = this.wiki.macros.view.viewers["text"]; viewer = this.wiki.macros.view.fieldviewers["text"];
} }
// Call the viewer to generate the content // Call the viewer to generate the content
return viewer(tiddler,field,value,this); return viewer(tiddler,field,value,this);

View File

@ -1,7 +1,7 @@
/*\ /*\
title: $:/core/modules/macros/view/viewers/date.js title: $:/core/modules/macros/view/viewers/date.js
type: application/javascript type: application/javascript
module-type: viewer module-type: fieldviewer
A viewer for viewing tiddler fields as a date A viewer for viewing tiddler fields as a date

View File

@ -1,7 +1,7 @@
/*\ /*\
title: $:/core/modules/macros/view/viewers/link.js title: $:/core/modules/macros/view/viewers/link.js
type: application/javascript type: application/javascript
module-type: viewer module-type: fieldviewer
A viewer for viewing tiddler fields as a link A viewer for viewing tiddler fields as a link

View File

@ -1,7 +1,7 @@
/*\ /*\
title: $:/core/modules/macros/view/viewers/text.js title: $:/core/modules/macros/view/viewers/text.js
type: application/javascript type: application/javascript
module-type: viewer module-type: fieldviewer
A viewer for viewing tiddler fields as plain text A viewer for viewing tiddler fields as plain text

View File

@ -1,7 +1,7 @@
/*\ /*\
title: $:/core/modules/macros/view/viewers/transclude.js title: $:/core/modules/macros/view/viewers/transclude.js
type: application/javascript type: application/javascript
module-type: viewer module-type: fieldviewer
A viewer that transcludes the tiddler whose title is specified in the viewed field A viewer that transcludes the tiddler whose title is specified in the viewed field

View File

@ -1,7 +1,7 @@
/*\ /*\
title: $:/core/modules/macros/view/viewers/wikified.js title: $:/core/modules/macros/view/viewers/wikified.js
type: application/javascript type: application/javascript
module-type: viewer module-type: fieldviewer
A viewer for viewing tiddler fields as wikified text A viewer for viewing tiddler fields as wikified text

View File

@ -33,7 +33,7 @@ exports.startup = function() {
// Set up the wiki store // Set up the wiki store
$tw.wiki.initMacros(); $tw.wiki.initMacros();
$tw.wiki.initEditors(); $tw.wiki.initEditors();
$tw.wiki.initViewers(); $tw.wiki.initFieldViewers();
$tw.wiki.initStoryViews(); $tw.wiki.initStoryViews();
$tw.wiki.initParsers(); $tw.wiki.initParsers();
// Set up the command modules // Set up the command modules

View File

@ -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) { exports.initFieldViewers = function(moduleType) {
moduleType = moduleType || "viewer"; moduleType = moduleType || "fieldviewer";
var viewMacro = this.macros.view; var viewMacro = this.macros.view;
if(viewMacro) { if(viewMacro) {
viewMacro.viewers = {}; viewMacro.fieldviewers = {};
$tw.modules.applyMethods(moduleType,viewMacro.viewers); $tw.modules.applyMethods(moduleType,viewMacro.fieldviewers);
} }
}; };