1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-23 03:14:40 +00:00

Compare commits

..

18 Commits

Author SHA1 Message Date
jeremy@jermolene.com
fd16fbc685 Clarify docs 2023-06-13 16:34:51 +01:00
jeremy@jermolene.com
21a75e5c14 Fix typo 2023-06-13 16:34:43 +01:00
jeremy@jermolene.com
5f02101c96 Docs dates 2023-06-13 16:27:35 +01:00
jeremy@jermolene.com
7ca1a9a1cb Restore whitespace trim 2023-06-13 16:27:19 +01:00
jeremy@jermolene.com
ed27574c81 Updates to framed.js in the light of PRs that have been merged since this 2023-06-13 16:27:09 +01:00
jeremy@jermolene.com
5723a7fbc0 Templates should set text direction from a variable, not a transclusion 2023-06-13 16:08:16 +01:00
jeremy@jermolene.com
bc6739907f Merge branch 'master' into bidi-improvements 2023-06-13 16:00:04 +01:00
jeremy@jermolene.com
95befb8751 Add docs for \dir pragma 2023-04-22 08:58:03 +01:00
jeremy@jermolene.com
46f448faef Merge branch 'master' into bidi-improvements 2023-04-22 08:57:46 +01:00
jeremy@jermolene.com
cc6895b291 Missed closing brace 2023-01-13 16:38:35 +00:00
jeremy@jermolene.com
11f4277fc9 Add direction attribute for edit body template 2023-01-13 16:36:39 +00:00
jeremy@jermolene.com
b707950c5e Merge branch 'master' into bidi-improvements 2023-01-13 16:35:12 +00:00
Jeremy Ruston
a58524611a Fix framed text editor directionality in Firefox 2020-04-07 20:13:00 +01:00
Jeremy Ruston
371649ebd0 Remove Codemirror plugin from Prerelease
Makes it easier to test things
2020-04-07 20:00:15 +01:00
Jeremy Ruston
e4966c2796 Revert accidentally commited test data
This reverts some of commit b83c1d160f.
2020-04-07 16:30:59 +01:00
Jeremy Ruston
b83c1d160f Add $:/config/DefaultTextDirection hidden setting 2020-04-07 16:17:11 +01:00
Jeremy Ruston
b833103428 Add "dir" attribute to reveal, edit, edit-text and edit-codemirror widgets 2020-04-07 16:16:56 +01:00
Jeremy Ruston
265e7a2da2 Add support for \dir pragma 2020-04-07 16:16:29 +01:00
19 changed files with 31 additions and 53 deletions

View File

