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
0c2397ec
Commit
0c2397ec
authored
Jul 03, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide dirs: .xxx and _xxx, 'showall' to reveal
parent
94c70f40
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
42 deletions
+76
-42
index.js
js/index.js
+23
-2
list.php
list.php
+53
-40
No files found.
js/index.js
View file @
0c2397ec
...
...
@@ -6,12 +6,18 @@ var markers = [];
$
(
function
(){
//init();
parseURL
();
init_maps
();
var
url
=
'list.php'
;
if
(
SETTINGS
.
showall
){
url
+=
"?showall"
;
}
$
.
ajax
({
url
:
"list.php"
,
url
:
url
,
success
:
function
(
response
){
List
=
response
;
...
...
@@ -24,6 +30,21 @@ $(function(){
});
var
SETTINGS
=
{
'showall'
:
false
};
// no comments
function
parseURL
(){
var
parameters
=
location
.
href
.
replace
(
/
\?
/ig
,
"&"
).
split
(
"&"
);
for
(
var
i
=
0
;
i
<
parameters
.
length
;
i
++
)
parameters
[
i
]
=
parameters
[
i
].
split
(
"="
);
for
(
var
i
=
1
;
i
<
parameters
.
length
;
i
++
)
{
switch
(
parameters
[
i
][
0
])
{
case
"showall"
:
SETTINGS
.
showall
=
true
;
break
;
}
}
}
function
parse_list
(
res
){
var
index
=
0
;
...
...
list.php
View file @
0c2397ec
...
...
@@ -5,7 +5,13 @@ $base = "models";
$THUMBNAME
=
"thumb.jpeg"
;
$READMENAME
=
"README.txt"
;
$models
=
selective_scandir
(
$base
);
$showall
=
false
;
if
(
isset
(
$_GET
[
'showall'
])){
$showall
=
true
;
}
$models
=
selective_scandir
(
$base
,
false
);
$res
=
""
;
foreach
(
$models
as
$model
){
...
...
@@ -13,7 +19,7 @@ foreach($models as $model){
$model_path
=
"
$base
/
$model
"
;
$thumb
=
"
$model_path
/
$THUMBNAME
"
;
$versions
=
selective_scandir
(
$model_path
);
$versions
=
selective_scandir
(
$model_path
,
$showall
);
// create thumb
create_thumbnail
(
$model_path
,
$versions
,
$thumb
);
...
...
@@ -51,7 +57,7 @@ return_xml($res);
//functions
function
selective_scandir
(
$path
){
function
selective_scandir
(
$path
,
$showall
){
$results
=
Array
();
...
...
@@ -59,10 +65,17 @@ function selective_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
;
}
...
...
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