mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-26 01:50:28 +00:00
Rename internal "unknown" filter operator so that users cannot invoke it
This commit is contained in:
parent
774459fa73
commit
413dc86d05
@ -247,8 +247,8 @@ exports.compileFilter = function(filterString) {
|
||||
// Use the "title" operator if no operator is specified
|
||||
operatorFunction = filterOperators.title;
|
||||
} else if(!filterOperators[operator.operator]) {
|
||||
// Unknown operators treated as "unknown" - at run time we can distinguish between a custom operator and falling back to the default "field" operator
|
||||
operatorFunction = filterOperators.unknown;
|
||||
// Unknown operators treated as "[unknown]" - at run time we can distinguish between a custom operator and falling back to the default "field" operator
|
||||
operatorFunction = filterOperators["[unknown]"];
|
||||
} else {
|
||||
// Use the operator function
|
||||
operatorFunction = filterOperators[operator.operator];
|
||||
|
@ -3,7 +3,9 @@ title: $:/core/modules/filters/unknown.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for handling unknown filter operators
|
||||
Filter operator for handling unknown filter operators.
|
||||
|
||||
Not intended to be used directly by end users, hence the square brackets around the name.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
@ -17,7 +19,7 @@ var fieldFilterOperatorFn = require("$:/core/modules/filters/field.js").field;
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.unknown = function(source,operator,options) {
|
||||
exports["[unknown]"] = function(source,operator,options) {
|
||||
var customDefinitionTitle = "[" + operator.operator + "[]]",
|
||||
customDefinition = options.widget && options.widget.getVariableInfo && options.widget.getVariableInfo(customDefinitionTitle);
|
||||
if(customDefinition && customDefinition.srcVariable && customDefinition.srcVariable.isFunctionDefinition) {
|
||||
|
Loading…
Reference in New Issue
Block a user