From c460cc03a49be2c41157814f5a1fc25c4bc3fe41 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 13:42:06 +0000 Subject: [PATCH 01/10] Change "is" filter with blank operand to pass through arguments --- core/modules/filters/is.js | 17 +++++++++++++---- editions/tw5.com/tiddlers/filters/is.tid | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/modules/filters/is.js b/core/modules/filters/is.js index 0db243044..514443a62 100644 --- a/core/modules/filters/is.js +++ b/core/modules/filters/is.js @@ -28,11 +28,20 @@ Export our filter function exports.is = function(source,operator,options) { // Dispatch to the correct isfilteroperator var isFilterOperators = getIsFilterOperators(); - var isFilterOperator = isFilterOperators[operator.operand]; - if(isFilterOperator) { - return isFilterOperator(source,operator.prefix,options); + if(operator.operand) { + var isFilterOperator = isFilterOperators[operator.operand]; + if(isFilterOperator) { + return isFilterOperator(source,operator.prefix,options); + } else { + return [$tw.language.getString("Error/IsFilterOperator")]; + } } else { - return [$tw.language.getString("Error/IsFilterOperator")]; + // Return all tiddlers if the operand is missing + var results = []; + source(function(tiddler,title) { + results.push(title); + }); + return results; } }; diff --git a/editions/tw5.com/tiddlers/filters/is.tid b/editions/tw5.com/tiddlers/filters/is.tid index c274e3a86..113af22c8 100644 --- a/editions/tw5.com/tiddlers/filters/is.tid +++ b/editions/tw5.com/tiddlers/filters/is.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150220161001000 +modified: 20161127142329969 tags: [[Filter Operators]] [[Common Operators]] [[Negatable Operators]] title: is Operator type: text/vnd.tiddlywiki @@ -23,7 +23,7 @@ The parameter <<.place C>> is one of the following fundamental categories: |^`tag` |is in use as a tag | |^`tiddler` |exists as a non-shadow tiddler | -If <<.place C>> is anything else, the output is an error message. +If <<.place C>> is anything else an error message is returned. <<.from-version "5.1.14"> if <<.place C>> is blank, the output is passed through unchanged (in earlier versions an error message was returned). `!is[tiddler]` is a synonym for `is[missing]`, and vice versa. From c65d08240b1f69078c8b3129cb9b00df56ada1d3 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 13:42:30 +0000 Subject: [PATCH 02/10] Add strict mode to tag operator --- core/modules/filters/tag.js | 31 +++++++++++++++-------- editions/tw5.com/tiddlers/filters/tag.tid | 23 ++++++++++------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/core/modules/filters/tag.js b/core/modules/filters/tag.js index 408d7f98f..a421c61d7 100644 --- a/core/modules/filters/tag.js +++ b/core/modules/filters/tag.js @@ -17,19 +17,30 @@ Export our filter function */ exports.tag = function(source,operator,options) { var results = []; - if(operator.prefix === "!") { + if((operator.suffix || "").toLowerCase() === "strict" && !operator.operand) { + // New semantics: + // Always return copy of input if operator.operand is missing source(function(tiddler,title) { - if(tiddler && !tiddler.hasTag(operator.operand)) { - results.push(title); - } + results.push(title); }); } else { - source(function(tiddler,title) { - if(tiddler && tiddler.hasTag(operator.operand)) { - results.push(title); - } - }); - results = options.wiki.sortByList(results,operator.operand); + // Old semantics: + if(operator.prefix === "!") { + // Returns a copy of the input if operator.operand is missing + source(function(tiddler,title) { + if(tiddler && !tiddler.hasTag(operator.operand)) { + results.push(title); + } + }); + } else { + // Returns empty results if operator.operand is missing + source(function(tiddler,title) { + if(tiddler && tiddler.hasTag(operator.operand)) { + results.push(title); + } + }); + results = options.wiki.sortByList(results,operator.operand); + } } return results; }; diff --git a/editions/tw5.com/tiddlers/filters/tag.tid b/editions/tw5.com/tiddlers/filters/tag.tid index 995cae7b1..929464b15 100644 --- a/editions/tw5.com/tiddlers/filters/tag.tid +++ b/editions/tw5.com/tiddlers/filters/tag.tid @@ -1,18 +1,23 @@ +caption: tag created: 20140410103123179 -modified: 20150203191853000 +modified: 20161126122900712 +op-input: a [[selection of titles|Title Selection]] +op-neg-output: those input tiddlers that do <<.em not>> have tag <<.place T>> +op-output: those input tiddlers that have tag <<.place T>> +op-parameter: the title of a [[tag|Tagging]] +op-parameter-name: T +op-purpose: filter the input by tag +op-suffix: <<.from-version "5.1.14">> optional `strict` flag +op-suffix-name: S tags: [[Filter Operators]] [[Common Operators]] [[Tag Operators]] [[Negatable Operators]] title: tag Operator type: text/vnd.tiddlywiki -caption: tag -op-purpose: filter the input by tag -op-input: a [[selection of titles|Title Selection]] -op-parameter: the title of a [[tag|Tagging]] -op-parameter-name: T -op-output: those input tiddlers that have tag <<.place T>> -op-neg-output: those input tiddlers that do <<.em not>> have tag <<.place T>> The output is [[sorted|Order of Tagged Tiddlers]] using the tag's <<.field list>> field and the tiddlers' <<.field list-before>> and <<.field list-after>> fields. -If <<.place T>> is empty, the output of `tag` is empty, and the output of `!tag` is a copy of the input. +The behaviour when <<.place T>> is empty depends on the settings of the <<.place S>> optional suffix: + +* if <<.place T>> is missing and <<.place S>> is either missing or set to "loose", then the output of `tag` is empty, and the output of `!tag` is a copy of the input. +* <<.from-version "5.1.14">> if <<.place T>> is missing and <<.place S>> is set to "strict", then the output of both `tag` and `!tag` is a copy of the input <<.operator-examples "tag">> From b759d82f4ce2bf44da0bcce0c08550870f3216f8 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 13:43:43 +0000 Subject: [PATCH 03/10] @pmario's fix for #2635 This got reverted due to my git inabilities --- core/modules/utils/utils.js | 3 +-- editions/test/tiddlers/tests/test-utils.js | 27 ---------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 101f202cf..94c08f329 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -358,8 +358,7 @@ exports.getWeek = function(date) { d = 7; // JavaScript Sun=0, ISO Sun=7 } dt.setTime(dt.getTime() + (4 - d) * 86400000);// shift day to Thurs of same week to calculate weekNo - var x = new Date(dt.getFullYear(),0,1); - var n = Math.floor((dt.getTime() - x.getTime()) / 86400000); + var n = Math.floor((dt.getTime()-new Date(dt.getFullYear(),0,1) + 3600000) / 86400000); return Math.floor(n / 7) + 1; }; diff --git a/editions/test/tiddlers/tests/test-utils.js b/editions/test/tiddlers/tests/test-utils.js index fd924e1bf..2aa3ea665 100644 --- a/editions/test/tiddlers/tests/test-utils.js +++ b/editions/test/tiddlers/tests/test-utils.js @@ -27,38 +27,11 @@ describe("Utility tests", function() { it("should handle formatting a date string", function() { var fds = $tw.utils.formatDateString, - // nov is month: 10! d = new Date(2014,10,9,17,41,28,542); expect(fds(d,"DDD DD MMM YYYY")).toBe("Sunday 9 November 2014"); expect(fds(d,"ddd hh mm ssss")).toBe("Sun 17 41 2828"); expect(fds(d,"MM0DD")).toBe("1109"); expect(fds(d,"MM0\\D\\D")).toBe("110DD"); - - // test some edge cases found at: https://en.wikipedia.org/wiki/ISO_week_date - // 2016-11-13 is Week 45 and it's a Sunday (month nr: 10) - d = new Date(2016,10,12,23,59,59); - expect(fds(d,"WW")).toBe("45"); - d = new Date(2016,10,13,23,59,59,999); - expect(fds(d,"WW")).toBe("45"); - d = new Date(2016,10,13,23,59,60); // see 60 seconds. so it's week 46 - expect(fds(d,"WW")).toBe("46"); - - // 2006 Dez. 31 is end of week 52 (month nr: 11) - d = new Date(2006,11,31,23,59,59); - expect(fds(d,"WW")).toBe("52"); - d = new Date(2006,11,31,23,59,60); - expect(fds(d,"WW")).toBe("1"); - - // 2010 Jan 03 is in week 53 (month nr: 0) - d = new Date(2010,0,3,23,59,59); - expect(fds(d,"WW")).toBe("53"); - d = new Date(2010,0,3,23,59,60); - expect(fds(d,"WW")).toBe("1"); - - // 2014 12 29 is in week 1 of 2015 (month nr. 11) - d = new Date(2014,11,29,23,59,59); - expect(fds(d,"WW")).toBe("1"); - expect(fds(d,"wYYYY")).toBe("2015"); }); it("should parse text references", function() { From cf28eeb2a120fe3f263235c35fe5603013f88049 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 13:45:41 +0000 Subject: [PATCH 04/10] Fix problem with checkbox widget and empty strings If the value of `tiddler.fields[this.checkboxField]` was an empty string then it would incorrectly fall back to the value of `this.checkboxDefault`. --- core/modules/widgets/checkbox.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index 2480ff319..6c1d64feb 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -65,7 +65,12 @@ CheckboxWidget.prototype.getValue = function() { } } if(this.checkboxField) { - var value = tiddler.fields[this.checkboxField] || this.checkboxDefault || ""; + var value; + if($tw.utils.hop(tiddler.fields,this.checkboxField)) { + value = tiddler.fields[this.checkboxField] || ""; + } else { + value = this.checkboxDefault || ""; + } if(value === this.checkboxChecked) { return true; } From c02c3a06e09baaa7746a26dffebb97ef8ec1ff6e Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 14:01:09 +0000 Subject: [PATCH 05/10] Sort the edit content type dropdown groups more sensibly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now we put the developer stuff at the bottom instead of the top… --- core/language/en-GB/Types/application_javascript.tid | 1 + core/language/en-GB/Types/application_json.tid | 1 + core/language/en-GB/Types/application_x_tiddler_dictionary.tid | 1 + core/language/en-GB/Types/image_gif.tid | 1 + core/language/en-GB/Types/image_jpeg.tid | 1 + core/language/en-GB/Types/image_png.tid | 1 + core/language/en-GB/Types/image_svg_xml.tid | 1 + core/language/en-GB/Types/image_x-icon.tid | 1 + core/language/en-GB/Types/text_css.tid | 1 + core/language/en-GB/Types/text_html.tid | 1 + core/language/en-GB/Types/text_plain.tid | 1 + core/language/en-GB/Types/text_vnd.tiddlywiki.tid | 1 + core/language/en-GB/Types/text_x-tiddlywiki.tid | 1 + core/ui/EditTemplate/type.tid | 2 +- 14 files changed, 14 insertions(+), 1 deletion(-) diff --git a/core/language/en-GB/Types/application_javascript.tid b/core/language/en-GB/Types/application_javascript.tid index fda69c6e1..28ee6ddbf 100644 --- a/core/language/en-GB/Types/application_javascript.tid +++ b/core/language/en-GB/Types/application_javascript.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/application/javascript description: JavaScript code name: application/javascript group: Developer +group-sort: 2 diff --git a/core/language/en-GB/Types/application_json.tid b/core/language/en-GB/Types/application_json.tid index 27b129821..7f7575599 100644 --- a/core/language/en-GB/Types/application_json.tid +++ b/core/language/en-GB/Types/application_json.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/application/json description: JSON data name: application/json group: Developer +group-sort: 2 diff --git a/core/language/en-GB/Types/application_x_tiddler_dictionary.tid b/core/language/en-GB/Types/application_x_tiddler_dictionary.tid index 13ab6943e..76fbec0a3 100644 --- a/core/language/en-GB/Types/application_x_tiddler_dictionary.tid +++ b/core/language/en-GB/Types/application_x_tiddler_dictionary.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/application/x-tiddler-dictionary description: Data dictionary name: application/x-tiddler-dictionary group: Developer +group-sort: 2 diff --git a/core/language/en-GB/Types/image_gif.tid b/core/language/en-GB/Types/image_gif.tid index bca7d7d28..559d17f56 100644 --- a/core/language/en-GB/Types/image_gif.tid +++ b/core/language/en-GB/Types/image_gif.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/image/gif description: GIF image name: image/gif group: Image +group-sort: 1 diff --git a/core/language/en-GB/Types/image_jpeg.tid b/core/language/en-GB/Types/image_jpeg.tid index 943f19341..5db4dc001 100644 --- a/core/language/en-GB/Types/image_jpeg.tid +++ b/core/language/en-GB/Types/image_jpeg.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/image/jpeg description: JPEG image name: image/jpeg group: Image +group-sort: 1 diff --git a/core/language/en-GB/Types/image_png.tid b/core/language/en-GB/Types/image_png.tid index 59fb3f865..d9e78bf0e 100644 --- a/core/language/en-GB/Types/image_png.tid +++ b/core/language/en-GB/Types/image_png.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/image/png description: PNG image name: image/png group: Image +group-sort: 1 diff --git a/core/language/en-GB/Types/image_svg_xml.tid b/core/language/en-GB/Types/image_svg_xml.tid index ddb6912dd..9f7c23ba3 100644 --- a/core/language/en-GB/Types/image_svg_xml.tid +++ b/core/language/en-GB/Types/image_svg_xml.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/image/svg+xml description: Structured Vector Graphics image name: image/svg+xml group: Image +group-sort: 1 diff --git a/core/language/en-GB/Types/image_x-icon.tid b/core/language/en-GB/Types/image_x-icon.tid index ff8d12f81..6ae32331c 100644 --- a/core/language/en-GB/Types/image_x-icon.tid +++ b/core/language/en-GB/Types/image_x-icon.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/image/x-icon description: ICO format icon file name: image/x-icon group: Image +group-sort: 1 diff --git a/core/language/en-GB/Types/text_css.tid b/core/language/en-GB/Types/text_css.tid index 15785f0a0..9539e21d0 100644 --- a/core/language/en-GB/Types/text_css.tid +++ b/core/language/en-GB/Types/text_css.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/text/css description: Static stylesheet name: text/css group: Developer +group-sort: 2 diff --git a/core/language/en-GB/Types/text_html.tid b/core/language/en-GB/Types/text_html.tid index cd8d8221e..260f3a30b 100644 --- a/core/language/en-GB/Types/text_html.tid +++ b/core/language/en-GB/Types/text_html.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/text/html description: HTML markup name: text/html group: Text +group-sort: 0 diff --git a/core/language/en-GB/Types/text_plain.tid b/core/language/en-GB/Types/text_plain.tid index 83da10bc8..1511e07ff 100644 --- a/core/language/en-GB/Types/text_plain.tid +++ b/core/language/en-GB/Types/text_plain.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/text/plain description: Plain text name: text/plain group: Text +group-sort: 0 diff --git a/core/language/en-GB/Types/text_vnd.tiddlywiki.tid b/core/language/en-GB/Types/text_vnd.tiddlywiki.tid index e946d9a4a..9546e1aed 100644 --- a/core/language/en-GB/Types/text_vnd.tiddlywiki.tid +++ b/core/language/en-GB/Types/text_vnd.tiddlywiki.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/text/vnd.tiddlywiki description: TiddlyWiki 5 name: text/vnd.tiddlywiki group: Text +group-sort: 0 diff --git a/core/language/en-GB/Types/text_x-tiddlywiki.tid b/core/language/en-GB/Types/text_x-tiddlywiki.tid index e593430ee..e9c6c7097 100644 --- a/core/language/en-GB/Types/text_x-tiddlywiki.tid +++ b/core/language/en-GB/Types/text_x-tiddlywiki.tid @@ -2,3 +2,4 @@ title: $:/language/Docs/Types/text/x-tiddlywiki description: TiddlyWiki Classic name: text/x-tiddlywiki group: Text +group-sort: 0 diff --git a/core/ui/EditTemplate/type.tid b/core/ui/EditTemplate/type.tid index a357972b4..be57f7264 100644 --- a/core/ui/EditTemplate/type.tid +++ b/core/ui/EditTemplate/type.tid @@ -10,7 +10,7 @@ tags: $:/tags/EditTemplate <$reveal state=<> type="nomatch" text="" default="">
<$linkcatcher to="!!type"> -<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'> +<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group-sort]]'>
<$text text={{!!group}}/>
From a3dc3b4b98f424d12019550df52639224100316f Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 19:04:04 +0000 Subject: [PATCH 06/10] Add new [all[tags]] filter operator --- core/modules/filters/all/tags.js | 22 ++++++++++++++++++++++ editions/tw5.com/tiddlers/filters/all.tid | 13 +++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 core/modules/filters/all/tags.js diff --git a/core/modules/filters/all/tags.js b/core/modules/filters/all/tags.js new file mode 100644 index 000000000..2aaa9dec2 --- /dev/null +++ b/core/modules/filters/all/tags.js @@ -0,0 +1,22 @@ +/*\ +title: $:/core/modules/filters/all/tags.js +type: application/javascript +module-type: allfilteroperator + +Filter function for [all[tags]] + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +/* +Export our filter function +*/ +exports.tags = function(source,prefix,options) { + return Object.keys(options.wiki.getTagMap()); +}; + +})(); diff --git a/editions/tw5.com/tiddlers/filters/all.tid b/editions/tw5.com/tiddlers/filters/all.tid index f74f7f1f1..980ebb2ea 100644 --- a/editions/tw5.com/tiddlers/filters/all.tid +++ b/editions/tw5.com/tiddlers/filters/all.tid @@ -1,13 +1,13 @@ +caption: all created: 20140410103123179 -modified: 20150220160957000 +modified: 20161128185445034 +op-input: ignored, unless the parameter is empty +op-output: the titles that belong to all the specified categories +op-parameter: zero or more categories +op-purpose: find all titles of a fundamental category tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]] title: all Operator type: text/vnd.tiddlywiki -caption: all -op-purpose: find all titles of a fundamental category -op-input: ignored, unless the parameter is empty -op-parameter: zero or more categories -op-output: the titles that belong to all the specified categories The parameter specifies zero or more fundamental categories using the following syntax: @@ -21,6 +21,7 @@ The parameter specifies zero or more fundamental categories using the following |^`orphans` |all tiddlers to which there are <<.em no>> hard links |^by title | |^`shadows` |all the [[shadow tiddlers|ShadowTiddlers]] that exist, including any that have been overridden with non-shadow tiddlers |^no | |^`tiddlers` |all the non-shadow tiddlers that exist |no | +|^`tags` |all the tags in use on non-shadow tiddlers |no | If the parameter specifies more than one category, they are processed from left to right. The overall output is initially empty, and each category's output is [[dominantly appended|Dominant Append]] to it in turn. Unrecognised categories contribute nothing to the output. From 9a386421414aacd23e21bc9cb1a116b905fb39ff Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 19:16:08 +0000 Subject: [PATCH 07/10] Add new "order" filter operator --- core/modules/filters/listops.js | 17 +++++++++++++++++ .../tw5.com/tiddlers/filters/order_Operator.tid | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 editions/tw5.com/tiddlers/filters/order_Operator.tid diff --git a/core/modules/filters/listops.js b/core/modules/filters/listops.js index 58f74f092..d7a07b62a 100644 --- a/core/modules/filters/listops.js +++ b/core/modules/filters/listops.js @@ -12,6 +12,23 @@ Filter operators for manipulating the current selection list /*global $tw: false */ "use strict"; +/* +Order a list +*/ +exports.order = function(source,operator,options) { + var results = []; + if(operator.operand.toLowerCase() === "reverse") { + source(function(tiddler,title) { + results.unshift(title); + }); + } else { + source(function(tiddler,title) { + results.push(title); + }); + } + return results; +}; + /* Reverse list */ diff --git a/editions/tw5.com/tiddlers/filters/order_Operator.tid b/editions/tw5.com/tiddlers/filters/order_Operator.tid new file mode 100644 index 000000000..57c240b85 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/order_Operator.tid @@ -0,0 +1,15 @@ +caption: order +created: 20161128185907280 +modified: 20161128191251557 +op-input: a [[selection of titles|Title Selection]] +op-output: the input, with the order reversed if <<.field F>> is the special value `reverse` +op-parameter: Either the string `reverse` or another value +op-parameter-name: F +op-purpose: selectively reverse the input list +tags: [[Filter Operators]] [[Common Operators]] [[Field Operators]] [[Order Operators]] +title: order Operator +type: text/vnd.tiddlywiki + +Either reverses or preserves the order of the input list according to whether the parameter is the special value `reverse`. + +<<.operator-examples "order">> From f07e0f981a1cded691227146e0281f7c4f06d55c Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 19:17:25 +0000 Subject: [PATCH 08/10] Refactor tag template into an underlying macro By refactoring the innards of the tag template into global macros, we make it easier to re-use elements of the tag template --- core/ui/EditTemplate/tags.tid | 41 +++++++----------- core/ui/TagManager.tid | 3 +- core/ui/TagTemplate.tid | 29 +------------ core/wiki/macros/tag-picker.tid | 41 ++++++++++++++++++ core/wiki/macros/tag.tid | 42 ++++++++++++++++++- .../tiddlers/macros/tag-picker_Macro.tid | 15 +++++++ .../tiddlers/macros/tag-pill_Macro.tid | 21 ++++++++++ 7 files changed, 134 insertions(+), 58 deletions(-) create mode 100644 core/wiki/macros/tag-picker.tid create mode 100644 editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid create mode 100644 editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid diff --git a/core/ui/EditTemplate/tags.tid b/core/ui/EditTemplate/tags.tid index e806fd90c..557d1ebdf 100644 --- a/core/ui/EditTemplate/tags.tid +++ b/core/ui/EditTemplate/tags.tid @@ -2,11 +2,13 @@ title: $:/core/ui/EditTemplate/tags tags: $:/tags/EditTemplate \define lingo-base() $:/language/EditTemplate/ + \define tag-styles() background-color:$(backgroundColor)$; fill:$(foregroundColor)$; color:$(foregroundColor)$; \end + \define tag-body-inner(colour,fallbackTarget,colourA,colourB) <$vars foregroundColor=<> backgroundColor="""$colour$"""> > class="tc-tag-label"> @@ -15,39 +17,24 @@ color:$(foregroundColor)$; \end + \define tag-body(colour,palette) <$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}}/> \end + +\define tag-picker-actions() +<$action-listops + $tiddler=<> + $field="tags" + $subfilter="[] [all[current]tags[]]" +/> +\end +
<$fieldmangler> <$list filter="[all[current]tags[]sort[title]]" storyview="pop"> <$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/> - -
- -<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<> class="tc-edit-texteditor tc-popup-handle"/> - <$button popup=<> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}} -<$button message="tm-add-tag" param={{$:/temp/NewTagName}} set="$:/temp/NewTagName" setTo="" class=""> -<> - - -
- -
-<$reveal state=<> type="nomatch" text="" default=""> -
-<$linkcatcher set="$:/temp/NewTagName" setTo="" message="tm-add-tag"> -<$list filter="[tags[]!is[system]search:title{$:/temp/NewTagName}sort[]]"> -{{||$:/core/ui/Components/tag-link}} - -
-<$list filter="[tags[]is[system]search:title{$:/temp/NewTagName}sort[]]"> -{{||$:/core/ui/Components/tag-link}} - - -
- -
-
\ No newline at end of file +<$macrocall $name="tag-picker" actions=<>/> +
diff --git a/core/ui/TagManager.tid b/core/ui/TagManager.tid index fe3489dc9..eeb2135c5 100644 --- a/core/ui/TagManager.tid +++ b/core/ui/TagManager.tid @@ -1,6 +1,7 @@ title: $:/TagManager icon: $:/core/images/tag-button color: #bbb +caption: {{$:/language/TagManager/Caption}} \define lingo-base() $:/language/TagManager/ \define iconEditorTab(type) @@ -51,7 +52,7 @@ $title$$(currentTiddler)$ <$list filter="[tags[]!is[system]sort[title]]"> <$edit-text field="color" tag="input" type="color"/> -<$transclude tiddler="$:/core/ui/TagTemplate"/> +<$macrocall $name="tag" tag=<>/> <$count filter="[all[current]tagging[]]"/> <$macrocall $name="iconEditor" title={{!!title}}/> diff --git a/core/ui/TagTemplate.tid b/core/ui/TagTemplate.tid index f302d8f3d..569e6ad0f 100644 --- a/core/ui/TagTemplate.tid +++ b/core/ui/TagTemplate.tid @@ -1,30 +1,3 @@ title: $:/core/ui/TagTemplate -\define tag-styles() -background-color:$(backgroundColor)$; -fill:$(foregroundColor)$; -color:$(foregroundColor)$; -\end - -\define tag-body-inner(colour,fallbackTarget,colourA,colourB) -<$vars foregroundColor=<> backgroundColor="""$colour$"""> -<$button popup=<> class="tc-btn-invisible tc-tag-label" style=<>> -<$transclude tiddler={{!!icon}}/> <$view field="title" format="text" /> - -<$reveal state=<> type="popup" position="below" animate="yes" class="tc-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/> -<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem"> -<$transclude tiddler=<>/> - -
-<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/> - - -\end - -\define tag-body(colour,palette) - -<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}}/> - -\end - -<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/> +<$macrocall $name="tag" tag=<>/> diff --git a/core/wiki/macros/tag-picker.tid b/core/wiki/macros/tag-picker.tid new file mode 100644 index 000000000..aaea75632 --- /dev/null +++ b/core/wiki/macros/tag-picker.tid @@ -0,0 +1,41 @@ +title: $:/core/macros/tag-picker +tags: $:/tags/Macro + +\define tag-button() +<$button class="tc-btn-invisible" tag="a"> +$(actions)$ +<$action-deletetiddler $tiddler="$:/temp/NewTagName"/> +<$macrocall $name="tag-pill" tag=<>/> + +\end + +\define tag-picker(actions) +<$set name="actions" value="""$actions$"""> +
+ +<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<> class="tc-edit-texteditor tc-popup-handle"/> + <$button popup=<> class="tc-btn-invisible" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}} +<$set name="tag" value={{$:/temp/NewTagName}}> +<$button set="$:/temp/NewTagName" setTo="" class=""> +$actions$ +<$action-deletetiddler $tiddler="$:/temp/NewTagName"/> +{{$:/language/EditTemplate/Tags/Add/Button}} + + + +
+
+<$reveal state=<> type="nomatch" text="" default=""> +
+<$list filter="[tags[]!is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag"> +<> + +
+<$list filter="[tags[]is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag"> +<> + +
+ +
+ +\end diff --git a/core/wiki/macros/tag.tid b/core/wiki/macros/tag.tid index b65bfc046..dc23f3238 100644 --- a/core/wiki/macros/tag.tid +++ b/core/wiki/macros/tag.tid @@ -1,6 +1,44 @@ title: $:/core/macros/tag tags: $:/tags/Macro -\define tag(tag) -{{$tag$||$:/core/ui/TagTemplate}} +\define tag-pill-styles() +background-color:$(backgroundColor)$; +fill:$(foregroundColor)$; +color:$(foregroundColor)$; +\end + +\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions) +<$vars foregroundColor=<> backgroundColor="""$colour$"""> +<$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible" style=<>> +$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler="""$tag$""" field="title" format="text" /> + + +\end + +\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions) +<$macrocall $name="tag-pill-inner" tag="""$tag$""" icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/> +\end + +\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"") + +<$macrocall $name="tag-pill-body" tag="""$tag$""" icon={{$tag$!!icon}} colour={{$tag$!!color}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/> + +\end + +\define tag(tag) + +<$set name="transclusion" value="""$tag$"""> +<$macrocall $name="tag-pill-body" tag="""$tag$""" icon={{$tag$!!icon}} colour={{$tag$!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<>"""/> +<$reveal state=<> type="popup" position="below" animate="yes" class="tc-drop-down"> +<$tiddler tiddler="""$tag$"""> +<$transclude tiddler="$:/core/ui/ListItemTemplate"/> +<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem"> +<$transclude tiddler=<>/> + +
+<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/> + + + +
\end diff --git a/editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid b/editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid new file mode 100644 index 000000000..eae5cf1b9 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid @@ -0,0 +1,15 @@ +caption: tag-picker +created: 20161128191316701 +modified: 20161128191435641 +tags: Macros [[Core Macros]] +title: tag-picker Macro +type: text/vnd.tiddlywiki + +The <<.def tag-picker>> [[macro|Macros]] generates a combination of a text box and a button that allows a tag to be selected and added. + +!! Parameters + +;actions +: Action widgets to be triggered when the pill is clicked + +<<.macro-examples "tag-picker">> diff --git a/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid b/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid new file mode 100644 index 000000000..e48206c71 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid @@ -0,0 +1,21 @@ +caption: tag-pill +created: 20161128190930538 +modified: 20161128191220364 +tags: Macros [[Core Macros]] +title: tag-pill Macro +type: text/vnd.tiddlywiki + +The <<.def tag-pill>> [[macro|Macros]] generates a static tag pill showing a specified tag, but without the dropdown action provided by the [[tag Macro]]. + +!! Parameters + +;tag +: The title of the tag +;element-tag +: The element name to be used for the pill (defaults to "span") +;element-attributes +: Additional attributes for the pill element +;actions +: Action widgets to be triggered when the pill is clicked + +<<.macro-examples "tag-pill">> From 2f2ddf6c0e9d5085d7f152de3824a41219915ead Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 28 Nov 2016 21:31:09 +0000 Subject: [PATCH 09/10] Update docs for tag macros --- editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid | 2 +- editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid b/editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid index eae5cf1b9..b2d9cb9f0 100644 --- a/editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid +++ b/editions/tw5.com/tiddlers/macros/tag-picker_Macro.tid @@ -10,6 +10,6 @@ The <<.def tag-picker>> [[macro|Macros]] generates a combination of a text box a !! Parameters ;actions -: Action widgets to be triggered when the pill is clicked +: Action widgets to be triggered when the pill is clicked. Within the text, the variable ''tag'' contains the title of the selected tag. <<.macro-examples "tag-picker">> diff --git a/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid b/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid index e48206c71..73ea08058 100644 --- a/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid +++ b/editions/tw5.com/tiddlers/macros/tag-pill_Macro.tid @@ -16,6 +16,6 @@ The <<.def tag-pill>> [[macro|Macros]] generates a static tag pill showing a spe ;element-attributes : Additional attributes for the pill element ;actions -: Action widgets to be triggered when the pill is clicked +: Action widgets to be triggered when the pill is clicked. Within the text, the macro parameter ''tag'' contains the title of the selected tag. <<.macro-examples "tag-pill">> From 16bb65d17f5a20a0076320c6b1305b7b139d7375 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 29 Nov 2016 08:36:07 +0000 Subject: [PATCH 10/10] Introduce tiddler manager --- core/images/list.tid | 9 ++ core/language/en-GB/Buttons.multids | 2 + core/language/en-GB/Misc.multids | 27 +++++ core/ui/Manager.tid | 92 +++++++++++++++++ core/ui/Manager/ItemMainFields.tid | 9 ++ core/ui/Manager/ItemMainRawText.tid | 5 + core/ui/Manager/ItemMainWikifiedText.tid | 5 + core/ui/Manager/ItemSidebarColour.tid | 15 +++ core/ui/Manager/ItemSidebarIcon.tid | 23 +++++ core/ui/Manager/ItemSidebarTags.tid | 32 ++++++ core/ui/Manager/ItemSidebarTools.tid | 10 ++ core/ui/PageControls/manager.tid | 19 ++++ core/wiki/config/Manager.multids | 8 ++ core/wiki/config/ManagerItemState.multids | 3 + core/wiki/config/PageControlButtons.multids | 1 + core/wiki/macros/image-picker.tid | 37 ++++--- core/wiki/tags/ManagerItemMain.tid | 2 + core/wiki/tags/ManagerItemSidebar.tid | 2 + core/wiki/tags/PageControls.tid | 2 +- themes/tiddlywiki/vanilla/base.tid | 107 ++++++++++++++++++++ 20 files changed, 395 insertions(+), 15 deletions(-) create mode 100644 core/images/list.tid create mode 100644 core/ui/Manager.tid create mode 100644 core/ui/Manager/ItemMainFields.tid create mode 100644 core/ui/Manager/ItemMainRawText.tid create mode 100644 core/ui/Manager/ItemMainWikifiedText.tid create mode 100644 core/ui/Manager/ItemSidebarColour.tid create mode 100644 core/ui/Manager/ItemSidebarIcon.tid create mode 100644 core/ui/Manager/ItemSidebarTags.tid create mode 100644 core/ui/Manager/ItemSidebarTools.tid create mode 100644 core/ui/PageControls/manager.tid create mode 100644 core/wiki/config/Manager.multids create mode 100644 core/wiki/config/ManagerItemState.multids create mode 100644 core/wiki/tags/ManagerItemMain.tid create mode 100644 core/wiki/tags/ManagerItemSidebar.tid diff --git a/core/images/list.tid b/core/images/list.tid new file mode 100644 index 000000000..c27a51647 --- /dev/null +++ b/core/images/list.tid @@ -0,0 +1,9 @@ +title: $:/core/images/list +tags: $:/tags/Image + + + + + + + \ No newline at end of file diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 3a8f21969..5c8398f6d 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -54,6 +54,8 @@ Home/Caption: home Home/Hint: Open the default tiddlers Language/Caption: language Language/Hint: Choose the user interface language +Manager/Caption: tiddler manager +Manager/Hint: Open tiddler manager More/Caption: more More/Hint: More actions NewHere/Caption: new here diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index c21b68326..7d16deb27 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -43,6 +43,33 @@ OfficialPluginLibrary/Hint: The official ~TiddlyWiki plugin library at tiddlywik PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to plugins to take effect RecentChanges/DateFormat: DDth MMM YYYY SystemTiddler/Tooltip: This is a system tiddler + +SystemTiddlers/Include/Prompt: Include system tiddlers + +Manager/Item/Fields: Fields +Manager/Item/RawText: Raw text +Manager/Item/WikifiedText: Wikified text +Manager/Item/Colour: Colour +Manager/Item/Tags: Tags +Manager/Item/Icon: Icon +Manager/Item/Icon/None: (none) +Manager/Item/Tools: Tools + +Manager/Controls/Show/Prompt: Show: +Manager/Controls/Show/Option/Tiddlers: tiddlers +Manager/Controls/Show/Option/Tags: tags + +Manager/Controls/Search/Prompt: Search: +Manager/Controls/Search/Placeholder: Search + +Manager/Controls/Sort/Prompt: Sort by: + +Manager/Controls/Order/Prompt: Reverse order + + +Manager/Controls/FilterByTag/Prompt: Filter by tag: +Manager/Controls/FilterByTag/None: (none) + TagManager/Colour/Heading: Colour TagManager/Count/Heading: Count TagManager/Icon/Heading: Icon diff --git a/core/ui/Manager.tid b/core/ui/Manager.tid new file mode 100644 index 000000000..b0a08ee64 --- /dev/null +++ b/core/ui/Manager.tid @@ -0,0 +1,92 @@ +title: $:/Manager +icon: $:/core/images/list +color: #bbb + +\define lingo-base() $:/language/Manager/ + +\define list-item-content-item() +
+ <$vars state-title="""$:/state/popup/manager/item/$(listItem)$"""> + <$reveal state=<> type="match" text="show" default="show" tag="div"> + <$button set=<> setTo="hide" class="tc-btn-invisible tc-manager-list-item-content-item-heading"> + {{$:/core/images/down-arrow}} <$transclude tiddler=<> field="caption"/> + + + <$reveal state=<> type="nomatch" text="show" default="show" tag="div"> + <$button set=<> setTo="show" class="tc-btn-invisible tc-manager-list-item-content-item-heading"> + {{$:/core/images/right-arrow}} <$transclude tiddler=<> field="caption"/> + + + <$reveal state=<> type="match" text="show" default="show" tag="div" class="tc-manager-list-item-content-item-body"> + <$transclude tiddler=<>/> + + +
+\end + +
+
+
+ <> <$select tiddler="$:/config/Manager/Show" default="tiddlers"> + + + +
+
+ <> <$edit-text tiddler="$:/config/Manager/Filter" tag="input" default="" placeholder={{$:/language/Manager/Controls/Search/Placeholder}}/> +
+
+ <> <$select tiddler="$:/config/Manager/Tag" default=""> + + <$list filter="[!is{$:/config/Manager/System}tags[]!is[system]sort[title]]" variable="tag"> + + + +
+
+ <> <$select tiddler="$:/config/Manager/Sort" default="title"> + + <$list filter="title modified modifier created creator created" variable="field"> + + + + + <$list filter="[all{$:/config/Manager/Show}!is{$:/config/Manager/System}fields[]sort[title]] -title -modified -modifier -created -creator -created" variable="field"> + + + + + <$checkbox tiddler="$:/config/Manager/Order" field="text" checked="reverse" unchecked="forward" default="forward"> + <> + +
+
+ <$checkbox tiddler="$:/config/Manager/System" field="text" checked="" unchecked="system" default="system"> + {{$:/language/SystemTiddlers/Include/Prompt}} + +
+
+
+ <$list filter="[all{$:/config/Manager/Show}!is{$:/config/Manager/System}search{$:/config/Manager/Filter}tag:strict{$:/config/Manager/Tag}sort{$:/config/Manager/Sort}order{$:/config/Manager/Order}]"> + <$vars transclusion=<>> +
+ <$button popup=<> class="tc-btn-invisible tc-manager-list-item-heading" selectedClass="tc-manager-list-item-heading-selected"> + <$text text=<>/> + + <$reveal state=<> type="nomatch" text="" default="" tag="div" class="tc-manager-list-item-content tc-popup-handle"> +
+ <$list filter="[all[shadows+tiddlers]tag[$:/tags/Manager/ItemMain]!has[draft.of]]" variable="listItem"> + <> + +
+ + +
+ + +
+
diff --git a/core/ui/Manager/ItemMainFields.tid b/core/ui/Manager/ItemMainFields.tid new file mode 100644 index 000000000..cf88e52c6 --- /dev/null +++ b/core/ui/Manager/ItemMainFields.tid @@ -0,0 +1,9 @@ +title: $:/Manager/ItemMain/Fields +tags: $:/tags/Manager/ItemMain +caption: {{$:/language/Manager/Item/Fields}} + + + +<$list filter="[all[current]fields[]sort[title]] -text" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/> + +
diff --git a/core/ui/Manager/ItemMainRawText.tid b/core/ui/Manager/ItemMainRawText.tid new file mode 100644 index 000000000..627095070 --- /dev/null +++ b/core/ui/Manager/ItemMainRawText.tid @@ -0,0 +1,5 @@ +title: $:/Manager/ItemMain/RawText +tags: $:/tags/Manager/ItemMain +caption: {{$:/language/Manager/Item/RawText}} + +
<$view/>
diff --git a/core/ui/Manager/ItemMainWikifiedText.tid b/core/ui/Manager/ItemMainWikifiedText.tid new file mode 100644 index 000000000..0e9fd1e75 --- /dev/null +++ b/core/ui/Manager/ItemMainWikifiedText.tid @@ -0,0 +1,5 @@ +title: $:/Manager/ItemMain/WikifiedText +tags: $:/tags/Manager/ItemMain +caption: {{$:/language/Manager/Item/WikifiedText}} + +<$transclude mode="block"/> diff --git a/core/ui/Manager/ItemSidebarColour.tid b/core/ui/Manager/ItemSidebarColour.tid new file mode 100644 index 000000000..6b432239b --- /dev/null +++ b/core/ui/Manager/ItemSidebarColour.tid @@ -0,0 +1,15 @@ +title: $:/Manager/ItemSidebar/Colour +tags: $:/tags/Manager/ItemSidebar +caption: {{$:/language/Manager/Item/Colour}} + +\define swatch-styles() +height: 1em; +background-color: $(colour)$ +\end + +<$vars colour={{!!color}}> +

