mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-10 08:00:03 +00:00
Add tiddler info "advanced" panel
This commit is contained in:
parent
b714c67374
commit
42c67cfeb7
@ -1,5 +1,14 @@
|
|||||||
title: $:/language/TiddlerInfo/
|
title: $:/language/TiddlerInfo/
|
||||||
|
|
||||||
|
Advanced/Caption: Advanced
|
||||||
|
Advanced/PluginInfo/Empty/Hint: none
|
||||||
|
Advanced/PluginInfo/Heading: Plugin Details
|
||||||
|
Advanced/PluginInfo/Hint: This plugin contains the following shadow tiddlers:
|
||||||
|
Advanced/ShadowInfo/Heading: Shadow Status
|
||||||
|
Advanced/ShadowInfo/NotShadow/Hint: The tiddler <$link to=<<infoTiddler>>><$text text=<<infoTiddler>>/></$link> is not a shadow tiddler
|
||||||
|
Advanced/ShadowInfo/Shadow/Hint: The tiddler <$link to=<<infoTiddler>>><$text text=<<infoTiddler>>/></$link> is a shadow tiddler
|
||||||
|
Advanced/ShadowInfo/Shadow/Source: It is defined in the plugin <$link to=<<pluginTiddler>>><$text text=<<pluginTiddler>>/></$link>
|
||||||
|
Advanced/ShadowInfo/OverriddenShadow/Hint: It is overridden by an ordinary tiddler
|
||||||
Fields/Caption: Fields
|
Fields/Caption: Fields
|
||||||
List/Caption: List
|
List/Caption: List
|
||||||
List/Empty: This tiddler does not have a list
|
List/Empty: This tiddler does not have a list
|
||||||
|
47
core/modules/filters/plugintiddlers.js
Normal file
47
core/modules/filters/plugintiddlers.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/plugintiddlers.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: filteroperator
|
||||||
|
|
||||||
|
Filter operator for returning the titles of the shadow tiddlers within a plugin
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.plugintiddlers = function(source,operator,options) {
|
||||||
|
var results = [],
|
||||||
|
pushShadows;
|
||||||
|
switch(operator.operand) {
|
||||||
|
default:
|
||||||
|
pushShadows = function(title) {
|
||||||
|
var pluginInfo = options.wiki.pluginInfo[title];
|
||||||
|
if(pluginInfo) {
|
||||||
|
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
|
||||||
|
results.push(title);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Iterate through the source tiddlers
|
||||||
|
if($tw.utils.isArray(source)) {
|
||||||
|
$tw.utils.each(source,function(title) {
|
||||||
|
pushShadows(title);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$tw.utils.each(source,function(element,title) {
|
||||||
|
pushShadows(title);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
results.sort();
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
40
core/modules/filters/shadowsource.js
Normal file
40
core/modules/filters/shadowsource.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/shadowsource.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: filteroperator
|
||||||
|
|
||||||
|
Filter operator for returning the source plugins for shadow tiddlers
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.shadowsource = function(source,operator,options) {
|
||||||
|
var results = [],
|
||||||
|
pushShadowSource = function(title) {
|
||||||
|
var shadowInfo = options.wiki.shadowTiddlers[title];
|
||||||
|
if(shadowInfo) {
|
||||||
|
$tw.utils.pushTop(results,shadowInfo.source);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// Iterate through the source tiddlers
|
||||||
|
if($tw.utils.isArray(source)) {
|
||||||
|
$tw.utils.each(source,function(title) {
|
||||||
|
pushShadowSource(title);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$tw.utils.each(source,function(element,title) {
|
||||||
|
pushShadowSource(title);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
results.sort();
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
8
core/ui/TiddlerInfo/Advanced.tid
Normal file
8
core/ui/TiddlerInfo/Advanced.tid
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
title: $:/core/ui/TiddlerInfo/Advanced
|
||||||
|
tags: $:/tags/TiddlerInfo
|
||||||
|
caption: {{$:/language/TiddlerInfo/Advanced/Caption}}
|
||||||
|
|
||||||
|
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo/Advanced]] [!is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo/Advanced]] +[tag[$:/tags/TiddlerInfo/Advanced]]" variable="listItem">
|
||||||
|
<$transclude tiddler=<<listItem>>/>
|
||||||
|
|
||||||
|
</$list>
|
20
core/ui/TiddlerInfo/Advanced/PluginInfo.tid
Normal file
20
core/ui/TiddlerInfo/Advanced/PluginInfo.tid
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
title: $:/core/ui/TiddlerInfo/Advanced/PluginInfo
|
||||||
|
tags: $:/tags/TiddlerInfo/Advanced
|
||||||
|
|
||||||
|
\define lingo-base() $:/language/TiddlerInfo/Advanced/PluginInfo/
|
||||||
|
<$list filter="[is[current]has[plugin-type]]">
|
||||||
|
|
||||||
|
! <<lingo Heading>>
|
||||||
|
|
||||||
|
<<lingo Hint>>
|
||||||
|
<ul>
|
||||||
|
<$list filter="[is[current]plugintiddlers[]sort[title]]" emptyMessage=<<lingo Empty/Hint>>>
|
||||||
|
<li>
|
||||||
|
<$link to={{!!title}}>
|
||||||
|
<$view field="title"/>
|
||||||
|
</$link>
|
||||||
|
</li>
|
||||||
|
</$list>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</$list>
|
35
core/ui/TiddlerInfo/Advanced/ShadowInfo.tid
Normal file
35
core/ui/TiddlerInfo/Advanced/ShadowInfo.tid
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
title: $:/core/ui/TiddlerInfo/Advanced/ShadowInfo
|
||||||
|
tags: $:/tags/TiddlerInfo/Advanced
|
||||||
|
|
||||||
|
\define lingo-base() $:/language/TiddlerInfo/Advanced/ShadowInfo/
|
||||||
|
<$set name="infoTiddler" value=<<currentTiddler>>>
|
||||||
|
|
||||||
|
! <<lingo Heading>>
|
||||||
|
|
||||||
|
<$list filter="[is[current]!is[shadow]]">
|
||||||
|
|
||||||
|
<<lingo NotShadow/Hint>>
|
||||||
|
|
||||||
|
</$list>
|
||||||
|
|
||||||
|
<$list filter="[is[current]is[shadow]]">
|
||||||
|
|
||||||
|
<<lingo Shadow/Hint>>
|
||||||
|
|
||||||
|
<$list filter="[is[current]shadowsource[]]">
|
||||||
|
|
||||||
|
<$set name="pluginTiddler" value=<<currentTiddler>>>
|
||||||
|
<<lingo Shadow/Source>>
|
||||||
|
</$set>
|
||||||
|
|
||||||
|
</$list>
|
||||||
|
|
||||||
|
<$list filter="[is[current]is[shadow]is[tiddler]]">
|
||||||
|
|
||||||
|
<<lingo OverriddenShadow/Hint>>
|
||||||
|
|
||||||
|
</$list>
|
||||||
|
|
||||||
|
|
||||||
|
</$list>
|
||||||
|
</$set>
|
2
core/wiki/tags/TiddlerInfoAdvanced.tid
Normal file
2
core/wiki/tags/TiddlerInfoAdvanced.tid
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
title: $:/tags/TiddlerInfo/Advanced
|
||||||
|
list: [[$:/core/ui/TiddlerInfo/Advanced/ShadowInfo]] [[$:/core/ui/TiddlerInfo/Advanced/PluginInfo]]
|
Loading…
x
Reference in New Issue
Block a user