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
2e72e1c3
Commit
2e72e1c3
authored
8 years ago
by
Thomas Wood
Browse files
Options
Downloads
Patches
Plain Diff
Use single eval panel, rather than multiple
parent
f67e8a4f
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
generator/tests/jsref/Translate_syntax.js
+3
-2
3 additions, 2 deletions
generator/tests/jsref/Translate_syntax.js
navig-driver.js
+16
-3
16 additions, 3 deletions
navig-driver.js
with
19 additions
and
5 deletions
generator/tests/jsref/Translate_syntax.js
+
3
−
2
View file @
2e72e1c3
...
@@ -2,8 +2,9 @@ var Translate_syntax = {
...
@@ -2,8 +2,9 @@ var Translate_syntax = {
eval_counter
:
0
,
eval_counter
:
0
,
parse_esprima
:
function
(
strictness
,
src
)
{
parse_esprima
:
function
(
strictness
,
src
)
{
try
{
try
{
// TODO Fixup line numbers for eval context
// EVAL: Uncomment line below to enable multiple eval tabs
return
Some
(
parseSource
(
src
,
"
_eval_
"
+
Translate_syntax
.
eval_counter
++
,
true
));
//return Some(parseSource(src, "_eval_" + Translate_syntax.eval_counter++, true));
return
Some
(
parseSource
(
src
,
"
_eval_
"
,
true
));
}
catch
(
e
)
{
}
catch
(
e
)
{
return
None
();
return
None
();
}
}
...
...
This diff is collapsed.
Click to expand it.
navig-driver.js
+
16
−
3
View file @
2e72e1c3
...
@@ -117,18 +117,33 @@ function newSourceDoc(name, text, readOnly) {
...
@@ -117,18 +117,33 @@ function newSourceDoc(name, text, readOnly) {
.
text
(
name
)
.
text
(
name
)
.
click
(
e
=>
selectSourceDoc
(
e
.
target
.
textContent
))
.
click
(
e
=>
selectSourceDoc
(
e
.
target
.
textContent
))
.
appendTo
(
'
#source_tabs
'
);
.
appendTo
(
'
#source_tabs
'
);
if
(
name
===
'
_eval_
'
)
{
tab
.
hide
();
}
source_docs
[
name
].
doc_name
=
name
;
source_docs
[
name
].
tab
=
tab
;
source_docs
[
name
].
tab
=
tab
;
source_docs
[
name
].
readOnly
=
Boolean
(
readOnly
);
source_docs
[
name
].
readOnly
=
Boolean
(
readOnly
);
}
}
return
source_docs
[
name
];
return
source_docs
[
name
];
}
}
function
selectSourceDocFromLoc
(
loc
)
{
var
name
=
loc
.
file
;
if
(
name
===
'
_eval_
'
)
{
source_docs
[
'
_eval_
'
].
tab
.
show
();
source_docs
[
'
_eval_
'
].
setValue
(
loc
.
sourceText
);
}
var
old_doc
=
selectSourceDoc
(
loc
.
file
);
if
(
old_doc
.
doc_name
===
"
_eval_
"
&&
name
!==
"
_eval_
"
)
{
source_docs
[
'
_eval_
'
].
tab
.
hide
();
}
}
// Switches current source doc
// Switches current source doc
function
selectSourceDoc
(
name
)
{
function
selectSourceDoc
(
name
)
{
var
old_doc
=
source
.
swapDoc
(
source_docs
[
name
]);
var
old_doc
=
source
.
swapDoc
(
source_docs
[
name
]);
if
(
old_doc
.
tab
)
old_doc
.
tab
.
removeClass
(
'
file_item_current
'
);
if
(
old_doc
.
tab
)
old_doc
.
tab
.
removeClass
(
'
file_item_current
'
);
source_docs
[
name
].
tab
.
addClass
(
'
file_item_current
'
);
source_docs
[
name
].
tab
.
addClass
(
'
file_item_current
'
);
source
.
setOption
(
'
readOnly
'
,
source_docs
[
name
].
readOnly
);
source
.
setOption
(
'
readOnly
'
,
source_docs
[
name
].
readOnly
);
return
old_doc
;
}
}
// Sets the initial source doc
// Sets the initial source doc
...
@@ -1141,9 +1156,7 @@ function updateSelection() {
...
@@ -1141,9 +1156,7 @@ function updateSelection() {
// source panel
// source panel
source_loc_selected
=
item
.
source_loc
;
source_loc_selected
=
item
.
source_loc
;
newSourceDoc
(
item
.
source_loc
.
file
,
item
.
source_loc
.
sourceText
);
selectSourceDocFromLoc
(
source_loc_selected
);
selectSourceDoc
(
item
.
source_loc
.
file
);
updateSelectionInCodeMirror
(
source
,
source_loc_selected
);
updateSelectionInCodeMirror
(
source
,
source_loc_selected
);
// console.log(source_loc_selected);
// console.log(source_loc_selected);
...
...
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