>/> + +

+<$edit-text field="color" tag="input" type="color"/> / <$edit-text field="color" tag="input" type="text" size="9"/> +

diff --git a/core/ui/Manager/ItemSidebarIcon.tid b/core/ui/Manager/ItemSidebarIcon.tid new file mode 100644 index 000000000..c9fe85a27 --- /dev/null +++ b/core/ui/Manager/ItemSidebarIcon.tid @@ -0,0 +1,23 @@ +title: $:/Manager/ItemSidebar/Icon +tags: $:/tags/Manager/ItemSidebar +caption: {{$:/language/Manager/Item/Icon}} + +

+

+<$button popup=<> class="tc-btn-invisible"> +<$transclude tiddler={{!!icon}}> +{{$:/language/Manager/Item/Icon/None}} + + +
+<$reveal state=<> type="nomatch" text="" default="" tag="div" class="tc-popup"> +
+<$macrocall $name="image-picker-include-tagged-images" actions=""" +<$action-setfield $field="icon" $value=<>/> +<$action-deletetiddler $tiddler=<>/> +"""/> +
+ +
+
+

diff --git a/core/ui/Manager/ItemSidebarTags.tid b/core/ui/Manager/ItemSidebarTags.tid new file mode 100644 index 000000000..e22c2a19a --- /dev/null +++ b/core/ui/Manager/ItemSidebarTags.tid @@ -0,0 +1,32 @@ +title: $:/Manager/ItemSidebar/Tags +tags: $:/tags/Manager/ItemSidebar +caption: {{$:/language/Manager/Item/Tags}} + +\define tag-checkbox-actions() +<$action-listops + $tiddler="$:/config/Manager/RecentTags" + $subfilter="[] [list[$:/config/Manager/RecentTags]] +[limit[12]]" +/> +\end + +\define tag-picker-actions() +<> +<$action-listops + $tiddler=<> + $field="tags" + $subfilter="[] [all[current]tags[]]" +/> +\end + +

+<$list filter="[is[current]tags[]] [list[$:/config/Manager/RecentTags]] +[sort[title]] " variable="tag"> +

+<$checkbox tiddler=<> tag=<> actions=<>> +<$macrocall $name="tag-pill" tag=<>/> + +
+ +

+

+<$macrocall $name="tag-picker" actions=<>/> +

diff --git a/core/ui/Manager/ItemSidebarTools.tid b/core/ui/Manager/ItemSidebarTools.tid new file mode 100644 index 000000000..45876e989 --- /dev/null +++ b/core/ui/Manager/ItemSidebarTools.tid @@ -0,0 +1,10 @@ +title: $:/Manager/ItemSidebar/Tools +tags: $:/tags/Manager/ItemSidebar +caption: {{$:/language/Manager/Item/Tools}} + +

+<$button to=<>>{{$:/core/images/link}} open +

+

+<$button message="tm-edit-tiddler" param=<>>{{$:/core/images/edit-button}} edit +

diff --git a/core/ui/PageControls/manager.tid b/core/ui/PageControls/manager.tid new file mode 100644 index 000000000..b2a7ed9bf --- /dev/null +++ b/core/ui/PageControls/manager.tid @@ -0,0 +1,19 @@ +title: $:/core/ui/Buttons/manager +tags: $:/tags/PageControls +caption: {{$:/core/images/list}} {{$:/language/Buttons/Manager/Caption}} +description: {{$:/language/Buttons/Manager/Hint}} + +\define manager-button(class) +<$button to="$:/Manager" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class="""$(tv-config-toolbar-class)$ $class$"""> +<$list filter="[prefix[yes]]"> +{{$:/core/images/list}} + +<$list filter="[prefix[yes]]"> +<$text text={{$:/language/Buttons/Manager/Caption}}/> + + +\end + +<$list filter="[list[$:/StoryList]] +[field:title[$:/Manager]]" emptyMessage=<>> +<> + diff --git a/core/wiki/config/Manager.multids b/core/wiki/config/Manager.multids new file mode 100644 index 000000000..11d370750 --- /dev/null +++ b/core/wiki/config/Manager.multids @@ -0,0 +1,8 @@ +title: $:/config/Manager/ + +Show: tiddlers +Filter: +Order: forward +Sort: title +System: system +Tag: diff --git a/core/wiki/config/ManagerItemState.multids b/core/wiki/config/ManagerItemState.multids new file mode 100644 index 000000000..845034ff6 --- /dev/null +++ b/core/wiki/config/ManagerItemState.multids @@ -0,0 +1,3 @@ +title: $:/state/popup/manager/item/$:/Manager/ + +ItemMain/RawText: hide \ No newline at end of file diff --git a/core/wiki/config/PageControlButtons.multids b/core/wiki/config/PageControlButtons.multids index 7ad91db29..f880b3399 100644 --- a/core/wiki/config/PageControlButtons.multids +++ b/core/wiki/config/PageControlButtons.multids @@ -11,6 +11,7 @@ core/ui/Buttons/refresh: hide core/ui/Buttons/import: hide core/ui/Buttons/language: hide core/ui/Buttons/tag-manager: hide +core/ui/Buttons/manager: hide core/ui/Buttons/more-page-actions: hide core/ui/Buttons/new-journal: hide core/ui/Buttons/new-image: hide diff --git a/core/wiki/macros/image-picker.tid b/core/wiki/macros/image-picker.tid index 68bbba34d..579f3202a 100644 --- a/core/wiki/macros/image-picker.tid +++ b/core/wiki/macros/image-picker.tid @@ -1,26 +1,35 @@ title: $:/core/macros/image-picker tags: $:/tags/Macro -\define image-picker-inner(actions) +\define image-picker-thumbnail(actions) <$button tag="a" tooltip="""$(imageTitle)$"""> - $actions$ - <$transclude tiddler=<>/> - \end -\define image-picker(actions,subfilter:"") -
- -<$list filter="[all[shadows+tiddlers]is[image]$subfilter$!has[draft.of]] -[type[application/pdf]] +[sort[title]]" variable="imageTitle"> - -<$macrocall $name="image-picker-inner" actions="""$actions$"""/> - +\define image-picker-list(filter,actions) +<$list filter="""$filter$""" variable="imageTitle"> +<$macrocall $name="image-picker-thumbnail" actions="""$actions$"""/> - -
- \end +\define image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]") +
+<$vars state-system=<>> +<$checkbox tiddler=<> field="text" checked="show" unchecked="hide" default="hide"> +{{$:/language/SystemTiddlers/Include/Prompt}} + +<$reveal state=<> type="match" text="hide" default="hide" tag="div"> +<$macrocall $name="image-picker-list" filter="""$filter$ +[!is[system]]""" actions="""$actions$"""/> + +<$reveal state=<> type="nomatch" text="hide" default="hide" tag="div"> +<$macrocall $name="image-picker-list" filter="""$filter$""" actions="""$actions$"""/> + + +
+\end + +\define image-picker-include-tagged-images(actions) +<$macrocall $name="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions="""$actions$"""/> +\end diff --git a/core/wiki/tags/ManagerItemMain.tid b/core/wiki/tags/ManagerItemMain.tid new file mode 100644 index 000000000..fa1af0824 --- /dev/null +++ b/core/wiki/tags/ManagerItemMain.tid @@ -0,0 +1,2 @@ +title: $:/tags/Manager/ItemMain +list: $:/Manager/ItemMain/WikifiedText $:/Manager/ItemMain/RawText $:/Manager/ItemMain/Fields \ No newline at end of file diff --git a/core/wiki/tags/ManagerItemSidebar.tid b/core/wiki/tags/ManagerItemSidebar.tid new file mode 100644 index 000000000..b450ef772 --- /dev/null +++ b/core/wiki/tags/ManagerItemSidebar.tid @@ -0,0 +1,2 @@ +title: $:/tags/Manager/ItemSidebar +list: $:/Manager/ItemSidebar/Tags $:/Manager/ItemSidebar/Colour $:/Manager/ItemSidebar/Icon $:/Manager/ItemSidebar/Tools \ No newline at end of file diff --git a/core/wiki/tags/PageControls.tid b/core/wiki/tags/PageControls.tid index 3bef09b7d..4d5972827 100644 --- a/core/wiki/tags/PageControls.tid +++ b/core/wiki/tags/PageControls.tid @@ -1,2 +1,2 @@ title: $:/tags/PageControls -list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/new-image]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]] +list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/new-image]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/manager]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/timestamp]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/print]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]] diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 0cadceb1e..1b5f94348 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1725,6 +1725,113 @@ html body.tc-body.tc-single-tiddler-window { border: none; } +/* +** Manager +*/ + +.tc-manager-wrapper { + +} + +.tc-manager-controls { + +} + +.tc-manager-control { + margin: 0.5em 0; +} + +.tc-manager-list { + width: 100%; + border-top: 1px solid <>; + border-left: 1px solid <>; + border-right: 1px solid <>; +} + +.tc-manager-list-item { + +} + +.tc-manager-list-item-heading { + display: block; + width: 100%; + text-align: left; + border-bottom: 1px solid <>; + padding: 3px; +} + +.tc-manager-list-item-heading-selected { + font-weight: bold; + color: <>; + fill: <>; + background-color: <>; +} + +.tc-manager-list-item-heading:hover { + background: <>; + color: <>; +} + +.tc-manager-list-item-content { + display: flex; +} + +.tc-manager-list-item-content-sidebar { + flex: 1 0; + background: <>; + border-right: 0.5em solid <>; + border-bottom: 0.5em solid <>; + white-space: nowrap; +} + +.tc-manager-list-item-content-item-heading { + display: block; + width: 100%; + text-align: left; + background: <>; + text-transform: uppercase; + font-size: 0.6em; + font-weight: bold; + padding: 0.5em 0 0.5em 0; +} + +.tc-manager-list-item-content-item-body { + padding: 0 0.5em 0 0.5em; +} + +.tc-manager-list-item-content-item-body > pre { + margin: 0.5em 0 0.5em 0; + border: none; + background: inherit; +} + +.tc-manager-list-item-content-tiddler { + flex: 3 1; + border-left: 0.5em solid <>; + border-right: 0.5em solid <>; + border-bottom: 0.5em solid <>; +} + +.tc-manager-list-item-content-item-body > table { + border: none; + padding: 0; + margin: 0; +} + +.tc-manager-list-item-content-item-body > table td { + border: none; +} + +.tc-manager-icon-editor > button { + width: 100%; +} + +.tc-manager-icon-editor > button > svg, +.tc-manager-icon-editor > button > button { + width: 100%; + height: auto; +} + /* ** Alerts */