diff --git a/.gitignore b/.gitignore index 6624e23..be6f539 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ #/bin +thirdpartylibs.xml phpcs.xml /*.xml @@ -15,5 +16,7 @@ vendor node_modules .eslintrc* +.jshintrc* +.env #End. diff --git a/.travis.yml b/.travis.yml index 5a65ffa..8bb2291 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,13 @@ install: - composer install - composer npm-install - composer eslint-config + - composer jshint-config + - composer ci-ignore + - composer less script: - composer test - composer validate + - composer ci-test #End. diff --git a/README.md b/README.md index a2e2d63..a402cb9 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Available via IET-OU Satis: To facilitate pilot studies using Moodle (e.g. for TeSLA) by: 1. Enabling OpenID login using just a username, not a full URL (e.g. https://openid.example.org/{username}) -2. Simple login page with custom instructions (hard-coded at present), `/index.php`, +2. Simple login page with custom instructions (edit via Moodle language customisations), `/index.php`, 3. Importing pilot-related data into a separate DB table, `mdl_auth_ouopenid_users`, 4. Making the pilot-related data available via `/user/ajax.php`, 5. Tries to redirect the participant to a bespoke URL (a work-in-progress), diff --git a/composer.json b/composer.json index 1504abd..e0c2cb0 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,35 @@ "composer/installers": "^1.2" }, "require-dev": { + "moodlerooms/moodle-plugin-ci": "^1.5", "jakub-onderka/php-parallel-lint": "^0.9.2", "squizlabs/php_codesniffer": "2.8.1" }, "scripts": { + "ci-ignore": [ + "echo '\n' > thirdpartylibs.xml", + "echo '\tdb/User.php' >> thirdpartylibs.xml", + "echo '\tvendor/' >> thirdpartylibs.xml", + "echo '\tnode_modules/' >> thirdpartylibs.xml", + "echo '' >> thirdpartylibs.xml" + ], + "ci-install": "vendor/bin/moodle-plugin-ci install", + "ci-test": [ + "vendor/bin/moodle-plugin-ci phplint .", + "vendor/bin/moodle-plugin-ci phpcpd .", + "# vendor/bin/moodle-plugin-ci phpmd .", + "# vendor/bin/moodle-plugin-ci codechecker .", + "vendor/bin/moodle-plugin-ci csslint .", + "vendor/bin/moodle-plugin-ci shifter .", + "vendor/bin/moodle-plugin-ci jshint .", + "# N/A? vendor/bin/moodle-plugin-ci validate .", + "# vendor/bin/moodle-plugin-ci phpunit . --coverage-text" + ], "sym-links": [ "cd ../moodle-auth-openid && ln -s ../moodle-auth-ouopenid/event.php" ], "npm-install": "npm install eslint less", + "jshint-config": "echo '{ \"laxcomma\": true }' > .jshintrc", "eslint-config": [ "echo '---\n extends: eslint:recommended\n globals:\n window: false\n root: true\n' > .eslintrc.yaml", "echo '{\n \"extends\": \"eslint:recommended\",\n \"globals\": { \"window\": false }\n}' > .eslintrc-XX.json" @@ -41,7 +62,6 @@ "vendor/bin/phpcs --standard=PSR2 -n db/*.php", "composer cn", "composer eslint", - "composer less", "php -r 'simplexml_load_file(\"db/install.xml\");' && echo install.xml OK!" ], "mcs": "vendor/bin/phpcs --standard=./moodle-core.xml --ignore=vendor --ignore=.git --extensions=php .", diff --git a/style/login.css b/style/login.css index 636b59e..718f518 100644 --- a/style/login.css +++ b/style/login.css @@ -17,8 +17,9 @@ abbr { border-bottom: 1px dotted #aaa; cursor: help; } -h1, h2 { +h1, h2, label, button { color: #444; + font-weight: bold; } body > div { background-color: #fff; @@ -46,7 +47,7 @@ input:focus, button:focus, input:hover, button:hover { border-color: #999; } -.XX[ name = openid_url ] { +input.XX[ name = openid_url ] { color: #666; display: none; } diff --git a/style/ouop-styles.less b/style/ouop-styles.less index cf9708e..18ddef7 100644 --- a/style/ouop-styles.less +++ b/style/ouop-styles.less @@ -8,7 +8,7 @@ body { background-color: #f9f9f9; } -[ data-region = drawer ] { +div[ data-region = drawer ] { background-color: transparent; } @@ -38,7 +38,8 @@ body { #page-local-tesla-views-agreement { - iframe[ src *= 'docs.google.com' ] { + iframe.ouop-consent-doc { + //Was: iframe[ src *= 'docs.google.com' ] { display: block; border: 1px solid #ddd; width: 100%; @@ -53,17 +54,17 @@ body { .ouop-hide-unused-ui { // Course main page. - [ data-key = badgesview ], - [ data-key = participants ], - [ href *= coursecompetencies ], - [ data-key = grade ], - [ data-key = calendar ], - [ href *= 'user/files' ] { + a[ data-key = badgesview ], + a[ data-key = participants ], + a[ href *= coursecompetencies ], + a[ data-key = grade ], + a[ data-key = calendar ], + a[ href *= 'user/files' ] { // csslint: Attribute selectors with *= are slow! display: none; } - [ data-title = 'grades,grades' ], - [ data-title = 'messages,message' ] { + a[ data-title = 'grades,grades' ], + a[ data-title = 'messages,message' ] { display: none; } @@ -75,22 +76,22 @@ body { // User/edit page. &#page-user-edit { - [ data-fieldtype = select ], - [ data-fieldtype = editor ], + div[ data-fieldtype = select ], + div[ data-fieldtype = editor ], #id_moodle_picture, #id_moodle_additional_names, #id_moodle_optional, #id_category_2, a.collapse-all, - .btn-link[ data-toggle ] { + a.btn-link[ data-toggle ] { display: none; } - [ for = id_maildisplay ], - [ for = id_country ], - [ for = id_timezone ], - [ for = id_description_editor ] { + label[ for = id_maildisplay ], + label[ for = id_country ], + label[ for = id_timezone ], + label[ for = id_description_editor ] { display: none !important; } } diff --git a/user/ouop-local-fixes.js b/user/ouop-local-fixes.js index d75857a..128915a 100644 --- a/user/ouop-local-fixes.js +++ b/user/ouop-local-fixes.js @@ -35,7 +35,7 @@ } C.debug('ouop: complete-user-profile-form'); - } + }; OUOP.local_fixes = function ($) { @@ -69,7 +69,7 @@ OUOP.rand = function () { var min = 11, max = 9999; return Math.floor(Math.random() * (max - min)) + min; - } + }; }(window));