Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsexplain
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verified Software
jsexplain
Commits
76d42b64
Commit
76d42b64
authored
9 years ago
by
charguer
Committed by
Thomas Wood
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
logging_improved
parent
4affc880
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
driver.html
+8
-3
8 additions, 3 deletions
driver.html
navig-driver.js
+29
-23
29 additions, 23 deletions
navig-driver.js
with
37 additions
and
26 deletions
driver.html
+
8
−
3
View file @
76d42b64
...
...
@@ -106,10 +106,15 @@ Navigation:
<input
type=
"textbox"
id=
'navigation_step'
style=
"width:3em"
value=
"0"
/>
/
<span
id=
"navigation_total"
></span>
<input
type=
"button"
id=
'button_reset'
value=
"Reset"
/>
<input
type=
"button"
id=
'button_prev'
value=
"Prev"
/>
<input
type=
"button"
id=
'button_next'
value=
"Next"
/>
<input
type=
"button"
id=
'button_backward'
value=
"Backward"
/>
(4)
<input
type=
"button"
id=
'button_forward'
value=
"Forward"
/>
(6)
<span
style=
"width:3em"
>
</span>
<input
type=
"button"
id=
'button_previous'
value=
"Prev"
/>
(8)
<input
type=
"button"
id=
'button_next'
value=
"Next"
/>
(2)
<input
type=
"button"
id=
'button_finish'
value=
"Finish"
/>
(3)
Reach condition:
<input
type=
"textbox"
id=
'text_condition'
style=
"width:
30
em"
/>
<input
type=
"textbox"
id=
'text_condition'
style=
"width:
15
em"
/>
<input
type=
"button"
id=
'button_reach'
value=
"Reach"
/>
<span
id=
"reach_output"
></span>
</div>
...
...
This diff is collapsed.
Click to expand it.
navig-driver.js
+
29
−
23
View file @
76d42b64
...
...
@@ -178,17 +178,16 @@ $("#button_run").click(function() {
var
timeoutID
=
window
.
setTimeout
(
function
()
{
$
(
"
#run_output
"
).
html
(
""
);
},
1000
);
});
$
(
"
#button_reset
"
).
click
(
function
()
{
stepTo
(
0
);
});
$
(
"
#button_prev
"
).
click
(
function
()
{
stepTo
(
Math
.
max
(
0
,
tracer_pos
-
1
));
});
$
(
"
#button_reset
"
).
click
(
function
()
{
reset
();
});
// stepTo(0);
$
(
"
#button_backward
"
).
click
(
function
()
{
backward
();
});
// stepTo(Math.max(0, tracer_pos-1));
$
(
"
#button_forward
"
).
click
(
function
()
{
forward
()
});
// stepTo(Math.min(tracer_length-1, tracer_pos+1));
$
(
"
#button_
next
"
).
click
(
function
()
{
stepTo
(
Math
.
min
(
tracer_length
-
1
,
tracer_pos
+
1
)
);
});
$
(
"
#button_
previous
"
).
click
(
function
()
{
previous
()
});
$
(
"
#button_next
"
).
click
(
function
()
{
next
()
}
);
$
(
"
#button_finish
"
).
click
(
function
()
{
finish
()
});
// Assumes tracer_files to be an array of objects with two field:
...
...
@@ -205,7 +204,7 @@ function shared_step(dir) {
i
+=
dir
;
if
(
!
tracer_valid_pos
(
i
))
return
;
// not found, we don’t update the tracer position.
tracer_pos
=
i
;
stepTo
(
i
)
;
}
// dir is -1 or +1,
...
...
@@ -222,11 +221,11 @@ function shared_next(dir, target) {
}
while
(
true
)
{
if
(
!
tracer_valid_pos
(
i
))
{
tracer_pos
=
i
-
dir
;
// just before out of range
stepTo
(
i
-
dir
)
;
// just before out of range
return
;
// not found
}
if
(
i
!==
tracer_pos
&&
depth
===
target
)
{
tracer_pos
=
i
;
stepTo
(
i
)
;
return
;
}
var
ty
=
tracer_items
[
i
].
type
;
...
...
@@ -239,14 +238,16 @@ function shared_next(dir, target) {
}
}
function
res
tar
t
()
{
tracer_pos
=
0
;
}
function
step
()
{
shared_step
(
+
1
);
}
function
back
step
()
{
shared_step
(
-
1
);
}
function
next
()
{
shared_next
(
+
1
,
0
);
}
function
res
e
t
()
{
tracer_pos
=
0
;
updateSelection
();
}
function
forward
()
{
shared_step
(
+
1
);
}
function
back
ward
()
{
shared_step
(
-
1
);
}
function
previous
()
{
shared_next
(
-
1
,
0
);
}
function
next
()
{
shared_next
(
+
1
,
0
);
}
function
finish
()
{
shared_next
(
+
1
,
-
1
);
}
// --------------- Auxiliary ----------------
function
get_file_extension
(
filename
)
{
...
...
@@ -477,12 +478,17 @@ interpreter = CodeMirror.fromTextArea(document.getElementById('interpreter_code'
lineWrapping
:
true
,
readOnly
:
true
,
extraKeys
:
{
'
R
'
:
function
(
cm
)
{
restart
();
updateSelection
();
},
'
S
'
:
function
(
cm
)
{
step
();
updateSelection
();
},
'
B
'
:
function
(
cm
)
{
backstep
();
updateSelection
();
},
'
N
'
:
function
(
cm
)
{
next
();
updateSelection
();
},
'
P
'
:
function
(
cm
)
{
previous
();
updateSelection
();
},
'
F
'
:
function
(
cm
)
{
finish
();
updateSelection
();
}
'
R
'
:
function
(
cm
)
{
reset
();
},
'
F
'
:
function
(
cm
)
{
forward
();},
'
6
'
:
function
(
cm
)
{
forward
();},
'
B
'
:
function
(
cm
)
{
backward
();
},
'
4
'
:
function
(
cm
)
{
backward
();
},
'
P
'
:
function
(
cm
)
{
previous
();
},
'
8
'
:
function
(
cm
)
{
previous
();
},
'
N
'
:
function
(
cm
)
{
next
();
},
'
2
'
:
function
(
cm
)
{
next
();
},
'
H
'
:
function
(
cm
)
{
finish
();
},
'
3
'
:
function
(
cm
)
{
finish
();
}
},
});
interpreter
.
setSize
(
800
,
400
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment