Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Seniors
craig1617
Commits
7ca92a9e
Commit
7ca92a9e
authored
Nov 27, 2016
by
Craig Earley
Browse files
basic html and js for the user-facing side
parent
09daa4fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/user.js
0 → 100644
View file @
7ca92a9e
var
startTime
;
var
stopTime
;
var
duration
;
var
starturl
;
var
stopurl
;
var
markers
=
[];
function
eventInit
()
{
var
deferred
=
$
.
Deferred
();
console
.
log
(
"
Setting up
"
);
deferred
.
resolve
();
return
deferred
;
};
/* parse the URL, handle problems with it, do exception handling, etc. */
function
checkURL
(
url_start
){
new_url
=
"
https://
"
+
url_start
;
return
new_url
;
}
/* wrapper for the timing function in case it needs modified */
function
timestamp
(){
return
Date
.
now
();
}
$
(
window
).
load
(
function
()
{
$
(
"
#user-button
"
).
click
(
function
(
event
){
startTime
=
timestamp
();
event
.
preventDefault
();
start_url
=
$
(
"
#input-text
"
).
val
();
//a lot to check in the URL, but for now assume it's good
start_url
=
checkURL
(
start_url
);
window
.
open
(
start_url
);
// if (start_url.toLowerCase() == "advogados"){
// window.location.href = "https://www.google.com";}
// else{console.log("entered: " + start_url);}
// window.open(start_url);
stopTime
=
timestamp
();
duration
=
stopTime
-
startTime
;
console
.
log
(
"
started
"
+
startTime
);
console
.
log
(
"
stopped
"
+
stopTime
);
console
.
log
(
"
duration
"
+
duration
+
"
ms
"
);
});
// $("#reset-button").click(resetform);
});
user.html
View file @
7ca92a9e
<!DOCTYPE html>
<html>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/style.css"
>
<script
src=
"js/lib/jquery-2.1.4.min.js"
></script>
<script
src=
"js/lib/bootstrap.min.js"
></script>
<script
src=
"js/lib/chosen.jquery.min.js"
></script>
<script
src=
"js/lib/leaflet.js"
></script>
<script
src=
"js/lib/flot.all.min.js"
></script>
<script
src=
"js/lib/hashids.min.js"
></script>
<script
src=
"js/lib/jquery-ui.min.js"
></script>
<script
src=
"js/lib/jquery.multiselect.js"
></script>
<script
src=
"js/user.js"
></script>
<body>
<!---
Should be some JavaScript:
- on click:
-- open url
-- note start time
-- wait
-- check url with every new url
-- when stop url: note stop time, display alert, stop tracking
--->
<h1>
User-Side Interface
</h1>
<form>
<p>
Your URL:
<
/p
>
<input
name=
"paragraph_text"
id=
"input"
cols=
"50"
rows=
"10"
></textarea
>
<br
>
<form
id=
"input-form"
method=
"get"
>
Your URL:
<
input
type=
"text"
id=
"input-text"
cols=
"50"
rows=
"10"
/><br
>
<input
type=
"button"
id=
"user-button"
value=
"Start Test"
></button
>
<!--button type="button" id="reset-button" value="Reset"></button--
>
<button
type=
"button"
onclick=
"window.open('https://www.google.com').style.display='block'"
>
Start Test!
</button>
<input
type=
"reset"
>
</form>
</body>
...
...
@@ -60,3 +56,4 @@ $("#go_to_url").on("submit", function(event){
});
</script>
--->
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