Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
freecad_x3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
freecad_x3d
Commits
f1374268
Commit
f1374268
authored
Dec 18, 2015
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading tests
parent
e42e05c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
39 deletions
+26
-39
index.html
x3d_web_viewer/index.html
+6
-2
viewmodel.js
x3d_web_viewer/viewmodel.js
+20
-37
No files found.
x3d_web_viewer/index.html
View file @
f1374268
...
...
@@ -4,8 +4,6 @@
<link
rel=
"stylesheet"
href=
"bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"x3dom-1.7.0/x3dom.css"
>
<link
rel=
"stylesheet"
href=
"viewmodel.css"
>
<script
src=
"jquery-2.1.4.min.js"
></script>
<script
src=
"bootstrap/js/bootstrap.min.js"
></script>
<script
type=
'text/javascript'
src=
'x3dom-1.7.0/x3dom.js'
>
</script>
<script
src=
"viewmodel.js"
></script>
</head>
...
...
@@ -34,5 +32,11 @@
</div>
</div>
<div
id=
"test:5"
secretvalue=
'-4'
></div>
<script
src=
"jquery-2.1.4.min.js"
></script>
<script
src=
"bootstrap/js/bootstrap.min.js"
></script>
<script>
prerun
();
resize
();
</script>
</body>
</html>
\ No newline at end of file
x3d_web_viewer/viewmodel.js
View file @
f1374268
...
...
@@ -39,8 +39,14 @@ var moveTimeStamp;
var
showdefault
=
0
;
var
load_counter
=
0
;
var
load_limit
=
1
;
/*
$(function(){
prerun();
});
*/
function
prerun
(){
$
(
window
).
resize
(
function
(){
clearTimeout
(
resizeTimer
);
resizeTimer
=
window
.
setTimeout
(
resize
(),
250
);
...
...
@@ -110,12 +116,11 @@ $(function(){
$
(
"#main"
).
prepend
(
x3d_cnv
);
resize
();
var
element
=
document
.
getElementById
(
'x3d_canvas'
);
//on load: showAll()?!
var
showall
=
2
;
var
showall
=
8
;
$
(
document
).
load
(
function
(){
element
.
runtime
.
enterFrame
=
function
()
{
if
(
showall
==
1
)
{
...
...
@@ -287,37 +292,18 @@ $(function(){
$
(
"#v6"
).
css
({
cursor
:
"pointer"
}).
click
(
function
(){
element
.
runtime
.
showAll
(
"negZ"
);});
$
(
"#v7"
).
css
({
cursor
:
"pointer"
}).
click
(
function
(){
element
.
runtime
.
resetView
();});
});
var
load_counter
=
0
;
var
load_limit
=
1
;
}
function
run
(){
console
.
log
(
"run2"
);
var
top
=
$
(
"#topinline"
);
var
parts_unique
=
top
.
find
(
"Inline"
);
console
.
log
(
parts_unique
.
length
);
load_limit
=
parts_unique
.
length
;
parts_unique
.
load
(
function
(){
console
.
log
(
"showBOM"
);
load_counter
++
;
if
(
load_counter
==
load_limit
-
1
){
showBOM
();
resize
();
bindCanvas
();
}
});
if
(
load_limit
==
0
){
showBOM
();
resize
();
bindCanvas
();
}
console
.
log
(
"run3"
);
resize
();
showBOM
();
bindCanvas
();
}
function
showBOM
(){
//var bom = $("<ul>",{id:"bom",class:"list-group"}).css({
var
bom
=
$
(
"<table>"
,{
id
:
"bom"
}).
css
({
position
:
"absolute"
,
...
...
@@ -325,6 +311,8 @@ function showBOM(){
left
:
"705px"
});
resize
();
if
(
nobuttons
){
bom
.
css
({
display
:
"none"
...
...
@@ -382,12 +370,7 @@ function showBOM(){
//set default transparency?
parts_unique
.
find
(
"Material"
).
attr
(
"transparency"
,
0.1
);
parts_unique
.
find
(
"Material"
).
prop
(
"transparency"
,
0.1
);
parts_unique
.
load
(
function
(){
$
(
this
).
find
(
"Material"
).
attr
(
"transparency"
,
0.1
);
$
(
this
).
find
(
"Material"
).
prop
(
"transparency"
,
0.1
);
});
parts_unique
.
each
(
function
(
i
){
var
part
=
$
(
this
);
var
tmp_nsn
=
this
.
getAttribute
(
"nameSpaceName"
);
...
...
@@ -483,7 +466,7 @@ function showBOM(){
});
$
(
"body"
).
append
(
bom
);
resize
();
}
var
blockclick
=
false
;
...
...
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