Skip to content
Snippets Groups Projects
Unverified Commit d135a4b4 authored by luniki's avatar luniki Committed by GitHub
Browse files

add webpack+babel, refs #229 (#279)


Co-authored-by: default avatarmlunzena <gitlab+elanev@luniki.de>
parent 4c924d4a
No related branches found
No related tags found
No related merge requests found
.babelrc 0 → 100644
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": 3
}
]
]
}
......@@ -21,3 +21,4 @@ opencast.zip
opencast-theodul.zip
node_modules
/dist/
......@@ -65,7 +65,7 @@ class OpenCast extends StudipPlugin implements SystemPlugin, StandardPlugin
$this->addStylesheet('stylesheets/oc.less');
PageLayout::addScript($this->getPluginUrl() . '/javascripts/application.js');
PageLayout::addScript($this->getPluginUrl() . '/dist/application.js');
if (StudipVersion::olderThan('4.2') && !Studip\Markup::editorEnabled()) {
PageLayout::addScript($this->getPluginUrl() . '/node_modules/blueimp-file-upload/js/jquery.fileupload.js');
......@@ -80,7 +80,7 @@ class OpenCast extends StudipPlugin implements SystemPlugin, StandardPlugin
$id = Request::get('sem_id', $id);
if ($perm->have_perm('tutor') && OCModel::getConfigurationstate()) {
PageLayout::addScript($this->getPluginUrl() . '/javascripts/embed.js');
PageLayout::addScript($this->getPluginUrl() . '/dist/embed.js');
PageLayout::addStylesheet($this->getpluginUrl() . '/stylesheets/embed.css');
}
......
OC = {
const OC = {
lti_done: 0,
formData: {},
initAdmin: function () {
......@@ -423,3 +423,5 @@ OC = {
})
}
};
window.OC = OC
This diff is collapsed.
......@@ -3,14 +3,24 @@
"version": "1.2.115",
"description": "Stud.IP plugin for Opencast",
"dependencies": {
"blueimp-file-upload": "^10.8.0"
"blueimp-file-upload": "^10.8.0",
"core-js": "^3.6.5",
"regenerator-runtime": "^0.13.5"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"babel-loader": "^8.1.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
},
"devDependencies": {},
"scripts": {
"prebuild": "npm install",
"build": "webpack --mode production",
"pretranslate": "find * \\( -iname \"*.php\" -o -iname \"*.ihtml\" \\) | xargs xgettext --from-code=UTF-8 -j --add-location=never --package-name=Opencast --language=PHP -o \"locale/en/LC_MESSAGES/opencast.po\"",
"translate": "msgfmt \"locale/en/LC_MESSAGES/opencast.po\" --output-file=\"locale/en/LC_MESSAGES/opencast.mo\"",
"prezip": "npm install",
"zip": "zip -r Opencast-V$npm_package_version.zip classes controllers cronjobs images javascripts locale migrations models node_modules stylesheets views LICENSE INSTALL.md README.md bootstrap.php constants.php OpenCast.class.php plugin.manifest"
"prezip": "npm run build",
"zip": "zip -r Opencast-V$npm_package_version.zip classes controllers cronjobs dist images javascripts locale migrations models node_modules stylesheets views LICENSE INSTALL.md README.md bootstrap.php constants.php OpenCast.class.php plugin.manifest"
},
"repository": {
"type": "git",
......@@ -21,5 +31,6 @@
"bugs": {
"url": "https://github.com/elan-ev/studip-opencast-plugin/issues"
},
"homepage": "https://github.com/elan-ev/studip-opencast-plugin#readme"
"homepage": "https://github.com/elan-ev/studip-opencast-plugin#readme",
"browserslist": "> 0.25%, not dead, not IE 11"
}
const path = require("path");
module.exports = {
entry: {
application: "./javascripts/application.js",
embed: "./javascripts/embed.js"
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist")
},
module: {
rules: [{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }]
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment