From 495d5f258fe043ac445395db575b89c98871a677 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sun, 18 Jan 2015 22:39:24 +0100 Subject: [PATCH 1/7] place topbars first in pagelayout --- core/ui/PageTemplate/topleftbar.tid | 1 + core/ui/PageTemplate/toprightbar.tid | 1 + 2 files changed, 2 insertions(+) diff --git a/core/ui/PageTemplate/topleftbar.tid b/core/ui/PageTemplate/topleftbar.tid index 609c03a20..5910a5e5a 100644 --- a/core/ui/PageTemplate/topleftbar.tid +++ b/core/ui/PageTemplate/topleftbar.tid @@ -1,5 +1,6 @@ title: $:/core/ui/PageTemplate/topleftbar tags: $:/tags/PageTemplate +list-before: diff --git a/core/ui/PageTemplate/toprightbar.tid b/core/ui/PageTemplate/toprightbar.tid index 427006a52..f835e2eea 100644 --- a/core/ui/PageTemplate/toprightbar.tid +++ b/core/ui/PageTemplate/toprightbar.tid @@ -1,5 +1,6 @@ title: $:/core/ui/PageTemplate/toprightbar tags: $:/tags/PageTemplate +list-before: From e6d204db0f831c751be4928c731c5a5ab11131ec Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Tue, 27 Jan 2015 15:44:55 +0000 Subject: [PATCH 2/7] Adjust documentation following pull #1378 --- editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid | 4 ++-- editions/tw5.com/tiddlers/howtos/Tagging.tid | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid b/editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid index 1a7bb55e9..a324f3bad 100644 --- a/editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid +++ b/editions/tw5.com/tiddlers/concepts/OrderOfTaggedTiddlers.tid @@ -1,5 +1,5 @@ created: 20150124125646000 -modified: 20150124202917000 +modified: 20150127154154000 tags: Concepts title: Order of Tagged Tiddlers @@ -12,4 +12,4 @@ When ~TiddlyWiki generates a list of the tiddlers that have a particular tag (e. # In each remaining tiddler <<.place T>>, look for a <<.field list-after>> field. If this has a tiddler title as its value, place tiddler <<.place T>> just <<.em after>> that one. -# If any tiddlers still remain, place them at the end of the list. +# If any tiddlers still remain, place them at the end of the list in ascending alphabetical order of title. The difference between capital and lowercase letters is ignored. diff --git a/editions/tw5.com/tiddlers/howtos/Tagging.tid b/editions/tw5.com/tiddlers/howtos/Tagging.tid index cfcf93f7b..a0ac4c21a 100644 --- a/editions/tw5.com/tiddlers/howtos/Tagging.tid +++ b/editions/tw5.com/tiddlers/howtos/Tagging.tid @@ -1,5 +1,5 @@ created: 20140904075400000 -modified: 20150124202936000 +modified: 20150127154219000 tags: [[Working with TiddlyWiki]] Concepts title: Tagging type: text/vnd.tiddlywiki @@ -33,7 +33,7 @@ You can use the [[tag manager|$:/TagManager]], found on the ''Tags'' tab under ' ! Change the order in which tags are listed -By default, tagged tiddlers are listed in the order they were added to the wiki. The <<.olink sort>> operator can change the order to alphabetical. +By default, tagged tiddlers are listed in alphabetical order. If you want any other order, add a <<.flink ListField>> field to the tag tiddler, and set its value to be a [[list of the tiddlers|Title List]] in that order. From b40da093af0f2001fd9edc0ad84b687d5d7ed5b4 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Tue, 27 Jan 2015 18:20:03 +0100 Subject: [PATCH 3/7] added tests to tagging for changes in #1378 using a single test-filters.js is (becoming) a pain... I'd rather have a single test file per filter / module / function --- editions/test/tiddlers/tests/test-filters.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/editions/test/tiddlers/tests/test-filters.js b/editions/test/tiddlers/tests/test-filters.js index d27fc0ab0..c997aace2 100644 --- a/editions/test/tiddlers/tests/test-filters.js +++ b/editions/test/tiddlers/tests/test-filters.js @@ -33,13 +33,13 @@ describe("Filter tests", function() { tiddler: new $tw.Tiddler({title: "TiddlerSeventh", text: "", list: "TiddlerOne [[Tiddler Three]] [[a fourth tiddler]] MissingTiddler", - tags: [] + tags: ["one"] }), }, "Tiddler8": { tiddler: new $tw.Tiddler({title: "Tiddler8", text: "Tidd", - tags: [], + tags: ["one"], "test-field": "JoeBloggs" }) } @@ -162,11 +162,11 @@ describe("Filter tests", function() { }); it("should handle the tagging operator", function() { - expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne"); - expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne"); + expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,Tiddler8,TiddlerOne,TiddlerSeventh"); + expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh"); expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three"); var fakeWidget = {getVariable: function() {return "one";}}; - expect(wiki.filterTiddlers("[all[current]tagging[]sort[title]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne"); + expect(wiki.filterTiddlers("[all[current]tagging[]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh"); }); it("should handle the untagged operator", function() { From d536030c5dbd256cd4557cc50a663e883d380b16 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Tue, 27 Jan 2015 20:38:30 +0000 Subject: [PATCH 4/7] Adjust documentation following pull #1422 --- editions/tw5.com/tiddlers/filters/each.tid | 14 ++++++++++---- editions/tw5.com/tiddlers/filters/eachday.tid | 4 ++-- .../tw5.com/tiddlers/system/operator-macros.tid | 8 ++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/editions/tw5.com/tiddlers/filters/each.tid b/editions/tw5.com/tiddlers/filters/each.tid index 4f381fc20..04c3e02f8 100644 --- a/editions/tw5.com/tiddlers/filters/each.tid +++ b/editions/tw5.com/tiddlers/filters/each.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150124164957000 +modified: 20150127202915000 tags: [[Filter Operators]] [[Group Operators]] title: each Operator type: text/vnd.tiddlywiki @@ -8,13 +8,19 @@ purpose: select one of each group of input titles by field <$macrocall $name=".operator-def" input="a [[selection of titles|Title Selection]]" -parameter="the name of a [[field|TiddlerFields]]" +suffix="optionally, `list`" +parameter="the name of a [[field|TiddlerFields]], defaulting to <<.field title>>" paramName="f" output="a selection containing the first input title encountered for each distinct value of field <<.place f>>" /> -Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as the value has not been encountered before, the title is appended to the output set. +Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined. -If a tiddler doesn't contain field <<.place f>>, or contains it but with an empty value, then it contributes nothing to the output. +;each +:As long as the field's value has not been encountered before, the title is appended to the output. +;each:list +:The value is treated as a [[title list|Title List]]. Each title in the list considered in turn. If it has not been encountered before, it is appended to the output. + +If a tiddler doesn't contain field <<.place f>>, it is treated as if the field's value was empty. <<.operator-examples "each">> diff --git a/editions/tw5.com/tiddlers/filters/eachday.tid b/editions/tw5.com/tiddlers/filters/eachday.tid index d8c8ff20a..07f459761 100644 --- a/editions/tw5.com/tiddlers/filters/eachday.tid +++ b/editions/tw5.com/tiddlers/filters/eachday.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150124214554000 +modified: 20150127202806000 tags: [[Filter Operators]] [[Group Operators]] [[Date Operators]] title: eachday Operator type: text/vnd.tiddlywiki @@ -13,7 +13,7 @@ paramName="f" output="a selection containing the first input title encountered for each distinct value (ignoring times of day) of field <<.place f>>" /> -Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as this indicates a date that has not been encountered before, the title is appended to the output set. +Each input title is processed in turn. The value of field <<.place f>> in the corresponding tiddler is examined, and as long as this indicates a date that has not been encountered before, the title is appended to the output. If a tiddler doesn't contain field <<.place f>>, it contributes nothing to the output. diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index b56c48cd3..631c15f10 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -1,8 +1,12 @@ created: 20150117152607000 -modified: 20150126144131000 +modified: 20150127203427000 title: $:/editions/tw5.com/operator-macros tags: $:/tags/Macro +\define .operator-suffix-name(suffixName) +<$macrocall $name=".if" cond="""$suffixName$""" then="<<.place '$suffixName$'>> = " else=""/> +\end + \define .operator-def(input,negationInput,suffix,suffixName,parameter,paramName,output,negationOutput) @@ -11,7 +15,7 @@ tags: $:/tags/Macro then="""""" else=""/> <$macrocall $name=".if" cond="""$suffix$""" -then="""""" +then="""""" else=""/> From 7ec42f93ec2bc7336506c949bb45cf359d3dff05 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Wed, 28 Jan 2015 01:13:29 +0100 Subject: [PATCH 5/7] updated $:/tags/PageTemplate reverted topleftbar & toprightbar --- core/ui/PageTemplate/topleftbar.tid | 1 - core/ui/PageTemplate/toprightbar.tid | 1 - core/wiki/tags/PageTemplate.tid | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/ui/PageTemplate/topleftbar.tid b/core/ui/PageTemplate/topleftbar.tid index 5910a5e5a..609c03a20 100644 --- a/core/ui/PageTemplate/topleftbar.tid +++ b/core/ui/PageTemplate/topleftbar.tid @@ -1,6 +1,5 @@ title: $:/core/ui/PageTemplate/topleftbar tags: $:/tags/PageTemplate -list-before: diff --git a/core/ui/PageTemplate/toprightbar.tid b/core/ui/PageTemplate/toprightbar.tid index f835e2eea..427006a52 100644 --- a/core/ui/PageTemplate/toprightbar.tid +++ b/core/ui/PageTemplate/toprightbar.tid @@ -1,6 +1,5 @@ title: $:/core/ui/PageTemplate/toprightbar tags: $:/tags/PageTemplate -list-before: diff --git a/core/wiki/tags/PageTemplate.tid b/core/wiki/tags/PageTemplate.tid index 8c2df9428..242530be2 100644 --- a/core/wiki/tags/PageTemplate.tid +++ b/core/wiki/tags/PageTemplate.tid @@ -1,3 +1,3 @@ title: $:/tags/PageTemplate -list: [[$:/core/ui/PageTemplate/sidebar]] [[$:/core/ui/PageTemplate/story]] [[$:/core/ui/PageTemplate/alerts]] [[$:/core/ui/PageTemplate/topleftbar]] [[$:/core/ui/PageTemplate/toprightbar]] +list: [[$:/core/ui/PageTemplate/topleftbar]] [[$:/core/ui/PageTemplate/toprightbar]] [[$:/core/ui/PageTemplate/sidebar]] [[$:/core/ui/PageTemplate/story]] [[$:/core/ui/PageTemplate/alerts]] From 99f24eefa432658cf2b1a8171934d1193f6d2679 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 28 Jan 2015 11:42:12 +0000 Subject: [PATCH 6/7] Move if macro to macros directory --- editions/tw5.com/tiddlers/{system => macros}/if-macro.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename editions/tw5.com/tiddlers/{system => macros}/if-macro.js (100%) diff --git a/editions/tw5.com/tiddlers/system/if-macro.js b/editions/tw5.com/tiddlers/macros/if-macro.js similarity index 100% rename from editions/tw5.com/tiddlers/system/if-macro.js rename to editions/tw5.com/tiddlers/macros/if-macro.js From 050b643948e24d1d93a83766a23a0d693616d01e Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 28 Jan 2015 13:50:39 +0000 Subject: [PATCH 7/7] Sandbox HTML iframes Otherwise Firefox allows code in html tiddlers to access the main window: https://groups.google.com/d/topic/tiddlywiki/NwOI-QER2ig/discussion --- core/modules/parsers/htmlparser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/parsers/htmlparser.js b/core/modules/parsers/htmlparser.js index 4a47c6520..b2528e961 100644 --- a/core/modules/parsers/htmlparser.js +++ b/core/modules/parsers/htmlparser.js @@ -23,7 +23,8 @@ var HtmlParser = function(type,text,options) { type: "element", tag: "iframe", attributes: { - src: {type: "string", value: src} + src: {type: "string", value: src}, + sandbox: {type: "string", value: "sandbox"} } }]; };
purpose{{!!purpose}}
`!` input$negationInput$
[[suffix|Filter Step]]<<.place "$suffixName$">> = $suffix$
[[suffix|Filter Step]]<<.operator-suffix-name "$suffixName$">>$suffix$
[[parameter|Filter Parameter]]<$macrocall $name=".if" cond="""$paramName$""" then="<<.place '$paramName$'>> = " else=""/>$parameter$
output$output$