░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/ui/shared/external-tools/backbone/views
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: ExternalContentReturnView.js
/* * Copyright (C) 2023 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ /* eslint-disable no-void */ import {extend} from '@canvas/backbone/utils' import $ from 'jquery' import Backbone from '@canvas/backbone' import template from '../../jst/ExternalContentReturnView.handlebars' import iframeAllowances from '@canvas/external-apps/iframeAllowances' extend(ExternalContentReturnView, Backbone.View) function ExternalContentReturnView() { this._contentCancel = this._contentCancel.bind(this) this._contentReady = this._contentReady.bind(this) this.removeDialog = this.removeDialog.bind(this) this.handleAlertBlur = this.handleAlertBlur.bind(this) return ExternalContentReturnView.__super__.constructor.apply(this, arguments) } ExternalContentReturnView.prototype.template = template ExternalContentReturnView.optionProperty('launchType') ExternalContentReturnView.optionProperty('launchParams') ExternalContentReturnView.optionProperty('displayAsModal') ExternalContentReturnView.prototype.defaults = { displayAsModal: true, } ExternalContentReturnView.prototype.els = { 'iframe.tool_launch': '$iframe', } ExternalContentReturnView.prototype.events = { 'focus .before_external_content_info_alert': 'handleAlertFocus', 'focus .after_external_content_info_alert': 'handleAlertFocus', 'blur .before_external_content_info_alert': 'handleAlertBlur', 'blur .after_external_content_info_alert': 'handleAlertBlur', } ExternalContentReturnView.prototype.handleAlertFocus = function (e) { $(e.target).removeClass('screenreader-only') return this.$el.find('iframe').addClass('info_alert_outline') } ExternalContentReturnView.prototype.handleAlertBlur = function (e) { $(e.target).addClass('screenreader-only') return this.$el.find('iframe').removeClass('info_alert_outline') } ExternalContentReturnView.prototype.attach = function () { return this.model.on( 'change', (function (_this) { return function () { return _this.render() } })(this) ) } ExternalContentReturnView.prototype.toJSON = function () { const json = ExternalContentReturnView.__super__.toJSON.apply(this, arguments) let ref json.allowances = iframeAllowances() json.launch_url = this.model.launchUrl(this.launchType, this.launchParams) json.shouldRenderForwardingIframe = typeof ENV !== 'undefined' && ENV !== null ? (ref = ENV.FEATURES) != null ? ref.lti_platform_storage : void 0 : void 0 return json } ExternalContentReturnView.prototype.afterRender = function () { this.attachLtiEvents() const settings = this.model.get(this.launchType) || {} let ref this.$iframe.width('100%') this.$iframe.height(settings.selection_height) if (this.displayAsModal) { return this.$el.dialog({ title: ((ref = this.model.get(this.launchType)) != null ? ref.label : void 0) || '', width: settings.selection_width, height: settings.selection_height, resizable: true, close: this.removeDialog, }) } } ExternalContentReturnView.prototype.attachLtiEvents = function () { $(window).on('externalContentReady', this._contentReady) return $(window).on('externalContentCancel', this._contentCancel) } ExternalContentReturnView.prototype.detachLtiEvents = function () { $(window).off('externalContentReady', this._contentReady) return $(window).off('externalContentCancel', this._contentCancel) } ExternalContentReturnView.prototype.removeDialog = function () { this.detachLtiEvents() return this.remove() } ExternalContentReturnView.prototype._contentReady = function (event, data) { this.trigger('ready', data) return this.removeDialog() } ExternalContentReturnView.prototype._contentCancel = function (event, data) { this.trigger('cancel', data) return this.removeDialog() } export default ExternalContentReturnView
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 ExternalContentReturnView.js
JS
4.4 KB
2023-09-24 03:39
EDIT