@@ -178,6 +178,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
srcVariable = variableInfo && variableInfo.srcVariable;
if(variableInfo.text) {
if(srcVariable.isFunctionDefinition) {
// Function to return parameters by name or position
var result = (variableInfo.resultList ? variableInfo.resultList[0] : variableInfo.text) || "";
parser = {
tree: [{
@@ -234,7 +235,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
}
$tw.utils.addAttributeToParseTreeNode(parser.tree[0],name,param["default"])
});
} else if(srcVariable.isMacroDefinition || !srcVariable.isFunctionDefinition) {
} else {
// For macros and ordinary variables, wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__"
parser = {
tree: [

View File

@@ -3,7 +3,6 @@ tags: $:/tags/Exporter
description: {{$:/language/Exporters/StaticRiver}}
extension: .html
\define tv-config-static() yes
\define tv-wikilink-template() #$uri_encoded$
\define tv-config-toolbar-icons() no
\define tv-config-toolbar-text() no

View File

@@ -1,7 +1,6 @@
title: $:/core/templates/server/static.tiddler.html
\whitespace trim
\define tv-config-static() yes
\define tv-wikilink-template() $uri_encoded$
\import [subfilter{$:/core/config/GlobalImportFilter}]
<html>

View File

@@ -1,7 +1,6 @@
title: $:/core/templates/static.template.html
type: text/vnd.tiddlywiki-html
\define tv-config-static() yes
\define tv-wikilink-template() static/$uri_doubleencoded$.html
\define tv-config-toolbar-icons() no
\define tv-config-toolbar-text() no

View File

@@ -1,7 +1,6 @@
title: $:/core/templates/static.tiddler.html
\define tv-wikilink-template() $uri_doubleencoded$.html
\define tv-config-static() yes
\define tv-config-toolbar-icons() no
\define tv-config-toolbar-text() no
\define tv-config-toolbar-class() tc-btn-invisible

View File

@@ -83,6 +83,7 @@ Improvements to the following translations:
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7529">> size of buttons in dropdown for editor "link" toolbar button
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/8e132948b6bec623d81d300fbe6dc3a0307bcc6d">> crash when transcluding a lazily loaded tiddler as an attribute value
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7462">> DiffTextWidget crash with missing or empty attributes
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7448">> CheckboxWidget to avoid writing to date fields
! Developer Improvements

View File

@@ -1066,11 +1066,7 @@ Tests the filtering mechanism.
});
it("should handle the deserializers operator", function() {
var expectedDeserializers = ["application/javascript","application/json","application/x-tiddler","application/x-tiddler-html-div","application/x-tiddlers","text/css","text/html","text/plain"];
if($tw.browser) {
expectedDeserializers.unshift("(DOM)");
}
expect(wiki.filterTiddlers("[deserializers[]]").join(",")).toBe(expectedDeserializers.join(","));
expect(wiki.filterTiddlers("[deserializers[]]").join(",")).toBe("application/javascript,application/json,application/x-tiddler,application/x-tiddler-html-div,application/x-tiddlers,text/css,text/html,text/plain");
});
it("should handle the charcode operator", function() {

View File

@@ -1,17 +1,17 @@
created: 20150117152607000
modified: 20230617183916622
modified: 20220227210111054
tags: $:/tags/Macro
title: $:/editions/tw5.com/operator-macros
\define .operator-examples(op,text:"Examples") <$link to="$op$ Operator (Examples)">$text$</$link>
\procedure .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<eg>>/>
\procedure .operator-example(n,eg,ie)
\define .operator-example-tryit-actions() <$action-setfield $tiddler=<<.state>> text="show" filter=<<__eg__>>/>
\define .operator-example(n,eg,ie)
<div class="doc-example">
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix<n>]" variable=".state">
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show">
<code><$text text=<<eg>>/></code>
<$macrocall $name=".if" cond=<<ie>> then={{{[[<dd>&rarr; ]addsuffix<ie>addsuffix[</dd>]]}}}/>
`$eg$`
<$macrocall $name=".if" cond="""$ie$""" then="""<dd>&rarr; $ie$</dd>"""/>
<dl>
<dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd>
</dl>
@@ -21,7 +21,7 @@ title: $:/editions/tw5.com/operator-macros
<dl>
<dd>
<$button set=<<.state>> setTo="">Hide</$button>
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<eg>>>
<$reveal stateTitle=<<.state>> stateField="filter" type="nomatch" text=<<__eg__>>>
<$button actions=<<.operator-example-tryit-actions>>>Reset</$button>
</$reveal>
</dd>

View File

@@ -151,4 +151,4 @@ Below is an example macro, procedure and function definition. All three forms o
*''variables'' - \define, <<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget, \function all create variables. If the same name is used, then later define will overwrite earlier defined
*''<<.op function>> filter operator parameter'' - only variables defined using \function can be called using the <<.olink function>> operator
*''filter operators'' - only the [[javascript defined filter operators|Filter Operators]] and variables defined using \function with name containing a dot can be called
*''widgets'' - variables defined using \widget can be invoked using `<$widget/>` syntax ONLY if the name starts a dollar sign. Without the dollar sign prefix, defining variables using \widget is no different than using \procedure.
*''widgets'' - variables defined using \widget can be invoked using `<$widget/>` syntax ONLY if the name starts a dollar sign (to override existing javascript defined widgets) or double dollar sign (to define [[custom widgets|Custom Widgets]]). Without the dollar sign prefix, defining variables using \widget is no different than using \procedure.

View File

@@ -1,10 +0,0 @@
created: 20230617085524754
modified: 20230617085524754
title: tv-config-static Variable
tags: Variables [[Core Variables]] [[Configuration Variables]]
type: text/vnd.tiddlywiki
caption: tv-config-static
<<.from-version "5.3.0">> The <<.def tv-config-static>> [[variable|Variables]] is set to `yes` within static rendering templates, and is unset in other contexts.
It is useful for selectively hiding or showing content depending on whether a rendering is static or interactive.

View File

@@ -67,8 +67,6 @@ More/Caption: więcej
More/Hint: Więcej akcji
NewHere/Caption: nowy tiddler tu
NewHere/Hint: Stwórz nowego tiddlera otagowanego tym tiddlerem
NetworkActivity/Caption: ruch sieciowy
NetworkActivity/Hint: Anuluj cały ruch sieciowy
NewJournal/Caption: nowy dziennik
NewJournal/Hint: Tworzy nowego tiddlera o typie dziennika
NewJournalHere/Caption: nowy dziennik tu

View File

@@ -25,8 +25,6 @@ Encryption/RepeatPassword: Powtórz hasło
Encryption/PasswordNoMatch: Hasła się nie zgadzają
Encryption/SetPassword: Ustaw hasło
Error/Caption: Bład
Error/DeserializeOperator/MissingOperand: Błąd filtra: Nie podano argumentu dla operatora 'deserialize'
Error/DeserializeOperator/UnknownDeserializer: Błąd filtra: Podano nieznany deserializator jako argument dla operatora 'deserialize'
Error/Filter: Bład filtra
Error/FilterSyntax: Bład składniowy filtra
Error/FilterRunPrefix: Bład filtra: Nieznany prefiks dla filtra 'run'

View File

@@ -1,3 +1,3 @@
title: $:/SiteTitle
Moja TiddlyWiki
Moja ~TiddlyWiki

View File

@@ -17,7 +17,7 @@ exports.name = "google-analytics";
exports.platforms = ["browser"];
exports.synchronous = true;
var CONFIG_CONSENT_REQUIRED_TITLE = "$:/config/cookie-consent-required", // "yes" or "no" (the default)
var CONFIG_CONSENT_REQUIRED_TITLE = "$:/config/cookie-consent-required",
CONSENT_TITLE = "$:/state/consent-banner/accepted"; // "": undeclared, "yes": accepted, "no": declined
exports.startup = function() {
@@ -25,16 +25,15 @@ exports.startup = function() {
initialiseGoogleAnalytics = function() {
console.log("Initialising Google Analytics");
hasInitialised = true;
var gaMeasurementID = $tw.wiki.getTiddlerText("$:/GoogleAnalyticsMeasurementID","").replace(/\n/g,"");
var url ="https://www.googletagmanager.com/gtag/js?id=" + gaMeasurementID;
window.dataLayer = window.dataLayer || [];
window.gtag = function() { window.dataLayer?.push(arguments); };
window.gtag("js",new Date());
window.gtag("config",gaMeasurementID);
const scriptElement = window.document.createElement("script");
scriptElement.async = true;
scriptElement.src = url;
window.document.head.appendChild(scriptElement);
var gaAccount = $tw.wiki.getTiddlerText("$:/GoogleAnalyticsAccount","").replace(/\n/g,""),
gaDomain = $tw.wiki.getTiddlerText("$:/GoogleAnalyticsDomain","auto").replace(/\n/g,"");
// Using ga "isogram" function
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create',gaAccount,gaDomain);
ga('send','pageview');
};
// Initialise now if consent isn't required
if($tw.wiki.getTiddlerText(CONFIG_CONSENT_REQUIRED_TITLE) !== "yes") {

View File

@@ -1,6 +1,6 @@
title: $:/plugins/tiddlywiki/googleanalytics/readme
This plugin enables you to use Google Analytics to track access to your online TiddlyWiki document.
This plugin enables you to use Google Analytics to track access to your online TiddlyWiki document. Based upon the [[official Google code|https://developers.google.com/analytics/devguides/collection/analyticsjs]].
By default, the user is not asked for permission before initialising Google Analytics. This plugin also optionally integrates with the "Consent Banner" plugin (also found in the official plugin library) so that Google Analytics is not initialised until the user grants explicit permission.

View File

@@ -1,6 +1,7 @@
title: $:/plugins/tiddlywiki/googleanalytics/settings
You have only two value to set, only the first is mandatory:
You have only two value to set, only first is mandatory:
# ''[[Google Analytics Measurement ID|$:/GoogleAnalyticsMeasurementID]]'': (mandatory) a code of the form `G-XXXXXXXXXX` where X are digits or uppercase letters<br/><$edit-text tiddler="$:/GoogleAnalyticsMeasurementID" default="" tag="input"/>
# ''[[Google Analytics Account|$:/GoogleAnalyticsAccount]]'': (mandatory) a code of the form `UA-XXXXXX-XX` where X are digits<br/><$edit-text tiddler="$:/GoogleAnalyticsAccount" default="" tag="input"/>
# ''[[Google Analytics Domain|$:/GoogleAnalyticsDomain]]'': (optional) the website URL where the TiddlyWiki file is published. Defaults to `auto` if not set.<br/><$edit-text tiddler="$:/GoogleAnalyticsDomain" default="" tag="input"/>

View File

@@ -7,7 +7,7 @@ If you don't already have an account:
# Go to the Google Analytics website: http://www.google.com/analytics/
# Click the ''Access Google Analytics'' button and follow instructions to set up your account
# Enter the URL where the wiki is hosted
# Note the Tracking ID for this domain of the form `G-XXXXXXXXXX`
# Note the Tracking ID for this domain of the form `UA-XXXXXX-XX`
!! Install the plugin on your local copy of the TiddlyWiki
@@ -20,5 +20,5 @@ If you don't already have an account:
!! Upload the new version of your TiddlyWiki
# Upload the saved TiddlyWiki to Tiddlyhost, GitHub, GitLab or other web host
# Upload the saved TiddlyWiki to TiddlySpot, GitHub, GitLab or other web host
# Return to your Google Analytics page to check that your site is being tracked

View File

@@ -200,7 +200,7 @@ function tw_filteredtranscludeinline(state,silent) {
}
// based on markdown-it html_block()
var WidgetTagRegEx = [/^<\/?\$[a-zA-Z0-9\-\$\.]+(?=(\s|\/?>|$))/, /^$/];
var WidgetTagRegEx = [/^<\/?\$[a-zA-Z0-9\-\$]+(?=(\s|\/?>|$))/, /^$/];
function tw_block(state,startLine,endLine,silent) {
var i, nextLine, token, lineText,
pos = state.bMarks[startLine] + state.tShift[startLine],
@@ -364,7 +364,7 @@ function tw_prettyextlink(state,silent) {
return true;
}
var TWCloseTagRegEx = /<\/\$[A-Za-z0-9\-\$\.]+\s*>/gm;
var TWCloseTagRegEx = /<\/\$[A-Za-z0-9\-\$]+\s*>/gm;
function extendHtmlInline(origRule) {
return function(state,silent) {
if(origRule(state,silent)) {

View File

@@ -42,7 +42,6 @@ tags: $:/tags/PageTemplate
</ul>
\end
<$list filter="[<tv-config-static>!match[yes]]" variable="ignore">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/MenuBar]!has[draft.of]] -[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/topleftbar]] -[all[tiddlers+shadows]tag[$:/tags/TopRightBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/toprightbar]] +[limit[1]]" variable="listItem">
<nav class="tc-menubar tc-adjust-top-of-scroll">
<div class="tc-menubar-narrow">
@@ -67,4 +66,3 @@ tags: $:/tags/PageTemplate
</$list>
</nav>
</$list>
</$list>