Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
74
Issues
74
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
0a639676
Verified
Commit
0a639676
authored
Apr 11, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update iTasks.Extensions.Clock to new JS interface; fix BasicAPIExamples
parent
6b552a7a
Pipeline
#21046
failed with stage
in 1 minute and 54 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
Examples/BasicAPIExamples.prj.default
Examples/BasicAPIExamples.prj.default
+5
-2
Libraries/iTasks/Extensions/Clock.icl
Libraries/iTasks/Extensions/Clock.icl
+18
-12
No files found.
Examples/BasicAPIExamples.prj.default
View file @
0a639676
...
...
@@ -27,7 +27,8 @@ Global
Time: False
Stack: False
Dynamics: True
DescExL: False
GenericFusion: False
DescExL: True
Output
Output: ShowConstructors
Font: Courier
...
...
@@ -42,7 +43,9 @@ Global
ResourceSource:
GenerateDLL: False
ExportedNames:
StripByteCode: False
StripByteCode: True
KeepByteCodeSymbols: True
PrelinkByteCode: True
Paths
Path: {Project}
Path: {Project}/Ligretto
...
...
Libraries/iTasks/Extensions/Clock.icl
View file @
0a639676
...
...
@@ -8,6 +8,7 @@ import iTasks.UI.JS.Interface
import
iTasks
.
Extensions
.
DateTime
import
qualified
Data
.
Map
as
DM
,
Data
.
Tuple
,
Data
.
Error
import
Text
.
HTML
,
Data
.
Func
import
StdEnv
derive
JSONEncode
AnalogClock
derive
JSONDecode
AnalogClock
...
...
@@ -54,20 +55,25 @@ where
#
world
=
(
me
.#
"onAttributeChange"
.=
jsOnAttributeChange
)
world
=
world
onAttributeChange
me
args
world
|
jsArgToString
(
args
!!
0
)
==
"diff"
#
(
changes
,
world
)
=
fromJSArray
(
toJSVal
(
args
!!
1
))
id
world
#
world
=
foldl
(
updateHand
me
)
world
changes
=
(
jsNull
,
world
)
onAttributeChange
me
{[
0
]=
name
,[
1
]=
changes
}
world
|
jsValToString
name
==
Just
"diff"
#
(
length
,
world
)
=
changes
.#
"length"
.?
world
#
length
=
jsValToInt`
0
length
#
world
=
updateHand
me
(
changes
.#
0
)
world
|
length
<
2
=
world
#
world
=
updateHand
me
(
changes
.#
1
)
world
|
length
<
3
=
world
#
world
=
updateHand
me
(
changes
.#
2
)
world
=
world
|
otherwise
=
(
jsNull
,
jsTrace
"Unknown attribute change"
world
)
=
jsTrace
"Unknown attribute change"
world
updateHand
me
world
change
#
(
which
,
world
)
=
appFst
jsValToInt
(.?
(
change
.#
0
)
world
)
#
(
value
,
world
)
=
appFst
jsValToInt
(.?
(
change
.#
1
)
world
)
#
(
svgEl
,
world
)
=
.?
(
me
.#
"domEl"
.#
"children"
.#
0
)
world
#
(
handEl
,
world
)
=
.?
(
svgEl
.#
"children"
.#
(
13
+
which
))
world
//The first 13 svg elements are the clock face and markers
#
(_,
world
)
=
(
handEl
.#
"setAttribute"
.$
[
toJSArg
"transform"
,
toJSArg
(
"rotate("
+++
toString
(
degrees
which
value
-
90
)+++
" 50 50)"
)]
)
world
updateHand
me
change
world
#
(
which
,
world
)
=
appFst
(
jsValToInt`
0
)
(
change
.#
0
.?
world
)
#
(
value
,
world
)
=
appFst
(
jsValToInt`
0
)
(
change
.#
1
.?
world
)
#
svgEl
=
me
.#
"domEl.children"
.#
0
#
(
handEl
,
world
)
=
svgEl
.#
"children"
.#
(
13
+
which
)
.?
world
//The first 13 svg elements are the clock face and markers
#
world
=
(
handEl
.#
"setAttribute"
.$!
(
"transform"
,
"rotate("
+++
toString
(
degrees
which
value
-
90
)+++
" 50 50)"
)
)
world
=
world
degrees
0
v
=
6
*
v
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment