From dbce514ed5adea9188526aa96c2e1a2da27c63f0 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Wed, 23 Aug 2023 18:33:30 +0200 Subject: [PATCH] Added comments to some turbo attributes --- .../WAAnchorTag.extension/instance/turbo..st | 6 ++++++ .../WAAnchorTag.extension/instance/turboAction..st | 3 ++- .../WAAnchorTag.extension/instance/turboTarget..st | 2 ++ .../WAAnchorTag.extension/instance/turbocallback..st | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbo..st diff --git a/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbo..st b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbo..st new file mode 100644 index 000000000..c9b4d1cdf --- /dev/null +++ b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbo..st @@ -0,0 +1,6 @@ +*Seaside-HotwireTurbo +turbo: aBoolean + + "data-turbo=""false"" disables Turbo Drive on links and forms including descendants. To reenable when an ancestor has opted out, use data-turbo=""true"". Be careful: when Turbo Drive is disabled, browsers treat link clicks as normal, but native adapters may exit the app." + + self dataAttributeAt: 'turbo' put: aBoolean \ No newline at end of file diff --git a/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboAction..st b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboAction..st index fbb61dae5..90c8fd65b 100644 --- a/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboAction..st +++ b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboAction..st @@ -1,5 +1,6 @@ *Seaside-HotwireTurbo turboAction: aString + (#('replace' 'advance') includes: aString) ifFalse: [ - self error. ]. + self error: 'Argument for turboAction must be either ''replace'' or ''advance''.' ]. self dataAttributeAt: 'turbo-action' put: aString \ No newline at end of file diff --git a/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboTarget..st b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboTarget..st index 69d48c541..0575ff01f 100644 --- a/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboTarget..st +++ b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turboTarget..st @@ -1,4 +1,6 @@ *Seaside-HotwireTurbo turboTarget: aString + "data-turbo-frame identifies the Turbo Frame to navigate. Refer to the Frames documentation for further details." + self dataAttributeAt: 'turbo-frame' put: aString \ No newline at end of file diff --git a/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbocallback..st b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbocallback..st index bc8de4202..c9c46c713 100644 --- a/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbocallback..st +++ b/repository/Seaside-HotwireTurbo.package/WAAnchorTag.extension/instance/turbocallback..st @@ -1,5 +1,6 @@ *Seaside-HotwireTurbo -turboCallback: aNiladicValuable +turboCallback: aNiladicValuable + aNiladicValuable argumentCount > 0 ifTrue: [ GRInvalidArgumentCount signal: 'Anchors expect a niladic callback.' ]. self url addField: (self storeCallback: (WATurboFrameActionCallback on: aNiladicValuable)) \ No newline at end of file