Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
b480ea74
Commit
b480ea74
authored
Aug 23, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
page for selecting models
parent
827d0e58
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
0 deletions
+142
-0
select.css
js/select.css
+0
-0
select.js
js/select.js
+45
-0
select.html
select.html
+27
-0
select.php
select.php
+70
-0
No files found.
js/select.css
0 → 100644
View file @
b480ea74
js/select.js
0 → 100644
View file @
b480ea74
$
(
function
(){
var
url
=
'select.php'
;
$
.
ajax
({
url
:
url
,
success
:
function
(
response
){
List
=
response
;
parse_list
(
response
);
}
});
});
function
parse_list
(
res
){
$
(
res
).
find
(
"set"
).
each
(
function
(){
var
name
=
$
(
this
).
attr
(
"name"
);
var
mlist
=
$
(
"<ul>"
,{
id
:
"s_"
+
name
});
$
(
"#content"
).
append
(
"<h3>"
+
name
+
"</h3>"
).
append
(
mlist
);
$
(
this
).
find
(
"model"
).
each
(
function
(){
var
mname
=
$
(
this
).
attr
(
"name"
);
var
item
=
[
'<li>'
,
' <a href=
\'
viewer.html?basepath=models/_all/'
+
name
+
'&path='
+
mname
+
'
\'
>'
+
mname
+
'</a>'
,
'</li>'
].
join
(
'
\
n'
);
mlist
.
append
(
$
(
item
));
});
});
}
\ No newline at end of file
select.html
0 → 100644
View file @
b480ea74
<!DOCTYPE HTML>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<title>
x3d models index
</title>
<!-- build:css css/index.css -->
<!-- bower:css -->
<!-- endbower -->
<link
rel=
'stylesheet'
type=
'text/css'
href=
'js/leaflet/leaflet.css'
></link>
<link
rel=
'stylesheet'
type=
'text/css'
href=
'js/select.css'
></link>
<!-- endbuild -->
<!-- build:js js/index.js -->
<!-- bower:js -->
<script
src=
'bower_components/jquery/dist/jquery.js'
></script>
<!-- endbower -->
<script
type=
'text/javascript'
src=
'js/jquery-ui/jquery-ui.js'
></script>
<script
type=
'text/javascript'
src=
'js/select.js'
></script>
<!-- endbuild -->
</head>
<body>
<div
id=
"content"
>
</div>
</body>
</html>
select.php
0 → 100644
View file @
b480ea74
<?php
$base
=
"models/_all"
;
$showall
=
false
;
if
(
isset
(
$_GET
[
'showall'
])){
$showall
=
true
;
}
$series
=
selective_scandir
(
$base
,
false
);
$res
=
""
;
foreach
(
$series
as
$set
){
$models_path
=
"
$base
/
$set
"
;
$models
=
selective_scandir
(
$models_path
,
$showall
);
$res
.=
"<set name='
$set
'>
\n
"
;
foreach
(
$models
as
$model
){
$res
.=
"
\t
<model name='
$model
'>
\n
"
;
$res
.=
"
\t
</model>
\n
"
;
}
$res
.=
"</set>
\n
"
;
}
return_xml
(
$res
);
//functions
function
selective_scandir
(
$path
,
$showall
){
$results
=
Array
();
$contents
=
scandir
(
$path
);
foreach
(
$contents
as
$item
){
if
(
$item
!=
'.'
&&
$item
!=
'..'
&&
is_dir
(
"
$path
/
$item
"
)){
if
(
$showall
){
array_push
(
$results
,
$item
);
}
else
{
if
((
$item
[
0
]
!=
"."
)
&&
(
$item
[
0
]
!=
"_"
)){
array_push
(
$results
,
$item
);
}
}
}
}
return
$results
;
}
function
return_xml
(
$str
){
$str
=
"<?xml version='1.0' standalone='yes'?>
\n
<Document>
\n
$str
</Document>"
;
header
(
"Content-Type: text/xml"
);
header
(
"Content-Length: "
.
strlen
(
$str
)
.
"
\n
"
);
header
(
"Pragma: no-cache
\n
"
);
printf
(
$str
);
}
?>
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