1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 11:00:27 +00:00

Add tv-override-missing-links to fix links to missing tiddlers (#3530)

* add tv-override-missing-links variable

this lets us set `tv-override-missing-links` true so that we can fix edge cases like the `Filter` dropdown in the `Advanced Search` when `enable missing links` is unchecked in the `Settings` tab of the Control Panel

* add tv-override-missing-links to filter dropdown

* add tv-override-missing-links to type dropdown

* add tv-override-missing-links to fieldname dropd

* add tv-override-missing-links to TagManager(icons)

* undo tv-override-missing-links TagManager

not needed here

* Update link.js

* Update dropdown.tid

* Update fields.tid

* Update type.tid

* Update dropdown.tid

* Update link.js

* simplify all together

* add tv-hide-missing-links to pagetemplate

* do we need to refresh here...

... if the variable gets set on top of the pagetemplate?
This commit is contained in:
BurningTreeC 2018-11-24 14:36:48 +01:00 committed by Jeremy Ruston
parent f32cb52ba6
commit 3f91d5b3a1
5 changed files with 13 additions and 4 deletions

View File

@ -13,7 +13,6 @@ Link widget
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var MISSING_LINK_CONFIG_TITLE = "$:/config/MissingLinks";
var LinkWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
@ -182,7 +181,7 @@ LinkWidget.prototype.execute = function() {
// Determine the link characteristics
this.isMissing = !this.wiki.tiddlerExists(this.to);
this.isShadow = this.wiki.isShadowTiddler(this.to);
this.hideMissingLinks = ($tw.wiki.getTiddlerText(MISSING_LINK_CONFIG_TITLE,"yes") === "no");
this.hideMissingLinks = this.getVariable("tv-hide-missing-links") === "yes";
// Make the child widgets
this.makeChildWidgets();
};
@ -192,7 +191,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
LinkWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip || changedTiddlers[MISSING_LINK_CONFIG_TITLE]) {
if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip) {
this.refreshSelf();
return true;
}

View File

@ -8,6 +8,7 @@ tags: $:/tags/AdvancedSearch/FilterButton
</span>
<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
<$set name="tv-hide-missing-links" value="no">
<$linkcatcher to="$:/temp/advancedsearch">
<div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown">
@ -16,4 +17,5 @@ tags: $:/tags/AdvancedSearch/FilterButton
</div>
</div>
</$linkcatcher>
</$set>
</$reveal>

View File

@ -65,6 +65,7 @@ $value={{$:/temp/newfieldvalue}}/>
<$button popup=<<qualify "$:/state/popup/field-dropdown">> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Field/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Field/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button>
<$reveal state=<<qualify "$:/state/popup/field-dropdown">> type="nomatch" text="" default="">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$set name="tv-hide-missing-links" value="no">
<$linkcatcher to="$:/temp/newfieldname">
<div class="tc-dropdown-item">
<<lingo Fields/Add/Dropdown/User>>
@ -83,6 +84,7 @@ $value={{$:/temp/newfieldvalue}}/>
</$link>
</$list>
</$linkcatcher>
</$set>
</div>
</$reveal>
<span class="tc-edit-field-add-value">

View File

@ -7,6 +7,7 @@ tags: $:/tags/EditTemplate
</$fieldmangler></div>
<div class="tc-block-dropdown-wrapper">
<$set name="tv-hide-missing-links" value="no">
<$reveal state=<<qualify "$:/state/popup/type-dropdown">> type="nomatch" text="" default="">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$linkcatcher to="!!type">
@ -20,4 +21,5 @@ tags: $:/tags/EditTemplate
</$linkcatcher>
</div>
</$reveal>
</div>
</$set>
</div>

View File

@ -11,6 +11,8 @@ tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
<$set name="tv-config-toolbar-class" value={{$:/config/Toolbar/ButtonClass}}>
<$set name="tv-hide-missing-links" value={{$:/config/MissingLinks}}>
<$set name="storyviewTitle" value={{$:/view}}>
<$set name="currentTiddler" value={{$:/language}}>
@ -50,3 +52,5 @@ tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
</$set>
</$set>
</$set>