reduce over-fetching of RCE code in common page loads
refs CFA-50 Change-Id: Ibcbf894ca755c2314a4a730eea1ac29e2a24f437 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339217 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Isaac Moore <isaac.moore@instructure.com> Reviewed-by: Jackson Huang <jackson.huang@instructure.com> QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com> Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
This commit is contained in:
parent
93ef223a0f
commit
93a345c527
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
import {enhanceUserContent} from '../enhance_user_content'
|
||||
import Mathml from '../mathml'
|
||||
import {Mathml} from '../mathml'
|
||||
|
||||
jest.useFakeTimers()
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import Mathml, {mathImageHelper, MathJaxDirective} from '../mathml'
|
||||
import {Mathml, mathImageHelper, MathJaxDirective} from '../mathml'
|
||||
|
||||
let stub = null
|
||||
describe('MathML and MathJax it', () => {
|
||||
|
|
|
@ -22,7 +22,7 @@ import {closest, getData, hide, insertAfter, setData, show} from './jqueryish_fu
|
|||
import {getTld, isExternalLink, showFilePreview, youTubeID} from './instructure_helper'
|
||||
import mediaCommentThumbnail from './media_comment_thumbnail'
|
||||
import {addParentFrameContextToUrl} from '../rce/plugins/instructure_rce_external_tools/util/addParentFrameContextToUrl'
|
||||
import Mathml, {MathJaxDirective} from './mathml'
|
||||
import {MathJaxDirective, Mathml} from './mathml'
|
||||
|
||||
// in jest the es directory doesn't exist so stub the undefined svg
|
||||
const IconDownloadSVG = IconDownloadLine?.src || '<svg></svg>'
|
||||
|
|
|
@ -360,4 +360,4 @@ function handleNewMath(event) {
|
|||
|
||||
window.addEventListener(Mathml.processNewMathEventName, handleNewMath)
|
||||
|
||||
export {Mathml as default, mathImageHelper, MathJaxDirective}
|
||||
export {Mathml, mathImageHelper, MathJaxDirective}
|
||||
|
|
|
@ -22,7 +22,7 @@ import {headerFor, originFromHost} from './rcs/api'
|
|||
import getTranslations from './getTranslations'
|
||||
import defaultTinymceConfig from './defaultTinymceConfig'
|
||||
import {setLocale} from './common/natcompare'
|
||||
import Mathml from './enhance-user-content/mathml'
|
||||
import {Mathml} from './enhance-user-content/mathml'
|
||||
|
||||
export * from './enhance-user-content/index'
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react'
|
||||
import {act, fireEvent, render, screen, waitFor} from '@testing-library/react'
|
||||
import EquationEditorModal from '../index'
|
||||
import Mathml, {MathJaxDirective} from '../../../../../enhance-user-content/mathml'
|
||||
import {MathJaxDirective, Mathml} from '../../../../../enhance-user-content/mathml'
|
||||
import advancedPreference from '../advancedPreference'
|
||||
import {MathfieldElement} from 'mathlive'
|
||||
import RCEGlobals from '../../../../RCEGlobals'
|
||||
|
|
|
@ -35,7 +35,7 @@ import * as advancedPreference from './advancedPreference'
|
|||
import {instuiPopupMountNode} from '../../../../util/fullscreenHelpers'
|
||||
|
||||
import {css} from 'aphrodite'
|
||||
import Mathml, {MathJaxDirective} from '../../../../enhance-user-content/mathml'
|
||||
import {MathJaxDirective, Mathml} from '../../../../enhance-user-content/mathml'
|
||||
import styles from './styles'
|
||||
|
||||
import RCEGlobals from '../../../RCEGlobals'
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
import $ from 'jquery'
|
||||
import '@canvas/doc-previews'
|
||||
import {loadDocPreview} from '@instructure/canvas-rce/es/enhance-user-content/doc_previews'
|
||||
import '@canvas/jquery/jquery.instructure_misc_plugins'
|
||||
import ready from '@instructure/ready'
|
||||
|
||||
|
@ -31,5 +31,5 @@ const previewDefaults = {
|
|||
ready(() => {
|
||||
const previewDiv = $('#doc_preview')
|
||||
previewDiv.fillWindowWithMe()
|
||||
previewDiv.loadDocPreview($.merge(previewDefaults, previewDiv.data()))
|
||||
loadDocPreview($.merge(previewDefaults, previewDiv.data()))
|
||||
})
|
||||
|
|
|
@ -149,6 +149,7 @@ import 'jquery-scroll-to-visible/jquery.scrollTo'
|
|||
import 'jquery-selectmenu'
|
||||
import '@canvas/jquery/jquery.disableWhileLoading'
|
||||
import '@canvas/util/jquery/fixDialogButtons'
|
||||
import {isPreviewable} from '@instructure/canvas-rce/es/rce/plugins/shared/Previewable'
|
||||
import type {GlobalEnv} from '@canvas/global/env/GlobalEnv.d'
|
||||
import type {EnvGradebookSpeedGrader} from '@canvas/global/env/EnvGradebook'
|
||||
import replaceTags from '@canvas/util/replaceTags'
|
||||
|
@ -2340,7 +2341,7 @@ EG = {
|
|||
if (
|
||||
attachment.crocodoc_url ||
|
||||
attachment.canvadoc_url ||
|
||||
$.isPreviewable(attachment.content_type)
|
||||
isPreviewable(attachment.content_type)
|
||||
) {
|
||||
inlineableAttachments.push(attachment)
|
||||
}
|
||||
|
@ -2873,7 +2874,7 @@ EG = {
|
|||
iframe_min_height: 0,
|
||||
})
|
||||
)
|
||||
} else if ($.isPreviewable(attachment.content_type, 'google')) {
|
||||
} else if (!INST?.disableGooglePreviews && isPreviewable(attachment.content_type)) {
|
||||
$no_annotation_warning.show()
|
||||
|
||||
const currentStudentIDAsOfAjaxCall = this.currentStudent[anonymizableId]
|
||||
|
|
|
@ -16,11 +16,10 @@
|
|||
// with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import $ from 'jquery'
|
||||
|
||||
import {useScope as useI18nScope} from '@canvas/i18n'
|
||||
import swfobject from 'swfobject'
|
||||
import 'jqueryui/dialog'
|
||||
import '@canvas/doc-previews'
|
||||
import {loadDocPreview} from '@instructure/canvas-rce/es/enhance-user-content/doc_previews'
|
||||
|
||||
const I18n = useI18nScope('submissions.show_preview')
|
||||
|
||||
|
@ -42,15 +41,14 @@ $(document).ready(() => {
|
|||
|
||||
$(document).on('click', '.modal_preview_link', function () {
|
||||
// overflow:hidden is because of some weird thing where the google doc preview gets double scrollbars
|
||||
$('<div style="padding:0; overflow:hidden;">')
|
||||
.dialog({
|
||||
title: I18n.t('preview_title', 'Preview of %{title}', {
|
||||
title: $(this).data('dialog-title'),
|
||||
}),
|
||||
width: $(document).width() * 0.95,
|
||||
height: $(document).height() * 0.75,
|
||||
})
|
||||
.loadDocPreview($.extend({height: '100%'}, $(this).data()))
|
||||
const dialog = $('<div style="padding:0; overflow:hidden;">').dialog({
|
||||
title: I18n.t('preview_title', 'Preview of %{title}', {
|
||||
title: $(this).data('dialog-title'),
|
||||
}),
|
||||
width: $(document).width() * 0.95,
|
||||
height: $(document).height() * 0.75,
|
||||
})
|
||||
loadDocPreview(dialog, $.extend({height: '100%'}, $(this).data()))
|
||||
$('.submission_annotation.unread_indicator').hide()
|
||||
$('.file-upload-submission-attachment .modal_preview_link').attr(
|
||||
'title',
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import ReactDOM from 'react-dom'
|
||||
import React from 'react'
|
||||
import {Mathml} from '@canvas/rce/canvas-rce'
|
||||
import {Mathml} from '@instructure/canvas-rce/es/enhance-user-content/mathml'
|
||||
import ModuleFileDrop from '@canvas/context-module-file-drop/react'
|
||||
import ModuleFile from '@canvas/files/backbone/models/ModuleFile'
|
||||
import $, * as JQuery from 'jquery'
|
||||
|
|
Loading…
Reference in New Issue