-
Notifications
You must be signed in to change notification settings - Fork 0
/
Client.fs
46 lines (37 loc) · 1.5 KB
/
Client.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
namespace Tests
open WebSharper
open WebSharper.WinJS
[<JavaScript; Require(typeof<Resources.DarkTheme>)>]
module Client =
open WebSharper.JQuery
open WebSharper.JavaScript
type Resources = {
Tiles : WinJS.Binding.List.T<Tile>
Images : WinJS.Binding.List.T<Image>
Settings : WinJS.Binding.List.T<Setting>
ApplicationSettings : WinJS.Binding.List.T<Setting>
}
let Main =
Application.OnReady <| fun () ->
WinJS.Namespace.define(
"Resources",
{
Tiles = WinJS.Binding.List.Create Resources.Tiles
Images = WinJS.Binding.List.Create Resources.Images
Settings = WinJS.Binding.List.Create Resources.Settings
ApplicationSettings = WinJS.Binding.List.Create Resources.ApplicationSettings
} |> As
)
|> ignore
(JQuery.Of "#toggleAll").Click (fun _ _ ->
(JQuery.Of ".win-toggleswitch").Each (fun element _ ->
let control : WinJS.UI.ToggleSwitch.T = element ? winControl
control._checked <- not control._checked
)
|> ignore
)
|> ignore
WinJS.UI.processAll()._done (fun _ ->
(JQuery.Of "body").Css("visibility", "visible") |> As
)
WinJS.Application.start()