Skip to content

Commit

Permalink
Added contributors page (#80)
Browse files Browse the repository at this point in the history
* 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
shreyash-x and root authored Oct 28, 2022
1 parent bf759a6 commit e4fcfa3
Show file tree
Hide file tree
Showing 93 changed files with 16,006 additions and 15,976 deletions.
28 changes: 14 additions & 14 deletions .eslintrc.js
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"]
}
12 changes: 6 additions & 6 deletions .gitignore
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/
48 changes: 24 additions & 24 deletions Aim.js
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 };
152 changes: 76 additions & 76 deletions Config.js
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;
120 changes: 60 additions & 60 deletions Enums.js
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};
Loading

0 comments on commit e4fcfa3

Please sign in to comment.