mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-23 03:14:40 +00:00
Compare commits
18 Commits
google-ana
...
bidi-impro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd16fbc685 | ||
|
|
21a75e5c14 | ||
|
|
5f02101c96 | ||
|
|
7ca1a9a1cb | ||
|
|
ed27574c81 | ||
|
|
5723a7fbc0 | ||
|
|
bc6739907f | ||
|
|
95befb8751 | ||
|
|
46f448faef | ||
|
|
cc6895b291 | ||
|
|
11f4277fc9 | ||
|
|
b707950c5e | ||
|
|
a58524611a | ||
|
|
371649ebd0 | ||
|
|
e4966c2796 | ||
|
|
b83c1d160f | ||
|
|
b833103428 | ||
|
|
265e7a2da2 |
@@ -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: [
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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>→ ]addsuffix<ie>addsuffix[</dd>]]}}}/>
|
||||
`$eg$`
|
||||
<$macrocall $name=".if" cond="""$ie$""" then="""<dd>→ $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>
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
title: $:/SiteTitle
|
||||
|
||||
Moja TiddlyWiki
|
||||
Moja ~TiddlyWiki
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user