-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added validation plugin for Https and Eslint * Fixed bugs in https validation and added contributors page * Added contributors page * Made changes after review Co-authored-by: root <root@LAPTOP-S05MI90A>
- Loading branch information
1 parent
bf759a6
commit e4fcfa3
Showing
93 changed files
with
16,006 additions
and
15,976 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
}, | ||
"plugins": ["only-warn"] | ||
} | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
}, | ||
"plugins": ["only-warn"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
node_modules | ||
page-components | ||
expbuilds | ||
exprepos | ||
.vscode/* | ||
plugins/ | ||
node_modules | ||
page-components | ||
expbuilds | ||
exprepos | ||
.vscode/* | ||
plugins/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
const { Task } = require("./Task.js"); | ||
const { | ||
UnitTypes, | ||
ContentTypes, | ||
validType, | ||
validContentType, | ||
} = require("./Enums.js"); | ||
|
||
class Aim extends Task { | ||
constructor(basedir, lu_label, exp_path) { | ||
super( | ||
UnitTypes.AIM, | ||
"Aim", | ||
ContentTypes.TEXT, | ||
exp_path, | ||
basedir, | ||
"aim.md", | ||
"index.html", | ||
lu_label | ||
); | ||
} | ||
} | ||
|
||
module.exports = { Aim }; | ||
const { Task } = require("./Task.js"); | ||
const { | ||
UnitTypes, | ||
ContentTypes, | ||
validType, | ||
validContentType, | ||
} = require("./Enums.js"); | ||
|
||
class Aim extends Task { | ||
constructor(basedir, lu_label, exp_path) { | ||
super( | ||
UnitTypes.AIM, | ||
"Aim", | ||
ContentTypes.TEXT, | ||
exp_path, | ||
basedir, | ||
"aim.md", | ||
"index.html", | ||
lu_label | ||
); | ||
} | ||
} | ||
|
||
module.exports = { Aim }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,76 @@ | ||
const path = require("path"); | ||
const {BuildEnvs} = require("./Enums.js"); | ||
|
||
const Lab = { | ||
descriptor_name: "lab-descriptor", | ||
build_dir: "build", | ||
exp_dir: "exp", | ||
deployment_dest: "/var/www/html", | ||
stage_dir: "stage", | ||
ui_template_name: "templates", | ||
static_content_dir: "static_content", | ||
partials: [ | ||
["analytics_head", "lab-analytics-head"], | ||
["analytics_body", "lab-analytics-body"], | ||
["commons", "commons"], | ||
["header", "header"], | ||
["breadcrumbs", "lab-breadcrumbs"], | ||
["side_menu", "sidemenu"], | ||
["content", "content"], | ||
["footer", "footer"], | ||
["popup_menu", "popupmenu"], | ||
["simulation_header", "simulation-header"], | ||
["bug_report_mobile", "bug-report-mobile"], | ||
["nav_menu_items", "nav-menu-items"], | ||
], | ||
pages: [ | ||
{ | ||
|
||
} | ||
] | ||
} | ||
|
||
const Experiment = { | ||
descriptor_name: "experiment-descriptor", | ||
default_descriptor: "default-experiment-descriptor.json", | ||
build_dir: "build", | ||
exp_dir: "experiment", | ||
ui_template_name: "templates", | ||
static_content_dir: "static_content", | ||
partials: [ | ||
["analytics_head", "analytics-head"], | ||
["analytics_body", "analytics-body"], | ||
["meta", "meta"], | ||
["commons", "commons"], | ||
["header", "header"], | ||
["breadcrumbs", "breadcrumbs"], | ||
["tools", "tools"], | ||
["side_menu", "sidemenu"], | ||
["content", "content"], | ||
["footer", "footer"], | ||
["popup_menu", "popupmenu"], | ||
["simulation_header", "simulation-header"], | ||
["bug_report_mobile", "bug-report-mobile"], | ||
["nav_menu_items", "nav-menu-items"], | ||
], | ||
optional_pages: [ | ||
"Observations", | ||
"Assignment", | ||
"Quiz" | ||
] | ||
}; | ||
|
||
|
||
/* | ||
Experiment build path | ||
------------------------- | ||
This is here to avoid circular dependency between | ||
Experiment moudle and Task module. | ||
*/ | ||
function build_path(src) { | ||
return path.resolve(src, Experiment.build_dir, path.basename(path.resolve(src))); | ||
} | ||
|
||
module.exports.Experiment = Experiment; | ||
module.exports.Lab = Lab; | ||
module.exports.build_path = build_path; | ||
const path = require("path"); | ||
const {BuildEnvs} = require("./Enums.js"); | ||
|
||
const Lab = { | ||
descriptor_name: "lab-descriptor", | ||
build_dir: "build", | ||
exp_dir: "exp", | ||
deployment_dest: "/var/www/html", | ||
stage_dir: "stage", | ||
ui_template_name: "templates", | ||
static_content_dir: "static_content", | ||
partials: [ | ||
["analytics_head", "lab-analytics-head"], | ||
["analytics_body", "lab-analytics-body"], | ||
["commons", "commons"], | ||
["header", "header"], | ||
["breadcrumbs", "lab-breadcrumbs"], | ||
["side_menu", "sidemenu"], | ||
["content", "content"], | ||
["footer", "footer"], | ||
["popup_menu", "popupmenu"], | ||
["simulation_header", "simulation-header"], | ||
["bug_report_mobile", "bug-report-mobile"], | ||
["nav_menu_items", "nav-menu-items"], | ||
], | ||
pages: [ | ||
{ | ||
|
||
} | ||
] | ||
} | ||
|
||
const Experiment = { | ||
descriptor_name: "experiment-descriptor", | ||
default_descriptor: "default-experiment-descriptor.json", | ||
build_dir: "build", | ||
exp_dir: "experiment", | ||
ui_template_name: "templates", | ||
static_content_dir: "static_content", | ||
partials: [ | ||
["analytics_head", "analytics-head"], | ||
["analytics_body", "analytics-body"], | ||
["meta", "meta"], | ||
["commons", "commons"], | ||
["header", "header"], | ||
["breadcrumbs", "breadcrumbs"], | ||
["tools", "tools"], | ||
["side_menu", "sidemenu"], | ||
["content", "content"], | ||
["footer", "footer"], | ||
["popup_menu", "popupmenu"], | ||
["simulation_header", "simulation-header"], | ||
["bug_report_mobile", "bug-report-mobile"], | ||
["nav_menu_items", "nav-menu-items"], | ||
], | ||
optional_pages: [ | ||
"Observations", | ||
"Assignment", | ||
"Quiz" | ||
] | ||
}; | ||
|
||
|
||
/* | ||
Experiment build path | ||
------------------------- | ||
This is here to avoid circular dependency between | ||
Experiment moudle and Task module. | ||
*/ | ||
function build_path(src) { | ||
return path.resolve(src, Experiment.build_dir, path.basename(path.resolve(src))); | ||
} | ||
|
||
module.exports.Experiment = Experiment; | ||
module.exports.Lab = Lab; | ||
module.exports.build_path = build_path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
const UnitTypes = { | ||
LU: "lu", | ||
TASK: "task", | ||
AIM: "aim", | ||
}; | ||
|
||
const ContentTypes = { | ||
TEXT: "text", | ||
VIDEO: "video", | ||
SIMULATION: "simulation", | ||
ASSESMENT: "assesment", | ||
}; | ||
|
||
const BuildEnvs = { | ||
PRODUCTION: 'production', | ||
TESTING: 'testing', | ||
LOCAL: 'local' | ||
}; | ||
|
||
const PluginScope = { | ||
EXPERIMENT: 'experiment', | ||
PAGE: 'page', | ||
}; | ||
|
||
const PluginConfig = { | ||
Default: { | ||
JS_MODULE: 'js/main.js', | ||
CSS_MODULE: 'css/main.css', | ||
}, | ||
}; | ||
|
||
function validType(t, v) { | ||
return Object.values(t).includes(v); | ||
} | ||
|
||
function validUnitType(ut) { | ||
if (validType(UnitTypes, ut)) { | ||
return ut; | ||
} else { | ||
throw new Error("Invalid unit type"); | ||
} | ||
} | ||
|
||
function validContentType(ct) { | ||
if (validType(ContentTypes, ct)) { | ||
return ct; | ||
} else { | ||
throw new Error("Invalid content type"); | ||
} | ||
} | ||
|
||
function validBuildEnv(e) { | ||
if (validType(BuildEnvs, e)) { | ||
return e; | ||
} else { | ||
throw new Error("Invalid build environment"); | ||
} | ||
} | ||
|
||
module.exports = {UnitTypes, ContentTypes, BuildEnvs, PluginScope, PluginConfig, validType, validContentType, validUnitType, validBuildEnv}; | ||
const UnitTypes = { | ||
LU: "lu", | ||
TASK: "task", | ||
AIM: "aim", | ||
}; | ||
|
||
const ContentTypes = { | ||
TEXT: "text", | ||
VIDEO: "video", | ||
SIMULATION: "simulation", | ||
ASSESMENT: "assesment", | ||
}; | ||
|
||
const BuildEnvs = { | ||
PRODUCTION: 'production', | ||
TESTING: 'testing', | ||
LOCAL: 'local' | ||
}; | ||
|
||
const PluginScope = { | ||
EXPERIMENT: 'experiment', | ||
PAGE: 'page' | ||
}; | ||
|
||
const PluginConfig = { | ||
Default: { | ||
JS_MODULE: 'js/main.js', | ||
CSS_MODULE: 'css/main.css', | ||
}, | ||
}; | ||
|
||
function validType(t, v) { | ||
return Object.values(t).includes(v); | ||
} | ||
|
||
function validUnitType(ut) { | ||
if (validType(UnitTypes, ut)) { | ||
return ut; | ||
} else { | ||
throw new Error("Invalid unit type"); | ||
} | ||
} | ||
|
||
function validContentType(ct) { | ||
if (validType(ContentTypes, ct)) { | ||
return ct; | ||
} else { | ||
throw new Error("Invalid content type"); | ||
} | ||
} | ||
|
||
function validBuildEnv(e) { | ||
if (validType(BuildEnvs, e)) { | ||
return e; | ||
} else { | ||
throw new Error("Invalid build environment"); | ||
} | ||
} | ||
|
||
module.exports = {UnitTypes, ContentTypes, BuildEnvs, PluginScope, PluginConfig, validType, validContentType, validUnitType, validBuildEnv}; |
Oops, something went wrong.