{"tiddlers":{"$:/config/flibbles/relink/attributes/$action-deletefield/$field":{"title":"$:/config/flibbles/relink/attributes/$action-deletefield/$field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$action-listops/$field":{"title":"$:/config/flibbles/relink/attributes/$action-listops/$field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$action-setfield/$field":{"title":"$:/config/flibbles/relink/attributes/$action-setfield/$field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$button/setField":{"title":"$:/config/flibbles/relink/attributes/$button/setField","text":"fieldname"},"$:/config/flibbles/relink/attributes/$checkbox/field":{"title":"$:/config/flibbles/relink/attributes/$checkbox/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$edit-text/field":{"title":"$:/config/flibbles/relink/attributes/$edit-text/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$edit/field":{"title":"$:/config/flibbles/relink/attributes/$edit/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$fields/exclude":{"title":"$:/config/flibbles/relink/attributes/$fields/exclude","text":"fieldnamelist"},"$:/config/flibbles/relink/attributes/$fields/include":{"title":"$:/config/flibbles/relink/attributes/$fields/include","text":"fieldnamelist"},"$:/config/flibbles/relink/attributes/$jsontiddler/exclude":{"title":"$:/config/flibbles/relink/attributes/$jsontiddler/exclude","text":"fieldnamelist"},"$:/config/flibbles/relink/attributes/$radio/field":{"title":"$:/config/flibbles/relink/attributes/$radio/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$range/field":{"title":"$:/config/flibbles/relink/attributes/$range/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$reveal/stateField":{"title":"$:/config/flibbles/relink/attributes/$reveal/stateField","text":"fieldname"},"$:/config/flibbles/relink/attributes/$select/field":{"title":"$:/config/flibbles/relink/attributes/$select/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$setvariable/field":{"title":"$:/config/flibbles/relink/attributes/$setvariable/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$set/field":{"title":"$:/config/flibbles/relink/attributes/$set/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$transclude/field":{"title":"$:/config/flibbles/relink/attributes/$transclude/field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$transclude/$field":{"title":"$:/config/flibbles/relink/attributes/$transclude/$field","text":"fieldname"},"$:/config/flibbles/relink/attributes/$view/field":{"title":"$:/config/flibbles/relink/attributes/$view/field","text":"fieldname"},"$:/config/flibbles/relink/fieldnames/blacklist":{"title":"$:/config/flibbles/relink/fieldnames/blacklist","filter":"[all[shadows+tiddlers]removeprefix[$:/language/Docs/Fields/]]","text":"This tiddler specifies what fields //Relink-fieldname// should refuse to change. Edit its `filter` field if you'd like to change that list.\n"},"$:/plugins/flibbles/relink-fieldnames/fieldtypes/fieldname.js":{"title":"$:/plugins/flibbles/relink-fieldnames/fieldtypes/fieldname.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/fieldtypes/fieldname.js\nmodule-type: relinkfieldtype\ntype: application/javascript\n\nThis field type behaves exactly like the \"title\" field type, except that\nit ignores any titles that appear on the field name blacklist.\n\n\\*/\n\nexports.name = 'fieldname';\n\nvar utils = require(\"../utils.js\");\n\nexports.report = function(value, callback, options) {\n\tif (!utils.isReserved(value, options)) {\n\t\tcallback(value, undefined, {soft: true});\n\t}\n};\n\nexports.relink = function(value, fromTitle, toTitle, options) {\n\tif (value === fromTitle\n\t&& !utils.isReserved(fromTitle, options)) {\n\t\tif (utils.isReserved(toTitle, options)\n\t\t|| !utils.isValidFieldName(toTitle)) {\n\t\t\treturn {impossible: true};\n\t\t} else {\n\t\t\treturn {output: toTitle};\n\t\t}\n\t}\n\treturn undefined;\n};\n","module-type":"relinkfieldtype","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/fieldtypes/fieldnamelist.js":{"title":"$:/plugins/flibbles/relink-fieldnames/fieldtypes/fieldnamelist.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/fieldtypes/fieldnamelist.js\nmodule-type: relinkfieldtype\ntype: application/javascript\n\nThis field type behaves exactly like the \"title\" field type, except that\nit ignores any titles that appear on the field name blacklist.\n\n\\*/\n\nexports.name = 'fieldnamelist';\n\nvar utils = require(\"../utils.js\");\nvar listModule = require(\"$:/plugins/flibbles/relink/js/fieldtypes/list.js\");\n\nexports.report = function(value, callback, options) {\n\tvar list = $tw.utils.parseStringArray(value);\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (!utils.isReserved(list[i], options)) {\n\t\t\tcallback(list[i], undefined, {soft: true});\n\t\t}\n\t}\n};\n\nexports.relink = function(value, fromTitle, toTitle, options) {\n\tvar entry;\n\tif (!utils.isReserved(fromTitle, options)) {\n\t\tentry = listModule.relink(value, fromTitle, toTitle, options);\n\t\tif (entry && entry.output && utils.isReserved(toTitle, options)) {\n\t\t\t// The list updated, but we can't actaully update to this new title\n\t\t\treturn {impossible: true};\n\t\t}\n\t}\n\treturn entry;\n};\n","module-type":"relinkfieldtype","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/filters/field.js":{"title":"$:/plugins/flibbles/relink-fieldnames/filters/field.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/filters/field.js\nmodule-type: relinkfilter\ntype: application/javascript\n\nHandles reporting/relinking of shorthand [[field:{field}[]] operators.\n\n\\*/\n\nvar utils = require(\"../utils.js\");\n\nexports.name = \"field\";\n\nexports.after = ['operators'];\n\nexports.report = function(filterParseTree, callback, options) {\n\tvar operators = options.wiki.getFilterOperators();\n\tfor (var i = 0; i < filterParseTree.length; i++) {\n\t\tvar run = filterParseTree[i];\n\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\tvar operator = run.operators[j];\n\t\t\tif (!operators[operator.operator]\n\t\t\t&& !utils.isReserved(operator.operator, options)) {\n\t\t\t\tcallback(operator.operator, \"[field:\" + utils.blurbOperands(operator) + \"]\", {soft: true});\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.relink = function(filterParseTree, fromTitle, toTitle, options) {\n\tvar output = {};\n\tif (!utils.isReserved(fromTitle, options)) {\n\t\tfor (var i = 0; i < filterParseTree.length; i++) {\n\t\t\tvar run = filterParseTree[i];\n\t\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\t\tvar operator = run.operators[j];\n\t\t\t\tif (operator.operator === fromTitle\n\t\t\t\t&& !options.wiki.getFilterOperators()[fromTitle]) {\n\t\t\t\t\tif (toTitle.search(/[\\[\\{<\\/]/) >= 0\n\t\t\t\t\t|| utils.isReserved(toTitle, options)) {\n\t\t\t\t\t\t// can't be an operator or a suffix. we must fail.\n\t\t\t\t\t\toutput.impossible = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (options.wiki.getFilterOperators()[toTitle]\n\t\t\t\t\t\t|| toTitle.indexOf(':') >= 0) {\n\t\t\t\t\t\t\t// It can't use the shorthand without causing problems\n\t\t\t\t\t\t\t// we use longhand field operator\n\t\t\t\t\t\t\toperator.operator = \"field\";\n\t\t\t\t\t\t\toperator.suffix = toTitle;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toperator.operator = toTitle;\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutput.changed = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn output;\n};\n","module-type":"relinkfilter","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/filters/search.js":{"title":"$:/plugins/flibbles/relink-fieldnames/filters/search.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/filters/search.js\nmodule-type: relinkfilter\ntype: application/javascript\n\nHandles reporting/relinking of the search operator, which is very complicated\n\n\\*/\n\nvar utils = require(\"../utils.js\");\n\nexports.name = \"search\";\n\nexports.report = function(filterParseTree, callback, options) {\n\tvar inverted = false;\n\teachSuffix(filterParseTree, function(title, rawEntry, operator, index) {\n\t\tif (index === 0 && rawEntry[0] === '-') {\n\t\t\tinverted = true;\n\t\t}\n\t\tif (!utils.isReserved(title, options)) {\n\t\t\tvar blurb = inverted? \"[search:-\": \"[search:\";\n\t\t\tif (operator.suffixes[1]) {\n\t\t\t\tblurb += ':' + operator.suffixes[1].join(',');\n\t\t\t}\n\t\t\tcallback(title, blurb + utils.blurbOperands(operator) + \"]\", {soft: true});\n\t\t}\n\t});\n};\n\nexports.relink = function(filterParseTree, fromTitle, toTitle, options) {\n\tvar output = {};\n\tif (!utils.isReserved(fromTitle, options)) {\n\t\teachSuffix(filterParseTree, function(title, rawEntry, operator, index) {\n\t\t\tif (title === fromTitle) {\n\t\t\t\tif (utils.isReserved(toTitle, options)\n\t\t\t\t|| toTitle.search(/[\\[\\{<\\/,:]/) >= 0\n\t\t\t\t|| (index == 0\n\t\t\t\t\t&& rawEntry[0] !== '-'\n\t\t\t\t\t&& (toTitle[0] === '-' || toTitle === '*'))) {\n\t\t\t\t\toutput.impossible = true;\n\t\t\t\t} else {\n\t\t\t\t\toutput.changed = true;\n\t\t\t\t\treturn toTitle;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn output;\n};\n\nfunction eachSuffix(filterParseTree, callback) {\n\tfor (var i = 0; i < filterParseTree.length; i++) {\n\t\tvar run = filterParseTree[i];\n\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\tvar operator = run.operators[j];\n\t\t\tvar opChanged = false;\n\t\t\tif (operator.operator === 'search' && operator.suffix) {\n\t\t\t\tvar list = operator.suffixes[0];\n\t\t\t\tfor (var index = 0; index < list.length; index++) {\n\t\t\t\t\tvar title = list[index];\n\t\t\t\t\tvar raw = title;\n\t\t\t\t\tif (index === 0) {\n\t\t\t\t\t\tif (title[0] === '-') {\n\t\t\t\t\t\t\ttitle = title.substr(1);\n\t\t\t\t\t\t} else if (title === '*') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar newValue = callback(title, raw, operator, index);\n\t\t\t\t\tif (newValue) {\n\t\t\t\t\t\tlist[index] = (index === 0 && raw[0] === '-') ?\n\t\t\t\t\t\t\t'-' + newValue:\n\t\t\t\t\t\t\tnewValue;\n\t\t\t\t\t\topChanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (opChanged) {\n\t\t\t\t// There was a change. reassemble the suffix\n\t\t\t\toperator.suffix = operator.suffixes.map(function(part) {\n\t\t\t\t\treturn part.join(',');\n\t\t\t\t}).join(':');\n\t\t\t}\n\t\t}\n\t}\n};\n","module-type":"relinkfilter","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/filters/suffixes.js":{"title":"$:/plugins/flibbles/relink-fieldnames/filters/suffixes.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/filters/suffixes.js\nmodule-type: relinkfilter\ntype: application/javascript\n\nHandles reporting/relinking of filter operator suffixes using a hidden whitelist.\n\n\\*/\n\nvar utils = require(\"../utils.js\");\n\nexports.name = \"suffixes\";\n\nexports.report = function(filterParseTree, callback, options) {\n\tfor (var i = 0; i < filterParseTree.length; i++) {\n\t\tvar run = filterParseTree[i];\n\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\tvar operator = run.operators[j];\n\t\t\tvar settings = options.settings.getConfig('suffixes')[operator.operator];\n\t\t\tif (settings) {\n\t\t\t\tsettings[1].report(operator.suffix, function(title, blurb, style) {\n\t\t\t\t\tcallback(title, '[' + operator.operator + ':' + (blurb || '') + utils.blurbOperands(operator) + ']', style);\n\t\t\t\t}, options);\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.relink = function(filterParseTree, fromTitle, toTitle, options) {\n\tvar output = {};\n\tfor (var i = 0; i < filterParseTree.length; i++) {\n\t\tvar run = filterParseTree[i];\n\t\tfor (var j = 0; j < run.operators.length; j++) {\n\t\t\tvar operator = run.operators[j];\n\t\t\tvar settings = options.settings.getConfig('suffixes')[operator.operator];\n\t\t\tvar operatorChanged = false;\n\t\t\tif (settings) {\n\t\t\t\tvar handler = settings[1];\n\t\t\t\tif (handler) {\n\t\t\t\t\tvar entry = handler.relink(operator.suffix, fromTitle, toTitle, options);\n\t\t\t\t\tif (entry) {\n\t\t\t\t\t\tif (entry.output) {\n\t\t\t\t\t\t\tif (entry.output.search(/[\\[\\{<\\/]/) < 0) {\n\t\t\t\t\t\t\t\toutput.changed = true;\n\t\t\t\t\t\t\t\toperatorChanged = true;\n\t\t\t\t\t\t\t\toperator.suffix = entry.output;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tentry.impossible = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (entry.impossible) {\n\t\t\t\t\t\t\toutput.impossible = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn output;\n};\n","module-type":"relinkfilter","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/htmlFields.js":{"title":"$:/plugins/flibbles/relink-fieldnames/htmlFields.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/htmlFields.js\nmodule-type: relinkhtml\ntype: application/javascript\n\nThis updates html attribute names which correspond to fields.\n\ne.g.\n\n<$action-createtiddler myfield=\"...\" />\n\n\\*/\n\nvar utils = require(\"./utils.js\");\n\nexports.name = \"fieldnames\";\n\nexports.report = function(element, parser, callback, options) {\n\tvar regexp = parser.context.getConfig(\"fieldattributes\")[element.tag];\n\tif (regexp) {\n\t\tfor (var attributeName in element.attributes) {\n\t\t\tvar results = regexp.exec(attributeName);\n\t\t\tif (results\n\t\t\t&& results[0] === attributeName\n\t\t\t&& !utils.isReserved(results[1], options)) {\n\t\t\t\tvar attr = element.attributes[attributeName];\n\t\t\t\tvar blurb;\n\t\t\t\tswitch (attr.type) { \n\t\t\t\tcase \"string\":\n\t\t\t\t\tblurb = '\"' + utils.abridgeString(attr.value, 33) + '\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"indirect\":\n\t\t\t\t\tblurb = \"{{\" + attr.textReference + \"}}\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"filtered\":\n\t\t\t\t\tblurb = \"{{{\" + utils.abridgeString(attr.filter, 33) + \"}}}\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"macro\":\n\t\t\t\t\t// Find the equals\n\t\t\t\t\tvar equals = parser.source.indexOf(\"=\", attr.start);\n\t\t\t\t\t// Now that the macrostart after that equals\n\t\t\t\t\tvar macroStart = parser.source.indexOf(\"<\", equals);\n\t\t\t\t\tblurb = \"<<\" + utils.abridgeString(parser.source.substring(macroStart+2, attr.end-2), 33) + \">>\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcallback(results[1], element.tag + ' =' + blurb, {soft: true});\n\t\t\t}\n\t\t}\n\t}\n};\n\nexports.relink = function(element, parser, fromTitle, toTitle, options) {\n\tvar entry = {};\n\tif (!utils.isReserved(fromTitle, options)) {\n\t\tvar regexp = parser.context.getConfig(\"fieldattributes\")[element.tag];\n\t\tif (regexp) {\n\t\t\tfor (var attributeName in element.attributes) {\n\t\t\t\tvar results = regexp.exec(attributeName);\n\t\t\t\tif (results\n\t\t\t\t&& results[0] === attributeName\n\t\t\t\t&& results[1] === fromTitle) {\n\t\t\t\t\tvar newName = alterAttributeName(attributeName, fromTitle, toTitle, regexp, options);\n\t\t\t\t\tif (newName === undefined) {\n\t\t\t\t\t\tentry.impossible = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.attributes[attributeName].name = newName;\n\t\t\t\t\t\tentry.output = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn entry;\n};\n\n// Returns undefined if it doesn't work out.\nfunction alterAttributeName(attributeName, fromTitle, toTitle, regexp, options) {\n\tif (!utils.isReserved(toTitle, options)) {\n\t\tvar newName = attributeName.replace(fromTitle, toTitle);\n\t\tvar match = regexp.exec(newName);\n\t\tif (match && match[0] === newName && match[1] === toTitle) {\n\t\t\t// Taken from parseutils.js\n\t\t\tvar reAttributeName = /([^\\/\\s>\"'=]+)/;\n\t\t\tmatch = reAttributeName.exec(newName);\n\t\t\tif (match && match[0] === newName) {\n\t\t\t\treturn newName;\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined;\n};\n","module-type":"relinkhtml","type":"application/javascript"},"$:/config/flibbles/relink/macros/keyboard-driven-input/firstSearchFilterField":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/firstSearchFilterField","text":"fieldname"},"$:/config/flibbles/relink/macros/keyboard-driven-input/secondSearchFilterField":{"title":"$:/config/flibbles/relink/macros/keyboard-driven-input/secondSearchFilterField","text":"fieldname"},"$:/config/flibbles/relink/macros/list-links-draggable/field":{"title":"$:/config/flibbles/relink/macros/list-links-draggable/field","text":"fieldname"},"$:/config/flibbles/relink/macros/tag-picker/tagField":{"title":"$:/config/flibbles/relink/macros/tag-picker/tagField","text":"fieldname"},"$:/config/flibbles/relink/macros/timeline/dateField":{"title":"$:/config/flibbles/relink/macros/timeline/dateField","text":"fieldname"},"$:/config/flibbles/relink/operators/each":{"title":"$:/config/flibbles/relink/operators/each","text":"fieldname"},"$:/config/flibbles/relink/operators/eachday":{"title":"$:/config/flibbles/relink/operators/eachday","text":"fieldname"},"$:/config/flibbles/relink/operators/fields":{"title":"$:/config/flibbles/relink/operators/fields","text":"fieldnamelist"},"$:/config/flibbles/relink/operators/get":{"title":"$:/config/flibbles/relink/operators/get","text":"fieldname"},"$:/config/flibbles/relink/operators/has":{"title":"$:/config/flibbles/relink/operators/has","text":"fieldname"},"$:/config/flibbles/relink/operators/listed":{"title":"$:/config/flibbles/relink/operators/listed","text":"fieldname"},"$:/config/flibbles/relink/operators/nsort":{"title":"$:/config/flibbles/relink/operators/nsort","text":"fieldname"},"$:/config/flibbles/relink/operators/nsortcs":{"title":"$:/config/flibbles/relink/operators/nsortcs","text":"fieldname"},"$:/config/flibbles/relink/operators/sort":{"title":"$:/config/flibbles/relink/operators/sort","text":"fieldname"},"$:/config/flibbles/relink/operators/sortan":{"title":"$:/config/flibbles/relink/operators/sortan","text":"fieldname"},"$:/config/flibbles/relink/operators/sortcs":{"title":"$:/config/flibbles/relink/operators/sortcs","text":"fieldname"},"$:/config/flibbles/relink/operators/has:field":{"title":"$:/config/flibbles/relink/operators/has:field","text":"fieldname"},"$:/plugins/flibbles/relink-fieldnames/readme":{"title":"$:/plugins/flibbles/relink-fieldnames/readme","text":"\\whitespace trim\n\nEnables Relink to relink field names associated with renamed tiddlers. The following fields cannot be interacted with in this way:\n\n<<<\n<$set name=blacklisted filter={{$:/config/flibbles/relink-fieldnames/blacklist!!filter}}>\n''<$list counter=counter filter=\"[enlist<blacklisted>sort[]]\">\n<<currentTiddler>><br>\n</$list>''\n</$set>\n<<<\n\nSee&#32;<a href={{$:/plugins/flibbles/relink-fieldnames!!source}} class=\"tc-tiddlylink-external\">the tw5-relink website</a>&#32;for more details and examples.\n"},"$:/plugins/flibbles/relink-fieldnames/reference.js":{"title":"$:/plugins/flibbles/relink-fieldnames/reference.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/reference.js\nmodule-type: relinkreference\ntype: application/javascript\n\nTakes care of renaming \n\\*/\n\nvar utils = require(\"./utils.js\");\n\nexports.name = 'fieldname';\n\nexports.report = function(reference, callback, options) {\n\tif (reference.field\n\t&& !utils.isReserved(reference.field, options)) {\n\t\tcallback(reference.field, (reference.title || '') + \"!!\", {soft: true});\n\t}\n};\n\nexports.relink = function(reference, fromTitle, toTitle, options) {\n\tif (reference.field === fromTitle\n\t&& !utils.isReserved(fromTitle, options)) {\n\t\tif (utils.isReserved(toTitle, options)) {\n\t\t\treturn {impossible: true};\n\t\t} else {\n\t\t\treference.field = toTitle;\n\t\t\treturn {output: reference};\n\t\t}\n\t}\n};\n","module-type":"relinkreference","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/reference":{"title":"$:/plugins/flibbles/relink-fieldnames/reference","caption":"Field Names","tags":"$:/tags/flibbles/relink/Configuration","list-after":"","text":"\\define label(arrow, setTo) <$reveal type=\"nomatch\" state=<<table-state>> text=\"$setTo$\" default=\"no\"><$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<table-state>> setTo=\"$setTo$\">{{$arrow$}} ''<$link to=<<field>>/>''</$button> <span class=\"tc-relink-fieldnames-count\">(<$text text={{{ [has<field>count[]] }}} />)</span></$reveal>\n\n\\define entry(field)\n<$set name=\"table-state\" value=<<qualify \"\"\"$:/state/flibbles/relink-fieldnames/table/$field$\"\"\">>>\n<tr class=\"tc-relink-fieldnames-field\">\n<td colspan=\"3\">\n<<label $:/core/images/right-arrow yes>>\n<<label $:/core/images/down-arrow no>>\n</td>\n</tr>\n<$list filter=\"[has<field>]\" >\n<$reveal tag=\"tr\" type=\"match\" state=<<table-state>> text=\"yes\" default=\"no\" class=\"tc-relink-fieldnames-entry\">\n<td class=\"tc-relink-fieldnames-margin\"></td>\n<td class=\"tc-relink-fieldnames-title\"><$link to=<<currentTiddler>> /></td><td><$text text={{{ [all[current]get<field>] }}} /></td>\n</$reveal>\n</$list>\n</$set>\n\\end\n\\whitespace trim\n\nThe following is a table of all tiddlers currently being used as field names.\n\n<$set name=blacklisted filter={{$:/config/flibbles/relink-fieldnames/blacklist!!filter}} >\n<table class=\"tc-relink-fieldnames-table\">\n<tbody>\n<$list variable=\"field\" filter=\"[fields[]is[tiddler]] -[enlist<blacklisted>]\">\n<$macrocall $name=\"entry\" field=<<field>> />\n</$list>\n</tbody>\n</table>\n</$set>\n"},"$:/plugins/flibbles/relink-fieldnames/relinkoperator.js":{"title":"$:/plugins/flibbles/relink-fieldnames/relinkoperator.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/relinkoperator.js\nmodule-type: relinkoperator\ntype: application/javascript\n\nUpdates the field names if they correspond to the renamed tiddler.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = 'field-names';\n\nexports.after = ['fields'];\n\nvar utils = require(\"./utils.js\");\n\nexports.report = function(tiddler, callback, options) {\n\tvar fields = tiddler.fields;\n\tfor (var field in fields) {\n\t\tif (!utils.isReserved(field, options)) {\n\t\t\tcallback(field, ': ' + utils.abridgeString(fields[field], 33), {soft: true});\n\t\t}\n\t}\n};\n\nexports.relink = function(tiddler, fromTitle, toTitle, changes, options) {\n\tif ($tw.utils.hop(tiddler.fields, fromTitle)\n\t&& !utils.isReserved(fromTitle, options)) {\n\t\tif ($tw.utils.hop(tiddler.fields, toTitle)\n\t\t|| utils.isReserved(toTitle, options)\n\t\t|| !utils.isValidFieldName(toTitle)) {\n\t\t\t// There is already a [toTitle] field, and we won't clobber it.\n\t\t\t// Or this is an illegal field name\n\t\t\tchanges[fromTitle] = {impossible: true};\n\t\t} else if ($tw.utils.hop(changes, fromTitle)) {\n\t\t\t// If the value changed, we need the changed value, assuming there\n\t\t\t// is one.\n\t\t\tchanges[toTitle] = {\n\t\t\t\toutput: changes[fromTitle].output || tiddler.fields[fromTitle]\n\t\t\t};\n\t\t\t// But we leave the original change in place in case it described\n\t\t\t// an impossible relink or something.\n\t\t\tchanges[fromTitle].output = null;\n\t\t} else {\n\t\t\tchanges[toTitle] = {output: tiddler.fields[fromTitle]};\n\t\t\tchanges[fromTitle] = {output: null};\n\t\t}\n\t}\n};\n","module-type":"relinkoperator","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/relinkprefix.js":{"title":"$:/plugins/flibbles/relink-fieldnames/relinkprefix.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/relinkprefix.js\nmodule-type: relinkprefix\ntype: application/javascript\n\nUpdates the whitelist entries for fields that are being renamed.\n\n\\*/\n\n\"use strict\";\n\nvar utils = require(\"./utils.js\");\n\nexports.prefix = \"$:/config/flibbles/relink/fields/\";\n\nexports.report = function(tiddler, callback, options) {\n\t// If this is a whitelist entry, report it.\n\tvar title = tiddler.fields.title.substr(exports.prefix.length);\n\tcallback(title, \"#relink \" + tiddler.fields.text, {soft: true});\n};\n\nexports.relink = function(tiddler, fromTitle, toTitle, changes, options) {\n\t// If this is a whitelist entry for the fromTitle field, update it.\n\tif (tiddler.fields.title.substr(exports.prefix.length) === fromTitle) {\n\t\tvar newTitle = exports.prefix + toTitle;\n\t\t// Make sure we wouldn't be deleting an existing whitelist entry.\n\t\tchanges.title = (!options.wiki.tiddlerExists(newTitle)) ?\n\t\t\t{ output: newTitle }:\n\t\t\t{ impossible: true };\n\t}\n};\n","module-type":"relinkprefix","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/setting/fieldnames.js":{"title":"$:/plugins/flibbles/relink-fieldnames/setting/fieldnames.js","text":"/*\\\n\ntitle: $:/plugins/flibbles/relink-fieldnames/setting/fieldnames.js\nmodule-type: relinksetting\ntype: application/javascript\n\nThe setting module interfaces with the relink settings to store\na configuration for the blacklist.\n\\*/\n\nexports.name = \"fieldnames\";\n\nexports.generate = function(settings, tiddler, key, wiki) {\n\tif (key === \"blacklist\") {\n\t\tvar tiddlers = wiki.filterTiddlers(tiddler.fields.filter);\n\t\tvar fieldMap = Object.create(null);\n\t\tfor (var i = 0; i < tiddlers.length; i++) {\n\t\t\tfieldMap[tiddlers[i]] = true;\n\t\t}\n\t\tsettings.blacklist = function(field) {\n\t\t\treturn fieldMap[field] || false;\n\t\t};\n\t}\n\t// else { I don't know what else there could be... }\n};\n","module-type":"relinksetting","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/setting/suffixes.js":{"title":"$:/plugins/flibbles/relink-fieldnames/setting/suffixes.js","text":"/*\\\n\ntitle: $:/plugins/flibbles/relink-fieldnames/setting/suffixes.js\nmodule-type: relinksetting\ntype: application/javascript\n\nThe setting module interfaces with the relink settings to store\nthe whitelist for all the operator suffixes\n\\*/\n\nvar utils = require('$:/plugins/flibbles/relink/js/utils');\n\nexports.name = \"suffixes\";\n\nexports.generate = function(suffixes, tiddler, key) {\n\tvar data = utils.getType(tiddler.fields.text.trim());\n\tif (data) {\n\t\tdata.source = tiddler.fields.title;\n\t\t// Secret feature. You can access a config tiddler's\n\t\t// fields from inside the fieldtype handler. Cool\n\t\t// tricks can be done with this.\n\t\tdata.fields = tiddler.fields;\n\t\tvar pair = key.split('/');\n\t\tvar name = pair[0];\n\t\tdata.key = key;\n\t\tsuffixes[name] = suffixes[name] || Object.create(null);\n\t\tsuffixes[name][pair[1] || 1] = data;\n\t}\n};\n","module-type":"relinksetting","type":"application/javascript"},"$:/plugins/flibbles/relink-fieldnames/style":{"title":"$:/plugins/flibbles/relink-fieldnames/style","tags":"$:/tags/Stylesheet","text":".tc-relink-fieldnames-table {\n\twidth: 100%;\n\tborder: 0px;\n}\n\n.tc-relink-fieldnames-field a {\n\tfont-weight: bold;\n}\n\n.tc-relink-fieldnames-field td {\n\tborder: 0px;\n}\n\n.tc-relink-fieldnames-count {\n\tcolor: lightgray;\n}\n\n.tc-relink-fieldnames-title {\n\tmargin-left: 3pt;\n\tmin-width: 30%;\n}\n\n.tc-relink-fieldnames-entry td {\n\tborder: 0px;\n\tborder-bottom: 1px solid <<colour table-border>>;\n}\n\n.tc-relink-fieldnames-margin {\n\twidth: 25pt;\n}\n"},"$:/config/flibbles/relink/suffixes/contains":{"title":"$:/config/flibbles/relink/suffixes/contains","text":"fieldname"},"$:/config/flibbles/relink/suffixes/days":{"title":"$:/config/flibbles/relink/suffixes/days","text":"fieldname"},"$:/config/flibbles/relink/suffixes/field":{"title":"$:/config/flibbles/relink/suffixes/field","text":"fieldname"},"$:/config/flibbles/relink/suffixes/regexp":{"title":"$:/config/flibbles/relink/suffixes/regexp","text":"fieldname"},"$:/plugins/flibbles/relink-fieldnames/utils.js":{"title":"$:/plugins/flibbles/relink-fieldnames/utils.js","text":"/*\\\ntitle: $:/plugins/flibbles/relink-fieldnames/utils.js\nmodule-type: library\ntype: application/javascript\n\n\\*/\n\nvar blacklistTiddler = \"$:/config/flibbles/relink/fieldnames/blacklist\";\nvar docPrefix = \"$:/language/Docs/Fields/\";\n\nvar whitelist = require('$:/plugins/flibbles/relink/js/utils.js').getContext('whitelist');\n\nvar utils = require(\"$:/plugins/flibbles/relink/js/utils.js\");\nexports = module.exports = Object.create(utils);\n\nwhitelist.hotDirectories.push(docPrefix);\n\nexports.isReserved = function(field, options) {\n\tvar method = options.settings.getConfig(\"fieldnames\").blacklist || function() { return true; };\n\treturn method(field);\n};\n\n// Pre v5.2.0, this will be false. But we can't rely on utils.isValidFieldName\n// entirely, because it is forgiving about capitalization when we can't be.\nvar capitalizationAllowed = $tw.utils.isValidFieldName(\"A:\");\n\nexports.isValidFieldName = function(field) {\n\treturn $tw.utils.isValidFieldName(field)\n\t\t&& (capitalizationAllowed || !/[A-Z]/.test(field));\n};\n\nexports.blurbOperands = function(operator) {\n\tvar string = ''\n\tfor (var index = 0; index < operator.operands.length; index++) {\n\t\tif (index > 0) {\n\t\t\tstring += ',';\n\t\t}\n\t\tvar operand = operator.operands[index];\n\t\tif (operand.indirect) {\n\t\t\tstring += '{' + exports.abridgeString(operand.text, 33) + '}';\n\t\t} else if (operand.variable) {\n\t\t\tstring += '<' + exports.abridgeString(operand.text, 33) + '>';\n\t\t} else {\n\t\t\tstring += '[' + exports.abridgeString(operand.text, 33) + ']';\n\t\t}\n\t}\n\treturn string;\n};\n","module-type":"library","type":"application/javascript"}}}