Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDD97 Web Programming
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lawrence Zawahri
TDDD97 Web Programming
Commits
2549323c
Commit
2549323c
authored
3 years ago
by
Lawrence Zawahri
Browse files
Options
Downloads
Patches
Plain Diff
step 1 done
parent
29dc190d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Lab_3/Twidder/static/client.js
+16
-26
16 additions, 26 deletions
Lab_3/Twidder/static/client.js
with
16 additions
and
26 deletions
Lab_3/Twidder/static/client.js
+
16
−
26
View file @
2549323c
...
...
@@ -8,8 +8,6 @@ var curr_page = "";
// source "/Users/lorenzo/OneDrive - Linköpings universitet/Skola/DI3B/TDDD97/virtualenv/bin/activate"
// - - - - - Init Request Objects - - - - - //
// Sign In Request Object
...
...
@@ -75,25 +73,20 @@ signUpRequest.onreadystatechange = function () {
errorMessage
.
innerHTML
=
"
You have signed up
"
;
}
else
if
(
this
.
status
==
400
)
{
// Todo - implement
errorMessage
.
innerHTML
=
"
Enter the data in the correct format
"
;
}
else
if
(
this
.
status
==
401
)
{
// Todo - implement
errorMessage
.
innerHTML
=
"
Enter the data in the correct format
"
;
console
.
log
(
'
got this: 401
'
);
errorMessage
.
innerHTML
=
"
Error 400: Enter the data in the correct format
"
;
}
else
if
(
this
.
status
==
409
)
{
// Todo - implement
console
.
log
(
'
got this: 409
'
)
;
errorMessage
.
innerHTML
=
"
Error 409: User already exists
"
;
}
else
if
(
this
.
status
==
500
)
{
// Todo - implement
console
.
log
(
'
got this: 500
'
)
;
errorMessage
.
innerHTML
=
"
Error 500: Error at server side
"
;
}
else
{
// Todo - implement
console
.
log
(
'
u
nknown error
-_-
'
)
;
errorMessage
.
innerHTML
=
"
U
nknown error
"
;
}
}
};
...
...
@@ -105,25 +98,22 @@ ChangePassRequest.onreadystatechange = function () {
let
errorMessage
=
document
.
getElementById
(
"
match_error
"
);
if
(
this
.
status
==
204
)
{
console
.
log
(
"
inside 204 statement
"
);
errorMessage
.
innerHTML
=
"
Password has been changed!
"
;
console
.
log
(
'
Password has been changed!
'
);
}
else
if
(
this
.
status
==
400
)
{
// Todo - implement
console
.
log
(
'
got this: 400
'
);
errorMessage
.
innerHTML
=
"
Error 400: Old password is incorrect or Old/New password has wrong format
"
}
else
if
(
this
.
status
==
401
)
{
// Todo - implement
console
.
log
(
'
got this: 401
'
);
errorMessage
.
innerHTML
=
"
Error 401: You are not logged in
"
}
else
if
(
this
.
status
==
500
)
{
// Todo - implement
console
.
log
(
'
got this: 500
'
);
errorMessage
.
innerHTML
=
"
Error 500: Error at server side
"
;
}
else
{
// Todo - implement
console
.
log
(
'
unknown error -_-
'
);
errorMessage
.
innerHTML
=
"
Unknown error
"
}
errorMessage
.
style
.
display
=
"
block
"
;
}
...
...
@@ -150,7 +140,7 @@ dataByTokenRequest.onreadystatechange = function() {
reloadWall
(
"
home
"
);
}
else
if
(
this
.
status
==
401
)
{
console
.
log
(
"
Error 401: You are not loged in
"
);
console
.
log
(
"
Error 401: You are not log
g
ed in
"
);
}
else
if
(
this
.
status
==
400
)
{
console
.
log
(
"
Error 400: Incorrect format
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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