Skip to content

Update third party npm dependencies. #2788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions htdocs/generate-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

/* eslint-env node */

const yargs = require('yargs');
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const chokidar = require('chokidar');
const path = require('path');
const { minify } = require('terser');
Expand All @@ -14,7 +15,7 @@ const postcss = require('postcss');
const rtlcss = require('rtlcss');
const cssMinify = require('cssnano');

const argv = yargs
const argv = yargs(hideBin(process.argv))
.usage('$0 Options')
.version(false)
.alias('help', 'h')
Expand Down Expand Up @@ -110,7 +111,11 @@ const processFile = async (file, _details) => {
// This works for both sass/scss files and css files.
let result;
try {
result = sass.compile(filePath, { sourceMap: argv.enableSourcemaps });
result = sass.compile(filePath, {
sourceMap: argv.enableSourcemaps,
// Silence warnings about bootstrap usage of deprecated sass methods.
silenceDeprecations: ['import', 'global-builtin', 'color-functions']
});
} catch (e) {
console.log(`\x1b[31mIn ${file}:`);
console.log(`${e.message}\x1b[0m`);
Expand Down
6 changes: 3 additions & 3 deletions htdocs/js/ProblemSetDetail/problemsetdetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
() => {
document.querySelectorAll('.rpc_render_area').forEach((renderArea) => {
const iframe = renderArea.querySelector('[id^="psr_render_area_"][id$="_iframe"]');
if (iframe && iframe.iFrameResizer) iframe.iFrameResizer.close();
if (iframe && iframe.iframeResizer) iframe.iframeResizer.close();
});
},
{ passive: true }
Expand Down Expand Up @@ -379,8 +379,8 @@
const id = renderButton.id.match(/^pdr_render_(\d+)/)[1];
const renderArea = document.getElementById(`psr_render_area_${id}`);
const iframe = document.getElementById(`psr_render_area_${id}_iframe`);
if (iframe && iframe.iFrameResizer) {
iframe.iFrameResizer.close();
if (iframe && iframe.iframeResizer) {
iframe.iframeResizer.close();
renderArea.innerHTML = '';
} else if (/\S/.test(renderArea.innerHTML)) {
renderArea.innerHTML = '';
Expand Down
9 changes: 5 additions & 4 deletions htdocs/js/RenderProblem/renderproblem.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (!renderArea || !renderArea.id) return resolve();

let iframe = renderArea.querySelector(`#${renderArea.id}_iframe`);
if (iframe && iframe.iFrameResizer) iframe.contentDocument.location.replace('about:blank');
if (iframe && iframe.iframeResizer) iframe.contentDocument.location.replace('about:blank');

const ro = {
courseID: document.getElementsByName('hidden_course_id')[0]?.value,
Expand Down Expand Up @@ -65,7 +65,7 @@
)
throw 'There was an error rendering this problem!';

if (!(iframe && iframe.iFrameResizer)) {
if (!(iframe && iframe.iframeResizer)) {
iframe = document.createElement('iframe');
iframe.id = `${renderArea.id}_iframe`;
iframe.style.border = 'none';
Expand All @@ -77,12 +77,13 @@
container.innerHTML = data.pg_flags.comment;
iframe.after(container);
}
iFrameResize(
iframeResize(
{
checkOrigin: false,
warningTimeout: 20000,
scrolling: 'omit',
heightCalculationMethod: 'taggedElement'
heightCalculationMethod: 'taggedElement',
license: 'GPLv3'
},
iframe
);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/js/SetMaker/setmaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
// Render any problems that were hidden that have not yet been rendered.
for (const area of unshownAreas) {
const iframe = area.querySelector('iframe[id^="problem_render_area_"][id$="_iframe"]');
if (iframe && iframe.iFrameResizer) iframe.iFrameResizer.resize();
if (iframe && iframe.iframeResizer) iframe.iframeResizer.resize();
else await render(area.id.match(/^pgrow(\d+)/)[1]);
}
mltIcon.textContent = 'L';
Expand Down
Loading