Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
WEBGDE-Components
web-ui
Commits
bbacabcc
Commit
bbacabcc
authored
Sep 21, 2022
by
Daniel Bawag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WG-66 - Seperated the config to project and app specific
parent
d1eff105
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
11 deletions
+28
-11
login.html
Web-GDE/login.html
+3
-0
project_config.js
Web-GDE/project_config.js
+5
-0
script.js
Web-GDE/script.js
+3
-3
fetchConfig.js
Web-GDE/src/fetchConfig/fetchConfig.js
+17
-8
No files found.
Web-GDE/login.html
View file @
bbacabcc
...
...
@@ -4,7 +4,10 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Login Page
</title>
<link
rel=
"stylesheet"
href=
"./login.css"
>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
integrity=
"sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin=
"anonymous"
></script>
<script
src=
"./src/fetchConfig/fetchConfig.js"
></script>
<script>
fetchConfig
()
</script>
</head>
<body>
<div
class=
"main-div"
>
...
...
Web-GDE/project_config.js
0 → 100644
View file @
bbacabcc
const
ALLOWED_KPH
=
8000
;
const
ALLOWED_DIMENSION_WIDTH
=
1366
;
const
ALLOWED_DIMENSION_HEIGHT
=
768
;
const
ALLOWED_BROWSERS
=
"Chrome"
;
\ No newline at end of file
Web-GDE/script.js
View file @
bbacabcc
...
...
@@ -13,9 +13,9 @@ console.log(getBrowserName());
function
validateForm
()
{
const
reqWindowWidth
=
1366
;
const
reqWindowHeight
=
768
;
const
reqBrowser
=
'Chrome'
;
const
reqWindowWidth
=
ALLOWED_DIMENSION_WIDTH
;
const
reqWindowHeight
=
ALLOWED_DIMENSION_HEIGHT
;
const
reqBrowser
=
ALLOWED_BROWSERS
;
var
windowWidth
=
getWindowWidth
();
var
windowHeight
=
getWindowHeight
();
...
...
Web-GDE/src/fetchConfig/fetchConfig.js
View file @
bbacabcc
...
...
@@ -2,18 +2,27 @@ var found = true; //variable to return
var
embed
=
0
;
//checker if which file is using the function
const
fetchConfig
=
()
=>
{
$
.
ajax
({
//locates the config file
url
:
'./config.js'
,
url
:
'./config.js'
,
async
:
false
,
success
:
function
(
data
){
},
error
:
function
(
data
)
{
handleError
(
);
success
:
function
(
data
)
{
},
error
:
function
(
data
)
{
handleError
(
"application config"
);
},
})
})
$
.
ajax
({
//locates the project config file
url
:
'./project_config.js'
,
async
:
false
,
success
:
function
(
data
)
{
},
error
:
function
(
data
)
{
handleError
(
"project config"
);
},
})
}
const
handleError
=
()
=>
{
const
handleError
=
(
file
)
=>
{
if
(
embed
==
0
)
{
//to ensure the prompt appears only once
if
(
confirm
(
"config.js not found, application will not commence"
))
{
}
}
if
(
confirm
(
`
${
file
}
not found, application will not commence`
))
{
}
}
found
=
false
;
}
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