Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eDisplay
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Green Science
eDisplay
Commits
3d5c544c
Commit
3d5c544c
authored
5 years ago
by
Lillian Gray
Browse files
Options
Downloads
Patches
Plain Diff
Unify permalink generation & copy #4
parent
23f2c1b5
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
index.html
+3
-7
3 additions, 7 deletions
index.html
js/main.js
+7
-16
7 additions, 16 deletions
js/main.js
with
10 additions
and
23 deletions
index.html
+
3
−
7
View file @
3d5c544c
...
@@ -40,14 +40,10 @@
...
@@ -40,14 +40,10 @@
<div
id=
"site-options"
class=
"flex-parent"
>
<div
id=
"site-options"
class=
"flex-parent"
>
<a
id=
"csvDownload"
href=
"#"
><button
class=
"csvBtn"
type=
"button"
>
Download CSV
</button></a>
<a
id=
"csvDownload"
href=
"#"
><button
class=
"csvBtn"
type=
"button"
>
Download CSV
</button></a>
<
form
id=
"plink-form"
>
<
div
id=
"plink-form"
>
<input
id=
"plink"
type=
"text"
value=
""
></input>
<input
id=
"plink"
type=
"text"
value=
""
></input>
<input
class=
"getPlink"
type=
"button"
value=
"Get Permalink"
<button
class=
"getPlink"
type=
"button"
onclick=
genPermalink();
>
Get Permalink
</button>
onclick=
"
</div>
document.getElementById('plink').value = genPermalink();
document.getElementById('plink').select();
"
></input>
</form>
</div>
</div>
<div
id=
"site-details"
>
<div
id=
"site-details"
>
...
...
This diff is collapsed.
Click to expand it.
js/main.js
+
7
−
16
View file @
3d5c544c
...
@@ -213,23 +213,14 @@ function genPermalink(){
...
@@ -213,23 +213,14 @@ function genPermalink(){
if
(
!
whichBuildings
[
i
])
if
(
!
whichBuildings
[
i
])
disabledBuildings
+=
i
;
disabledBuildings
+=
i
;
}
}
return
URLComponents
[
0
]
+
"
?
"
+
startStr
+
"
+
"
+
endStr
+
"
+
"
+
disabledBuildings
;
var
permalink
=
URLComponents
[
0
]
+
"
?
"
+
startStr
+
"
+
"
+
endStr
+
"
+
"
+
disabledBuildings
;
}
// Browser notifying permalink has been copied
$
(
'
.getPlink
'
).
click
(
function
(
event
)
{
$
(
'
#plink
'
).
focus
();
$
(
'
#plink
'
).
select
();
try
{
var
successful
=
document
.
execCommand
(
'
copy
'
);
var
message
=
successful
?
'
successfully
'
:
'
unsuccessfully
'
;
window
.
alert
(
"
Link copied successfully and ready to be pasted!
"
)
}
catch
(
err
)
{
console
.
log
(
"
link copying failed
"
);
}
});
//Copies permalink and puts permalink in text box next to the button
var
plinkTextField
=
document
.
getElementById
(
'
plink
'
);
plinkTextField
.
value
=
permalink
;
plinkTextField
.
select
();
document
.
execCommand
(
'
copy
'
);
}
$
(
'
#csvDownload
'
).
click
(
function
()
{
$
(
'
#csvDownload
'
).
click
(
function
()
{
//prepares and then downloads a csv file based on what is currently shown in the chart
//prepares and then downloads a csv file based on what is currently shown in the chart
...
...
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