Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
StrandLab2.net
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Strand Lab
StrandLab2.net
Commits
9eba09d3
Commit
9eba09d3
authored
5 years ago
by
Nicole Finks
Browse files
Options
Downloads
Patches
Plain Diff
[update logic]
parent
3eb88fb5
2 merge requests
!9
Develop
,
!8
Repository
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
layouts/custom/repository.html
+33
-9
33 additions, 9 deletions
layouts/custom/repository.html
static/js/repositoryJS.js
+63
-1
63 additions, 1 deletion
static/js/repositoryJS.js
with
96 additions
and
10 deletions
layouts/custom/repository.html
+
33
−
9
View file @
9eba09d3
...
...
@@ -63,26 +63,36 @@
<body>
<script>
$
(
document
).
ready
(
function
(){
var
results
=
[];
var
data
=
{{
index
.
Site
.
Data
.
scRNAseq_huPr_D
.
updated_cleaned_json
}};
/*$(document).ready(function(){
//declare global vars
var results = []; //array of records that match the filters
var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }};
var numbers = $("#filter").find(".numbers"); //array of all the places we want to update with the # of records that match the filters
var filters = [];
//filtering function
$("input").click(function(){
// get specific vars
var name = $(this).attr("name");
var value = $(this).attr("value");
var id = name + value;
id= id.replace(/\s+/g, '');
// if checkbox is checked: add filter values to filter
if ($(this).prop("checked") == true){
var i;
for (i =0; i < data.length; i++){
if( data[i][name] == value){
results.push(data[i]);
$
(
'
#
'
+
id
).
text
(
result
s
.
length
);
$("#"
+id).text
[number
s.length
];
}
}
}
//if checkbox is not checked: remove filter values from filter
else if ($(this).prop("checked") == false){
var i;
for (i=0; i<results.length; i++){
...
...
@@ -91,15 +101,29 @@ $(document).ready(function(){
i--;
}
}
$
(
'
#
'
+
id
).
text
(
results
.
length
);
}
//check data to pull all records that match the current filters
var i;
var j;
for (i = 0; i<numbers.length; i++){
var count = 0;
$('#displayFiles').text(numbers.length);
for (j=0; j <results.length; j++){
var id2 = results[j][name]. + results[j][name];
// id2 = id2.replace(/\s+/g, '');
// $('#displayFiles').text(id2);
if (id2 == numbers[i][id]){
count++;
$('#displayFiles').text(count);
}
}
}
});
});
*/
</script>
</body>
...
...
This diff is collapsed.
Click to expand it.
static/js/repositoryJS.js
+
63
−
1
View file @
9eba09d3
//$(document).ready(function(){
//* Loop through all dropdown buttons to toggle between hiding and showing its dropdown content - This allows the user to have multiple dropdowns without any conflict */
var
dropdown
=
document
.
getElementsByClassName
(
"
dropdown-btn
"
);
var
i
;
...
...
@@ -16,6 +19,65 @@ for (i = 0; i < dropdown.length; i++) {
//* Get files matching filters*/
/* Get files matching filters
//declare global vars
var results = []; //array of records that match the filters
var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }};
var numbers = $("#filter").find(".numbers"); //array of all the places we want to update with the # of records that match the filters
var filters = [];//array of current filters
//filtering function
$("input").click(function(){
// get specific vars
var name = $(this).attr("name");
var value = $(this).attr("value");
var id = name + value;
id= id.replace(/\s+/g, '');
var filterVar = {"name": name, "value":value, "id":id};
// if checkbox is checked: add filter values to filter
if ($(this).prop("checked") == true){
filters.push(filterVar);
/* var i;
for (i =0; i < data.length; i++){
if( data[i][name] == value){
results.push(data[i]);
$("#"+id).text[numbers.length];
}
}*/
/* }
//if checkbox is not checked: remove filter values from filter
else if ($(this).prop("checked") == false){
var i;
for (i=0; i<filter.length; i++){
if (filter[i][id]== id){
filter.splice(i, 1);
i--;
}
}
}
//check data to pull all records that match the current filters
var i;
var j;
for (i = 0; i<filters.length; i++){
var count = 0;
$('#displayFiles').text(numbers.length);
for (j=0; j <data.length; j++){
// var id2 = results[j][name]. + results[j][name];
// id2 = id2.replace(/\s+/g, '');
// $('#displayFiles').text(id2);
if (id2 == numbers[i][id]){
count++;
$('#displayFiles').text(count);
}
}
}
});
});
*/
This diff is collapsed.
Click to expand it.
Preview
0%
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