-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9276db7
commit bdb7255
Showing
6 changed files
with
11 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -820,14 +820,14 @@ let script = | |
let html = RenderView.AsString.htmlNode Script.minified | ||
Expect.equal | ||
html | ||
"""<script src="https://unpkg.com/[email protected]alpha1" integrity="sha384-KGfWLOUs4pJD2kawhHdm4vgr/cEAofjPPagKWIZ/YnYDQ2bcthCK5LRfBMr7zco+" crossorigin="anonymous"></script>""" | ||
"""<script src="https://unpkg.com/[email protected]alpha2" integrity="sha384-291pOdLqD0RmU6d5pyz/xmHmZZPhEv465X4AJDWvc8n0KrWrD65qaf2fk0xmsrJe" crossorigin="anonymous"></script>""" | ||
"Minified script tag is incorrect" | ||
} | ||
test "unminified succeeds" { | ||
let html = RenderView.AsString.htmlNode Script.unminified | ||
Expect.equal | ||
html | ||
"""<script src="https://unpkg.com/[email protected]alpha1/dist/htmx.js" integrity="sha384-2kZGZBH6t8d5fRh0/kvj/fwwVwnnTpwcLOhp0t8F0/mXWF5M5iPbo/ygeFN2cFbG" crossorigin="anonymous"></script>""" | ||
"""<script src="https://unpkg.com/[email protected]alpha2/dist/htmx.js" integrity="sha384-4Owd2qj8qFNBZ8QiR2ItYnNuMGgpOxaDT1uuRJXziuB1lvvKGYA/Lxy/oVM6q3h1" crossorigin="anonymous"></script>""" | ||
"Unminified script tag is incorrect" | ||
} | ||
] | ||
|
@@ -979,18 +979,6 @@ let renderFragment = | |
] | ||
] | ||
|
||
#nowarn "44" | ||
|
||
/// Tests for the HtmxAttrs module | ||
let deprecatedAttributes = | ||
testList "Deprecated Attributes" [ | ||
test "_hxOn succeeds" { | ||
let newLine = "\n" | ||
strong [ _hxOn "submit: alert('oops')\nclick: alert('howdy!')" ] [] | ||
|> shouldRender $"""<strong hx-on="submit: alert('oops'){newLine}click: alert('howdy!')"></strong>""" | ||
} | ||
] | ||
|
||
/// All tests in this module | ||
let allTests = | ||
testList "ViewEngine.Htmx" [ | ||
|
@@ -1004,5 +992,4 @@ let allTests = | |
attributes | ||
script | ||
renderFragment | ||
deprecatedAttributes | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -317,8 +317,6 @@ module HxVals = | |
/// Create values from a list of key/value pairs | ||
let From = toJson | ||
|
||
open System | ||
|
||
/// Attributes and flags for htmx | ||
[<AutoOpen>] | ||
module HtmxAttrs = | ||
|
@@ -368,10 +366,6 @@ module HtmxAttrs = | |
/// Overrides a previous `hx-boost` | ||
let _hxNoBoost = attr "hx-boost" "false" | ||
|
||
/// Attach an event handler for DOM or htmx events | ||
[<Obsolete "This will be removed in htmx 2; use _hxOnEvent or _hxOnHxEvent instead">] | ||
let _hxOn = attr "hx-on" | ||
|
||
/// Attach an event handler for DOM events | ||
let _hxOnEvent evtName = | ||
attr $"hx-on:%s{evtName}" | ||
|
@@ -450,14 +444,14 @@ module Script = | |
|
||
/// Script tag to load the minified version from unpkg.com | ||
let minified = | ||
script [ _src "https://unpkg.com/[email protected]alpha1" | ||
_integrity "sha384-KGfWLOUs4pJD2kawhHdm4vgr/cEAofjPPagKWIZ/YnYDQ2bcthCK5LRfBMr7zco+" | ||
script [ _src "https://unpkg.com/[email protected]alpha2" | ||
_integrity "sha384-291pOdLqD0RmU6d5pyz/xmHmZZPhEv465X4AJDWvc8n0KrWrD65qaf2fk0xmsrJe" | ||
_crossorigin "anonymous" ] [] | ||
|
||
/// Script tag to load the unminified version from unpkg.com | ||
let unminified = | ||
script [ _src "https://unpkg.com/[email protected]alpha1/dist/htmx.js" | ||
_integrity "sha384-2kZGZBH6t8d5fRh0/kvj/fwwVwnnTpwcLOhp0t8F0/mXWF5M5iPbo/ygeFN2cFbG" | ||
script [ _src "https://unpkg.com/[email protected]alpha2/dist/htmx.js" | ||
_integrity "sha384-4Owd2qj8qFNBZ8QiR2ItYnNuMGgpOxaDT1uuRJXziuB1lvvKGYA/Lxy/oVM6q3h1" | ||
_crossorigin "anonymous" ] [] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters