[ci coverage] convert public/js w/ no ‘export’s to ‘import’

closes: CNVS-35922

now that we pass all of public/javascripts through
babel, istanbul/esprima should not choke on `import`
in our JS tooling.

test plan:
* run `yarn test` w/ COVERAGE=1
* it should work

Change-Id: Ia19deb547350245b7cae54e76e56ae6355f61b2c
Reviewed-on: https://gerrit.instructure.com/105962
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
Ryan Shaw 2017-03-22 10:15:02 -06:00
parent ac0860c4df
commit b2700d45b6
98 changed files with 542 additions and 778 deletions

View File

@ -20,7 +20,6 @@ import React from 'react'
import PropTypes from 'prop-types'
import _ from 'underscore'
import axios from 'axios'
import ConvertCase from 'convert_case'
import I18n from 'i18n!grading_periods'
import TokenInput, {Option as ComboboxOption} from 'react-tokeninput'

View File

@ -22,7 +22,6 @@ import $ from 'jquery'
import _ from 'underscore'
import Button from 'instructure-ui/lib/components/Button'
import axios from 'axios'
import ConvertCase from 'convert_case'
import I18n from 'i18n!grading_periods'
import GradingPeriod from 'jsx/grading/AccountGradingPeriod'
import GradingPeriodForm from 'jsx/grading/GradingPeriodForm'

View File

@ -22,7 +22,6 @@ import _ from 'underscore'
import $ from 'jquery'
import Button from 'instructure-ui/lib/components/Button'
import I18n from 'i18n!grading_periods'
import ConvertCase from 'convert_case'
import GradingPeriodSet from 'jsx/grading/GradingPeriodSet'
import SearchGradingPeriodsField from 'jsx/grading/SearchGradingPeriodsField'
import SearchHelpers from 'jsx/shared/helpers/searchHelpers'

View File

@ -22,7 +22,7 @@ import GradingPeriod from 'jsx/grading/gradingPeriod'
import $ from 'jquery'
import I18n from 'i18n!external_tools'
import _ from 'underscore'
import ConvertCase from 'convert_case'
import {camelize} from 'convert_case'
import 'jquery.instructure_misc_plugins'
const periodsAreLoaded = (state) => {
@ -66,7 +66,7 @@ import 'jquery.instructure_misc_plugins'
deserializePeriods: function(periods) {
return _.map(periods.grading_periods, period => {
let newPeriod = ConvertCase.camelize(period);
let newPeriod = camelize(period);
newPeriod.startDate = new Date(period.start_date);
newPeriod.endDate = new Date(period.end_date);
newPeriod.closeDate = new Date(period.close_date || period.end_date);

View File

@ -160,6 +160,7 @@ module.exports = {
loaders: ['imports-loader?this=>window']
},
// vendor/i18n.js does not export or define anything, it just creates a global
{
test: /vendor\/i18n/,
loaders: ['exports-loader?I18n']

View File

@ -23,9 +23,9 @@ module I18nTasks
<<-TRANSLATIONS.gsub(/^ {8}/, '')
// this file was auto-generated by rake i18n:generate_js.
// you probably shouldn't edit it directly
define(['i18nObj', 'jquery'], function(I18n, $) {
import I18n from 'i18nObj'
import $ from 'jquery'
$.extend(true, I18n, {translations: #{translations.to_ordered.to_json}});
});
TRANSLATIONS
end
end

View File

@ -16,16 +16,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!accounts' /* I18n.t */,
'jquery' /* $ */,
'str/htmlEscape',
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'compiled/jquery.rails_flash_notifications',
'jquery.templateData' /* fillTemplateData */
], function(I18n, $, htmlEscape) {
import I18n from 'i18n!accounts'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.instructure_forms' /* formSubmit */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'compiled/jquery.rails_flash_notifications'
import 'jquery.templateData' /* fillTemplateData */
$(".add_course_link").click(function(event) {
event.preventDefault();
@ -71,5 +69,3 @@ define([
$("#add_course_dialog .cancel_button").click(function() {
$("#add_course_dialog").dialog('close');
});
});

View File

@ -16,17 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!accounts' /* I18n.t */,
'jquery' /* $ */,
'compiled/util/addPrivacyLinkToDialog',
'underscore',
'user_sortable_name',
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'compiled/jquery.rails_flash_notifications'
], function(I18n, $, addPrivacyLinkToDialog, _) {
import I18n from 'i18n!accounts'
import $ from 'jquery'
import addPrivacyLinkToDialog from 'compiled/util/addPrivacyLinkToDialog'
import _ from 'underscore'
import 'user_sortable_name'
import 'jquery.instructure_forms' /* formSubmit */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'compiled/jquery.rails_flash_notifications'
$(".add_user_link").click(function(event) {
event.preventDefault();
@ -101,5 +99,3 @@ define([
$("#add_user_dialog .cancel_button").click(function() {
$("#add_user_dialog").dialog('close');
});
});

View File

@ -16,18 +16,17 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!account_authorization_configs',
'str/htmlEscape',
'react',
'react-dom',
'jsx/authentication_providers/AuthTypePicker',
'authentication_providers',
'jquery' /* $ */,
'jquery.instructure_forms' /* formSubmit */,
'jquery.keycodes' /* keycodes */,
'jquery.loadingImg' /* loadingImage */
], function (I18n, htmlEscape, React, ReactDOM, AuthTypePicker, authenticationProviders, $) {
import I18n from 'i18n!account_authorization_configs'
import htmlEscape from 'str/htmlEscape'
import React from 'react'
import ReactDOM from 'react-dom'
import AuthTypePicker from 'jsx/authentication_providers/AuthTypePicker'
import authenticationProviders from 'authentication_providers'
import $ from 'jquery'
import 'jquery.instructure_forms' /* formSubmit */
import 'jquery.keycodes'
import 'jquery.loadingImg'
var Picker = React.createFactory(AuthTypePicker);
var selectorNode = document.getElementById('add-authentication-provider');
var authTypeOptions = JSON.parse(selectorNode.getAttribute('data-options'));
@ -122,4 +121,3 @@ define([
$provisioning_elements.find("input[type='checkbox']").removeAttr('checked');
}
});
});

View File

@ -16,13 +16,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!accounts.statistics',
'jquery', // $
'jquery.ajaxJSON', // ajaxJSON
'jqueryui/dialog', // /\.dialog/
'jquery.instructure_misc_helpers' // replaceTags
], function(I18n, $) {
import I18n from 'i18n!accounts.statistics'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jqueryui/dialog'
import 'jquery.instructure_misc_helpers' // replaceTags
$(document).ready(function() {
$(".over_time_link").live('click', function(event) {
@ -70,4 +68,3 @@ define([
chart.draw(data, {displayAnnotations: false});
}
});
});

View File

@ -16,15 +16,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'INST', // INST
'i18n!ajax_errors',
'jquery', // $
'str/htmlEscape',
'jquery.ajaxJSON', // ajaxJSON, defaultAjaxError
'compiled/jquery.rails_flash_notifications', // flashError
'jqueryui/effects/drop'
], function(INST, I18n, $, htmlEscape) {
import INST from 'INST'
import I18n from 'i18n!ajax_errors'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON' // ajaxJSON, defaultAjaxError
import 'compiled/jquery.rails_flash_notifications' // flashError
import 'jqueryui/effects/drop'
INST.errorCount = 0;
window.onerror = function (msg, url, line, column, errorObj) {
INST.errorCount += 1;
@ -55,7 +54,7 @@ define([
var ajaxErrorFlash = function(message, xhr) {
var i = $obj[0];
if(!i) { return; }
var d = i.contentDocument ||
var d = i.contentDocument ||
(i.contentWindow && i.contentWindow.document) ||
window.frames[$obj.attr('id')].document;
var $body = $(d).find("body");
@ -109,4 +108,3 @@ define([
});
});
});

View File

@ -16,16 +16,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!alerts',
'jquery', // $
'str/htmlEscape',
'jquery.ajaxJSON', // ajaxJSON
'jquery.instructure_forms', // validateForm, formErrors, errorBox
'jquery.instructure_misc_helpers', // replaceTags
'vendor/jquery.ba-tinypubsub', // /\.publish/
'jqueryui/button' // /\.button/
], function(I18n, $, htmlEscape) {
import I18n from 'i18n!alerts'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' // validateForm, formErrors, errorBox
import 'jquery.instructure_misc_helpers' // replaceTags
import 'vendor/jquery.ba-tinypubsub' // /\.publish/
import 'jqueryui/button'
$(function () {
var $list = $('.alerts_list');
@ -358,5 +356,3 @@ define([
$(this).parents('.alert').find('input[name="repetition"]').prop('checked', true);
});
});
});

View File

@ -16,19 +16,17 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require([
'i18n!profile' /* I18n.t */,
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* formSubmit, fillFormData, getFormData, formErrors */,
'jqueryui/dialog',
'jquery.instructure_misc_helpers' /* replaceTags */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.loadingImg' /* loadingImage */,
'compiled/jquery.rails_flash_notifications',
'jquery.templateData' /* fillTemplateData, getTemplateData */,
'jqueryui/tabs' /* /\.tabs/ */
], function(I18n, $) {
import I18n from 'i18n!profile'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' /* formSubmit, fillFormData, getFormData, formErrors */
import 'jqueryui/dialog'
import 'jquery.instructure_misc_helpers' /* replaceTags */
import 'jquery.instructure_misc_plugins' /* confirmDelete, showIf */
import 'jquery.loadingImg'
import 'compiled/jquery.rails_flash_notifications'
import 'jquery.templateData' /* fillTemplateData, getTemplateData */
import 'jqueryui/tabs'
$(document).ready(function() {
$("#communication_channels").tabs();
@ -362,4 +360,3 @@ $(document).ready(function() {
$("#confirm_email_channel").dialog('close');
});
});
});

View File

@ -16,14 +16,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!content_exports',
'jquery' /* $ */,
'str/htmlEscape',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/progressbar' /* /\.progressbar/ */
], function(I18n, $, htmlEscape) {
import I18n from 'i18n!content_exports'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' /* formSubmit */
import 'jqueryui/progressbar'
$(document).ready(function(event) {
var state = 'nothing';
@ -138,4 +136,3 @@ $(document).ready(function(event) {
check_if_exporting();
});
});

View File

@ -16,18 +16,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!content_imports',
'compiled/util/processMigrationItemSelections',
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_date_and_time' /* dateString, date_field */,
'jquery.instructure_forms' /* formSubmit, getFormData, validateForm */,
'jquery.instructure_misc_plugins' /* showIf */,
'compiled/jquery.rails_flash_notifications',
'vendor/date' /* Date.parse */,
'jqueryui/progressbar' /* /\.progressbar/ */
], function(I18n, processMigrationItemSelections, $) {
import I18n from 'i18n!content_imports'
import processMigrationItemSelections from 'compiled/util/processMigrationItemSelections'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_date_and_time' /* dateString, date_field */
import 'jquery.instructure_forms' /* formSubmit, getFormData, validateForm */
import 'jquery.instructure_misc_plugins' /* showIf */
import 'compiled/jquery.rails_flash_notifications'
import 'vendor/date' /* Date.parse */
import 'jqueryui/progressbar'
$(function () {
$(".date_field").date_field();
@ -336,4 +334,3 @@ define([
}
});
});
});

View File

@ -16,14 +16,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'INST' /* INST */,
'i18n!content_locks',
'jquery' /* $ */,
'str/htmlEscape',
'jquery.instructure_date_and_time' /* datetimeString */,
'jqueryui/dialog'
], function(INST, I18n, $, htmlEscape) {
import INST from 'INST'
import I18n from 'i18n!content_locks'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.instructure_date_and_time' /* datetimeString */
import 'jqueryui/dialog'
INST.lockExplanation = function(data, type) {
// Any additions to this function should also be added to similar logic in ApplicationController.rb
@ -133,4 +131,3 @@ define([
}
});
});
});

View File

@ -16,18 +16,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!content_tags',
'jquery' /* $ */,
'jquery.instructure_forms' /* formSubmit, fillFormData */,
'jqueryui/dialog',
'jquery.instructure_misc_helpers' /* replaceTags */,
'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange */,
'jquery.loadingImg' /* loadingImage */,
'jquery.templateData' /* getTemplateData */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */,
'jqueryui/accordion' /* /\.accordion\(/ */
], function(I18n, $) {
import I18n from 'i18n!content_tags'
import $ from 'jquery'
import 'jquery.instructure_forms' /* formSubmit, fillFormData */
import 'jqueryui/dialog'
import 'jquery.instructure_misc_helpers' /* replaceTags */
import 'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange */
import 'jquery.loadingImg'
import 'jquery.templateData' /* getTemplateData */
import 'vendor/jquery.scrollTo'
import 'jqueryui/accordion'
var contentTags = {
currentHover: null,
@ -191,4 +189,3 @@ define([
}
return $match;
}
});

View File

@ -16,10 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!courses',
'jquery' /* $ */
], function(I18n, $) {
import I18n from 'i18n!courses'
import $ from 'jquery'
$(document).ready(function() {
$(".reject_button").click(function(event) {
var result = confirm(I18n.t('confirm_reject_invitation', "Are you sure you want to reject the invitation to participate in this course?"));
@ -29,5 +28,3 @@ define([
}
});
});
});

View File

@ -16,30 +16,28 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!course_settings',
'jquery' /* $ */,
'underscore',
'course_settings_helper' /* tabIdFromElement */,
'timezone',
'jsx/shared/helpers/forceScreenreaderToReparse',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_date_and_time' /* datetimeString, date_field */,
'jquery.instructure_forms' /* formSubmit, fillFormData, getFormData, formErrors */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange, showIf */,
'jquery.keycodes' /* keycodes */,
'jquery.loadingImg' /* loadingImage */,
'compiled/jquery.rails_flash_notifications',
'jquery.templateData' /* fillTemplateData, getTemplateData */,
'link_enrollment' /* global link_enrollment */,
'vendor/jquery.ba-tinypubsub' /* /\.publish/ */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */,
'jqueryui/autocomplete' /* /\.autocomplete/ */,
'jqueryui/sortable' /* /\.sortable/ */,
'jqueryui/tabs' /* /\.tabs/ */
], function(I18n, $, _, CourseSettingsHelper, tz, forceScreenReaderToReparse) {
import I18n from 'i18n!course_settings'
import $ from 'jquery'
import _ from 'underscore'
import {tabIdFromElement} from 'course_settings_helper'
import tz from 'timezone'
import forceScreenReaderToReparse from 'jsx/shared/helpers/forceScreenreaderToReparse'
import 'jquery.ajaxJSON'
import 'jquery.instructure_date_and_time' /* datetimeString, date_field */
import 'jquery.instructure_forms' /* formSubmit, fillFormData, getFormData, formErrors */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange, showIf */
import 'jquery.keycodes'
import 'jquery.loadingImg'
import 'compiled/jquery.rails_flash_notifications'
import 'jquery.templateData' /* fillTemplateData, getTemplateData */
import 'link_enrollment' /* global link_enrollment */
import 'vendor/jquery.ba-tinypubsub' /* /\.publish/ */
import 'vendor/jquery.scrollTo'
import 'jqueryui/autocomplete'
import 'jqueryui/sortable'
import 'jqueryui/tabs'
var GradePublishing = {
status: null,
@ -218,11 +216,11 @@ define([
var tabs = [];
$("#nav_enabled_list li").each(function() {
var tab_id = CourseSettingsHelper.tabIdFromElement(this);
var tab_id = tabIdFromElement(this);
if (tab_id !== null) { tabs.push({ id: tab_id }); }
});
$("#nav_disabled_list li").each(function() {
var tab_id = CourseSettingsHelper.tabIdFromElement(this);
var tab_id = tabIdFromElement(this);
if (tab_id !== null) { tabs.push({ id: tab_id, hidden: true }); }
});
@ -458,4 +456,3 @@ define([
forceScreenReaderToReparse($('#master_course_restrictions')[0]);
});
});
});

View File

@ -25,7 +25,6 @@
// this file is the same as http://code.google.com/p/datejs/source/browse/trunk/src/core.js but with
// the beginning and ending quotes on the return string removed
define(function () {
if (!Date.prototype.toISOString) {
/**
@ -46,4 +45,3 @@ if (!Date.prototype.toISOString) {
f(this.getUTCSeconds()) + 'Z';
};
}
});

View File

@ -22,6 +22,4 @@
// We need to give webpack a resource that exists on the Filesystem
// before the pitching i18n loader catches it, so we replace
// i18n!some-scope requires with i18n?some-scope!dummyI18nResource
define([],function(){
throw "Should never actually call this module";
});

View File

@ -25,29 +25,27 @@
// settings on their own personal eportfolio, they can't
// affect anyone else
define([
'i18n!eportfolio',
'jquery' /* $ */,
'react',
'react-dom',
'compiled/userSettings',
'jsx/shared/rce/RichContentEditor',
'jsx/eportfolios/MoveToDialog',
'eportfolios/eportfolio_section',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.inst_tree' /* instTree */,
'jquery.instructure_forms' /* formSubmit, getFormData, formErrors, errorBox */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'compiled/jquery.rails_flash_notifications' /* $.screenReaderFlashMessageExclusive */,
'jquery.instructure_misc_helpers' /* replaceTags, scrollSidebar */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.loadingImg' /* loadingImage */,
'jquery.templateData' /* fillTemplateData, getTemplateData */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */,
'jqueryui/progressbar' /* /\.progressbar/ */,
'jqueryui/sortable' /* /\.sortable/ */
], function(I18n, $, React, ReactDOM, userSettings, RichContentEditor, MoveToDialog, EportfolioSection) {
import I18n from 'i18n!eportfolio'
import $ from 'jquery'
import React from 'react'
import ReactDOM from 'react-dom'
import userSettings from 'compiled/userSettings'
import RichContentEditor from 'jsx/shared/rce/RichContentEditor'
import MoveToDialog from 'jsx/eportfolios/MoveToDialog'
import {fetchContent} from 'eportfolios/eportfolio_section'
import 'jquery.ajaxJSON'
import 'jquery.inst_tree' /* instTree */
import 'jquery.instructure_forms' /* formSubmit, getFormData, formErrors, errorBox */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'compiled/jquery.rails_flash_notifications' /* $.screenReaderFlashMessageExclusive */
import 'jquery.instructure_misc_helpers' /* replaceTags, scrollSidebar */
import 'jquery.instructure_misc_plugins' /* confirmDelete, showIf */
import 'jquery.loadingImg'
import 'jquery.templateData' /* fillTemplateData, getTemplateData */
import 'vendor/jquery.scrollTo'
import 'jqueryui/progressbar'
import 'jqueryui/sortable'
// optimization so user isn't waiting on RCS to
// respond when they hit edit
@ -75,7 +73,7 @@ define([
if(section_type == "rich_text" || section_type == "html" || $section.hasClass('read_only')) {
idx++;
var name = "section_" + idx;
var sectionContent = EportfolioSection.fetchContent($section, section_type, name)
var sectionContent = fetchContent($section, section_type, name)
data = $.extend(data, sectionContent)
}
});
@ -1119,4 +1117,3 @@ define([
});
});
});
});

View File

@ -16,11 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' /* jQuery, $ */,
'jquery.instructure_misc_plugins' /* fillWindowWithMe */
], function(jQuery) {
import jQuery from 'jquery'
import 'jquery.instructure_misc_plugins' /* fillWindowWithMe */
jQuery(function($) {
$("#file_content").css('width', '100%').fillWindowWithMe();
});
});

View File

@ -16,19 +16,18 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'compiled/util/round',
'i18n!grading_standards',
'jsx/shared/helpers/numberHelper',
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* fillFormData, getFormData */,
'jqueryui/dialog',
'jquery.instructure_misc_plugins' /* ifExists, .dim, undim, confirmDelete */,
'compiled/jquery.rails_flash_notifications',
'jquery.templateData' /* fillTemplateData, getTemplateData */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */
], function (round, I18n, numberHelper, $) {
import round from 'compiled/util/round'
import I18n from 'i18n!grading_standards'
import numberHelper from 'jsx/shared/helpers/numberHelper'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' /* fillFormData, getFormData */
import 'jqueryui/dialog'
import 'jquery.instructure_misc_plugins' /* ifExists, .dim, undim, confirmDelete */
import 'compiled/jquery.rails_flash_notifications'
import 'jquery.templateData' /* fillTemplateData, getTemplateData */
import 'vendor/jquery.scrollTo'
function roundedNumber (val) {
return I18n.n(round(val, round.DEFAULT));
}
@ -458,4 +457,3 @@ define([
});
});
});
});

View File

@ -17,12 +17,10 @@
*/
//create a global object "INST" that we will have be Instructure's namespace.
define([
'INST' /* INST */,
'i18n!instructure',
'jquery' /* $ */,
'jqueryui/dialog'
], function(INST, I18n, $) {
import INST from 'INST'
import I18n from 'i18n!instructure'
import $ from 'jquery'
import 'jqueryui/dialog'
function getTld(hostname){
hostname = (hostname || "").split(":")[0];
@ -71,5 +69,3 @@ define([
window.jsonFlickrApi = function(data) {
$("#instructure_image_search").triggerHandler('search_results', data);
};
});

View File

@ -18,11 +18,9 @@
/*jshint evil:true*/
define([
'INST' /* INST */,
'jquery' /* $ */,
'compiled/behaviors/authenticity_token'
], function(INST, $, authenticity_token) {
import INST from 'INST'
import $ from 'jquery'
import authenticity_token from 'compiled/behaviors/authenticity_token'
var _getJSON = $.getJSON;
$.getJSON = function(url, data, callback) {
@ -164,4 +162,3 @@ define([
};
this.ajaxError($.fn.defaultAjaxError.func);
};
});

View File

@ -32,13 +32,11 @@ $('#form').disableWhileLoading(promise, {
});
*/
define([
'i18n!instructure',
'compiled/util/objectCollection',
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'spin.js/jquery.spin' /* /\.spin/ */
], function(I18n, objectCollection, $) {
import I18n from 'i18n!instructure'
import objectCollection from 'compiled/util/objectCollection'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'spin.js/jquery.spin'
$.fn.disableWhileLoading = function(deferred, options) {
return this.each(function() {
@ -109,4 +107,3 @@ define([
opacity: 0.5,
buttons: ['button[type="submit"], .ui-dialog-buttonpane .ui-button .ui-button-text']
};
});

View File

@ -16,17 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'INST' /* INST */,
'i18n!instructure',
'jquery' /* jQuery, $ */,
'underscore',
'str/htmlEscape' /* htmlEscape, /\$\.h/ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.google-analytics' /* trackEvent */,
'jquery.instructure_misc_helpers' /* /\$\.uniq/, capitalize */,
'jquery.loadingImg' /* loadingImage */
], function(INST, I18n, $, _, htmlEscape) {
import INST from 'INST'
import I18n from 'i18n!instructure'
import $ from 'jquery'
import _ from 'underscore'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON'
import 'jquery.google-analytics' /* trackEvent */
import 'jquery.instructure_misc_helpers' /* /\$\.uniq/, capitalize */
import 'jquery.loadingImg'
// first element in array is if scribd can handle it, second is if google can.
var previewableMimeTypes = {
@ -163,5 +161,3 @@ define([
}
});
};
});

View File

@ -16,9 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' /* $ */
], function($) {
import $ from 'jquery'
/**
* TL;DR: Remove this file when possible.
@ -150,4 +148,3 @@ define([
};
$.fn.dropdownList.defaults = {height: 250, width: "auto"};
});

View File

@ -30,7 +30,7 @@
//
// then: $(".field-with-fancyplaceholder input").fancyPlaceholder();
define(['jquery'], function($) {
import $ from 'jquery'
$.fn.fancyPlaceholder = function() {
var pollingInterval,
foundInputsAndLables = [];
@ -74,4 +74,3 @@ define(['jquery'], function($) {
}
});
};
});

View File

@ -17,13 +17,11 @@
*/
// xsslint jqueryObject.identifier tree
define([
'jquery' /* $ */,
'underscore',
'str/htmlEscape',
'jqueryui/draggable' /* /\.draggable/ */,
'jqueryui/droppable' /* /\.droppable/ */
], function($, _, htmlEscape) {
import $ from 'jquery'
import _ from 'underscore'
import htmlEscape from 'str/htmlEscape'
import 'jqueryui/draggable'
import 'jqueryui/droppable'
$.fn.instTree = function(options) {
return $(this).each(function() {
var binded = false;
@ -586,4 +584,3 @@ define([
}//if ($(this).is('ul'))
});
};
});

View File

@ -16,19 +16,18 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!instructure',
'jquery',
'timezone',
'str/htmlEscape',
'compiled/widget/DatetimeField',
'jsx/shared/render-datepicker-time',
'jquery.keycodes' /* keycodes */,
'vendor/date' /* Date.parse, Date.UTC, Date.today */,
'jqueryui/datepicker' /* /\.datepicker/ */,
'jqueryui/sortable' /* /\.sortable/ */,
'jqueryui/widget' /* /\.widget/ */
], function(I18n, $, tz, htmlEscape, DatetimeField, renderDatepickerTime) {
import I18n from 'i18n!instructure'
import $ from 'jquery'
import tz from 'timezone'
import htmlEscape from 'str/htmlEscape'
import DatetimeField from 'compiled/widget/DatetimeField'
import renderDatepickerTime from 'jsx/shared/render-datepicker-time'
import 'jquery.keycodes'
import 'vendor/date' /* Date.parse, Date.UTC, Date.today */
import 'jqueryui/datepicker'
import 'jqueryui/sortable'
import 'jqueryui/widget'
// fudgeDateForProfileTimezone is used to apply an offset to the date which represents the
// difference between the user's configured timezone in their profile, and the timezone
// of the browser. We want to display times in the timezone of their profile. Use
@ -462,5 +461,3 @@ define([
});
return $picker;
};
});

View File

@ -16,24 +16,21 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jsx/shared/rce/RceCommandShim',
'INST' /* INST */,
'i18n!instructure',
'jquery' /* jQuery, $ */,
'underscore',
'compiled/xhr/FakeXHR',
'compiled/behaviors/authenticity_token',
'str/htmlEscape',
'jquery.ajaxJSON' /* ajaxJSON, defaultAjaxError */,
'jquery.disableWhileLoading' /* disableWhileLoading */,
'jquery.google-analytics' /* trackEvent */,
'jquery.instructure_date_and_time' /* date_field, time_field, datetime_field */,
'jquery.instructure_misc_helpers' /* /\$\.uniq/ */,
'jquery.instructure_misc_plugins' /* /\.log\(/ */,
'compiled/jquery.rails_flash_notifications',
'vendor/jquery.scrollTo' /* /\.scrollTo/ */
], function(RceCommandShim, INST, I18n, $, _, FakeXHR, authenticity_token, htmlEscape) {
import {send} from 'jsx/shared/rce/RceCommandShim'
import INST from 'INST'
import I18n from 'i18n!instructure'
import $ from 'jquery'
import _ from 'underscore'
import FakeXHR from 'compiled/xhr/FakeXHR'
import authenticity_token from 'compiled/behaviors/authenticity_token'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON' /* ajaxJSON, defaultAjaxError */
import 'jquery.disableWhileLoading'
import 'jquery.google-analytics' /* trackEvent */
import 'jquery.instructure_date_and_time' /* date_field, time_field, datetime_field */
import 'jquery.instructure_misc_helpers' /* /\$\.uniq/ */
import 'compiled/jquery.rails_flash_notifications'
import 'vendor/jquery.scrollTo'
// Intercepts the default form submission process. Uses the form tag's
// current action and method attributes to know where to submit to.
@ -688,7 +685,7 @@ define([
}
try {
if($input.data('rich_text')) {
val = RceCommandShim.send($input, "get_code", false);
val = send($input, "get_code", false);
}
} catch(e) {}
var attr = $input.prop('name') || '';
@ -1163,4 +1160,3 @@ define([
if (!label.length) {return;}
return label[0].firstChild.textContent;
};
});

View File

@ -16,18 +16,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'INST' /* INST */,
'i18n!instructure',
'jquery' /* $ */,
'underscore',
'str/htmlEscape',
'compiled/str/TextHelper',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms',
'jqueryui/dialog',
'vendor/jquery.scrollTo' /* /\.scrollTo/ */
], function(INST, I18n, $, _, htmlEscape, TextHelper) {
import INST from 'INST'
import I18n from 'i18n!instructure'
import $ from 'jquery'
import _ from 'underscore'
import htmlEscape from 'str/htmlEscape'
import TextHelper from 'compiled/str/TextHelper'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms'
import 'jqueryui/dialog'
import 'vendor/jquery.scrollTo'
// Return the first value which passes a truth test
$.detect = function(collection, callback) {
@ -392,4 +390,3 @@ define([
}
return null;
};
});

View File

@ -19,10 +19,8 @@
// Catches specified key events and calls the provided function
// when they occur. Can use text or key codes, passed in as a
// space-separated string.
define([
'jquery' /* jQuery, $ */,
'jquery.instructure_date_and_time' /* datepicker */
], function($) {
import $ from 'jquery'
import 'jquery.instructure_date_and_time'
$.fn.keycodes = function(options, fn) {
/* Based loosely on Tzury Bar Yochay's js-hotkeys:
@ -97,5 +95,3 @@ $.fn.keycodes = function(options, fn) {
return this;
};
$.fn.keycodes.defaults = {ignore: ":input,object,embed", keyCodes: ""};
});

View File

@ -16,7 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define(['jquery'], function($){
import $ from 'jquery'
// Shows an ajax-loading image on the given object.
$.fn.loadingImg = function(options) {
@ -123,4 +123,3 @@ define(['jquery'], function($){
};
$.fn.loadingImage = $.fn.loadingImg;
});

View File

@ -19,10 +19,8 @@
// Scrolls the supplied object until its visible. Call from
// ("html,body") to scroll the window.
define([
'jquery' /* $ */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */
], function($) {
import $ from 'jquery'
import 'vendor/jquery.scrollTo'
$.fn.scrollToVisible = function(obj) {
var options = {};
@ -84,5 +82,3 @@ $.fn.scrollToVisible = function(obj) {
return this;
};
});

View File

@ -16,11 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' /* $ */,
'str/htmlEscape',
'jquery.instructure_misc_helpers' /* replaceTags */
], function($, htmlEscape) {
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.instructure_misc_helpers' /* replaceTags */
// Fills the selected object(s) with data values as specified. Plaintext values should be specified in the
// data: data used to fill template.
@ -167,5 +165,3 @@ define([
var opts = $.extend({}, options, {textValues: [value]});
return this.getTemplateData(opts)[value];
};
});

View File

@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define(['jquery', 'compiled/jquery/serializeForm'], function ($){
import $ from 'jquery'
import 'compiled/jquery/serializeForm'
var patterns = {
validate: /^[a-zA-Z][a-zA-Z0-9_-]*(?:\[(?:\d*|[a-zA-Z0-9_-]+)\])*$/,
@ -87,5 +88,3 @@ define(['jquery', 'compiled/jquery/serializeForm'], function ($){
return json;
};
});

View File

@ -24,10 +24,8 @@
*
* http://github.com/kborchers/jquery-ui-extensions
*/
define([
'jquery',
'jqueryui/menu'
], function( $ ) {
import $ from 'jquery'
import 'jqueryui/menu'
var proto = $.ui.menu.prototype,
originalRefresh = proto.refresh;
@ -199,5 +197,3 @@ $.extend( proto, {
this._trigger( "select", event, ui );
}
});
});

View File

@ -16,14 +16,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!accounts' /* I18n.t */,
'jquery' /* $ */,
'str/htmlEscape',
'compiled/behaviors/authenticity_token',
'jquery.ajaxJSON' /* getJSON */,
'jqueryui/dialog'
], function(I18n, $, h, authenticity_token) {
import I18n from 'i18n!accounts'
import $ from 'jquery'
import h from 'str/htmlEscape'
import authenticity_token from 'compiled/behaviors/authenticity_token'
import 'jquery.ajaxJSON'
import 'jqueryui/dialog'
function testLDAP() {
clearTestLDAP();
@ -127,5 +125,3 @@ define([
testLDAPLogin();
});
});
});

View File

@ -16,15 +16,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!link_enrollment',
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/dialog',
'jquery.instructure_misc_plugins' /* showIf */,
'jquery.templateData' /* fillTemplateData */
], function(I18n, $) {
import I18n from 'i18n!link_enrollment'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' /* formSubmit */
import 'jqueryui/dialog'
import 'jquery.instructure_misc_plugins' /* showIf */
import 'jquery.templateData' /* fillTemplateData */
/*global link_enrollment*/
window.link_enrollment = (function() {
@ -115,4 +113,3 @@ define([
}
});
});
});

View File

@ -16,17 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!pseudonyms.login' /* I18n.t */,
'jquery' /* $ */,
'str/htmlEscape',
'compiled/registration/signupDialog',
'jquery.fancyplaceholder' /* fancyPlaceholder */,
'jquery.google-analytics' /* trackPage, trackPageview */,
'jquery.instructure_forms' /* formSubmit, getFormData, formErrors, errorBox */,
'jquery.loadingImg' /* loadingImage */,
'compiled/jquery.rails_flash_notifications'
], function(I18n, $, htmlEscape, signupDialog) {
import I18n from 'i18n!pseudonyms.login'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import signupDialog from 'compiled/registration/signupDialog'
import 'jquery.fancyplaceholder' /* fancyPlaceholder */
import 'jquery.google-analytics' /* trackPage, trackPageview */
import 'jquery.instructure_forms' /* formSubmit, getFormData, formErrors, errorBox */
import 'jquery.loadingImg'
import 'compiled/jquery.rails_flash_notifications'
$("#coenrollment_link").click(function(event) {
event.preventDefault();
@ -72,4 +70,3 @@ define([
}
return success;
});
});

View File

@ -16,12 +16,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!manage_avatars',
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_misc_plugins' /* showIf */
], function(I18n, $) {
import I18n from 'i18n!manage_avatars'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_misc_plugins' /* showIf */
$(document).ready(function() {
$(".update_avatar_link").live('click', function(event) {
@ -53,4 +51,3 @@ $(document).ready(function() {
});
});
});
});

View File

@ -32,11 +32,9 @@
* http://www.gnu.org/licenses/lgpl.html
* Project Website: http://mathquill.com
*/
define([
'i18n!mathquill',
'jquery', /* jQuery, $ */
'str/htmlEscape'
], function(I18n, $, htmlEscape) {
import I18n from 'i18n!mathquill'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
var undefined,
_, //temp variable of prototypes
@ -2880,6 +2878,3 @@ define([
$('.mathquill-textbox:not(.mathquill-rendered-math)').mathquill('textbox');
$('.mathquill-embedded-latex').mathquill();
});
});

View File

@ -16,20 +16,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!media_comments',
'underscore',
'vendor/jquery.ba-tinypubsub',
'jquery' /* $ */,
'str/htmlEscape',
'compiled/jquery/mediaComment' /* $.fn.mediaComment */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jqueryui/dialog',
'jquery.instructure_misc_helpers' /* /\$\.h/, /\$\.fileSize/ */,
'jquery.instructure_misc_plugins' /* .dim, /\.log\(/ */,
'jqueryui/progressbar' /* /\.progressbar/ */,
'jqueryui/tabs' /* /\.tabs/ */
], function (I18n, _, pubsub, $, htmlEscape) {
import I18n from 'i18n!media_comments'
import _ from 'underscore'
import pubsub from 'vendor/jquery.ba-tinypubsub'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import mediaCommentsTemplate from 'jst/MediaComments'
import JsUploader from 'compiled/media_comments/js_uploader'
import 'compiled/jquery/mediaComment'
import 'jquery.ajaxJSON'
import 'jqueryui/dialog'
import 'jquery.instructure_misc_helpers' /* /\$\.h/, /\$\.fileSize/ */
import 'jquery.instructure_misc_plugins' /* .dim, /\.log\(/ */
import 'jqueryui/progressbar'
import 'jqueryui/tabs'
"use strict"
var jsUploader
@ -637,7 +637,7 @@ define([
alert(I18n.t('errors.save_failed_try_again', "Entry failed to save. Please try again."));
}
}
});
// Debugging methods for kaltura record widget. If These exist they'll be called.
//function deviceDetected(){

View File

@ -16,22 +16,21 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!quizzes.moderate',
'jquery' /* $ */,
'quiz_timing',
'jsx/quizzes/moderate/openModerateStudentDialog',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_date_and_time' /* datetimeString */,
'jquery.instructure_forms' /* fillFormData, getFormData */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_helpers' /* replaceTags */,
'jquery.instructure_misc_plugins' /* showIf */,
'compiled/jquery.rails_flash_notifications',
'jquery.templateData' /* fillTemplateData */,
'vendor/date' /* Date.parse */
], function(I18n, $, timing, openModerateStudentDialog) {
import I18n from 'i18n!quizzes.moderate'
import $ from 'jquery'
import timing from 'quiz_timing'
import openModerateStudentDialog from 'jsx/quizzes/moderate/openModerateStudentDialog'
import 'jquery.ajaxJSON'
import 'jquery.instructure_date_and_time' /* datetimeString */
import 'jquery.instructure_forms' /* fillFormData, getFormData */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'jquery.instructure_misc_helpers' /* replaceTags */
import 'jquery.instructure_misc_plugins' /* showIf */
import 'compiled/jquery.rails_flash_notifications'
import 'jquery.templateData' /* fillTemplateData */
import 'vendor/date' /* Date.parse */
var DIALOG_WIDTH = 490;
/**
* Updates the digit(s) in the "gets X extra minutes" message in a student's
@ -488,4 +487,3 @@ define([
outstanding.fetchData();
$("#check_outstanding").click(outstanding.init.bind(outstanding));
});
});

View File

@ -16,9 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' // $
], function($) {
import $ from 'jquery'
$(document).ready(function() {
$("#oauth2_accept_form").submit(function(){
@ -27,5 +25,3 @@ define([
$btn.attr('disabled', true);
});
});
});

View File

@ -16,11 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'INST' /* INST */,
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */
], function(INST, $) {
import INST from 'INST'
import $ from 'jquery'
import 'jquery.ajaxJSON'
$(document).ready(function(){
var interactionSeconds = 0,
@ -102,4 +100,3 @@ define([
}, 1000);
}
});
});

View File

@ -16,11 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!plugins',
'jquery' /* $ */,
'jquery.instructure_misc_plugins' /* showIf */
], function(I18n, $) {
import I18n from 'i18n!plugins'
import $ from 'jquery'
import 'jquery.instructure_misc_plugins' /* showIf */
$("form.edit_plugin_setting").live('submit', function() {
$(this).find("button").attr('disabled', true).filter(".save_button").text(I18n.t('buttons.saving', "Saving..."));
@ -30,5 +28,3 @@ define([
$("#settings .plugin_settings").showIf(!$(this).attr('checked'));
}).change();
});
});

View File

@ -16,15 +16,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!prerequisites_lookup',
'jquery',
'str/htmlEscape',
'spin.js',
'context_modules',
'jquery.ajaxJSON',
'jquery.instructure_misc_helpers'
], function(I18n, $, htmlEscape, Spinner) {
import I18n from 'i18n!prerequisites_lookup'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import Spinner from 'spin.js'
import 'context_modules'
import 'jquery.ajaxJSON'
import 'jquery.instructure_misc_helpers'
var lookupStarted = false;
@ -102,5 +100,3 @@ define([
})
}
$(document).ready(INST.lookupPrerequisites);
});

View File

@ -16,23 +16,21 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'INST' /* INST */,
'i18n!profile',
'jquery' /* $ */,
'compiled/models/Pseudonym',
'compiled/util/AvatarWidget',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_date_and_time' /* datetimeString, time_field, datetime_field */,
'jquery.instructure_forms' /* formSubmit, formErrors, errorBox */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange, showIf */,
'jquery.loadingImg' /* loadingImage */,
'jquery.templateData' /* fillTemplateData */,
'jqueryui/sortable' /* /\.sortable/ */,
'compiled/jquery.rails_flash_notifications'
], function(INST, I18n, $, Pseudonym, AvatarWidget) {
import INST from 'INST'
import I18n from 'i18n!profile'
import $ from 'jquery'
import Pseudonym from 'compiled/models/Pseudonym'
import AvatarWidget from 'compiled/util/AvatarWidget'
import 'jquery.ajaxJSON'
import 'jquery.instructure_date_and_time' /* datetimeString, time_field, datetime_field */
import 'jquery.instructure_forms' /* formSubmit, formErrors, errorBox */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange, showIf */
import 'jquery.loadingImg'
import 'jquery.templateData'
import 'jqueryui/sortable'
import 'compiled/jquery.rails_flash_notifications'
var $edit_settings_link = $(".edit_settings_link");
@ -341,4 +339,3 @@ define([
});
event.preventDefault();
});
});

View File

@ -16,17 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!question_banks',
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_date_and_time' /* datetimeString */,
'jquery.instructure_forms' /* formSubmit, fillFormData, formErrors */,
'jquery.instructure_misc_plugins' /* confirmDelete */,
'jquery.keycodes' /* keycodes */,
'jquery.loadingImg' /* loadingImage */,
'jquery.templateData' /* fillTemplateData, getTemplateData */
], function(I18n, $) {
import I18n from 'i18n!question_banks'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_date_and_time' /* datetimeString */
import 'jquery.instructure_forms' /* formSubmit, fillFormData, formErrors */
import 'jquery.instructure_misc_plugins' /* confirmDelete */
import 'jquery.keycodes'
import 'jquery.loadingImg'
import 'jquery.templateData'
$(document).ready(function() {
$(".add_bank_link").click(function(event) {
@ -137,4 +135,3 @@ $(document).ready(function() {
}
});
});
});

View File

@ -16,13 +16,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' /* $ */,
'jquery.instructure_misc_plugins' /* fragmentChange */,
'jquery.templateData' /* getTemplateData */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */,
'compiled/behaviors/quiz_selectmenu'
], function($) {
import $ from 'jquery'
import 'jquery.instructure_misc_plugins' /* fragmentChange */
import 'jquery.templateData'
import 'vendor/jquery.scrollTo'
import 'compiled/behaviors/quiz_selectmenu'
var parentWindow = {
exists: function(){
@ -459,6 +457,3 @@ define([
}
});
}
});

View File

@ -16,24 +16,22 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!quizzes.show',
'jquery' /* $ */,
'compiled/views/MessageStudentsDialog',
'quiz_arrows',
'quiz_inputs',
'compiled/models/Quiz',
'compiled/views/PublishButtonView',
'compiled/quizzes/dump_events',
'jsx/conditional_release_stats/index',
'jquery.instructure_date_and_time' /* dateString, time_field, datetime_field */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons',
'compiled/jquery.rails_flash_notifications',
'jquery.instructure_misc_plugins' /* ifExists, confirmDelete */,
'jquery.disableWhileLoading',
'message_students' /* messageStudents */
], function(I18n, $, MessageStudentsDialog, QuizArrowApplicator, inputMethods, Quiz, PublishButtonView, QuizLogAuditingEventDumper, CyoeStats) {
import I18n from 'i18n!quizzes.show'
import $ from 'jquery'
import MessageStudentsDialog from 'compiled/views/MessageStudentsDialog'
import QuizArrowApplicator from 'quiz_arrows'
import inputMethods from 'quiz_inputs'
import Quiz from 'compiled/models/Quiz'
import PublishButtonView from 'compiled/views/PublishButtonView'
import QuizLogAuditingEventDumper from 'compiled/quizzes/dump_events'
import CyoeStats from 'jsx/conditional_release_stats/index'
import 'jquery.instructure_date_and_time' /* dateString, time_field, datetime_field */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'compiled/jquery.rails_flash_notifications'
import 'jquery.instructure_misc_plugins' /* ifExists, confirmDelete */
import 'jquery.disableWhileLoading'
import 'message_students' /* messageStudents */
$(document).ready(function () {
@ -213,5 +211,3 @@ define([
var detailsParent = document.getElementById('not_right_side')
CyoeStats.init(graphsRoot, detailsParent)
});
});

View File

@ -16,7 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([ 'jquery', 'canvas_quizzes/apps/statistics' ], function($, app) {
import $ from 'jquery'
import app from 'canvas_quizzes/apps/statistics'
app.configure({
ajax: $.ajax,
loadOnStartup: true,
@ -28,4 +29,3 @@ define([ 'jquery', 'canvas_quizzes/apps/statistics' ], function($, app) {
app.mount(document.body.querySelector('#content')).then(function() {
console.log('Yeah!!!');
});
});

View File

@ -16,11 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' /* $ */,
'jqueryui/draggable' /* /\.draggable/ */,
'jquery.instructure_misc_plugins' /* confirmDelete */
], function($) {
import $ from 'jquery'
import 'jqueryui/draggable'
import 'jquery.instructure_misc_plugins' /* confirmDelete */
$(document).ready(function() {
$("#floating_reminders").draggable();
@ -93,8 +91,4 @@ $(document).ready(function() {
}
});
});
});
});

View File

@ -16,9 +16,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define(['edit_rubric', 'compiled/views/rubrics/EditRubricPage'], function(rubricEditing, EditRubricPage){
import rubricEditing from 'edit_rubric'
import EditRubricPage from 'compiled/views/rubrics/EditRubricPage'
document.addEventListener("rubricEditDataReady", function(e){
new EditRubricPage
rubricEditing.init()
});
});

View File

@ -16,9 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' /* $ */
], function($) {
import $ from 'jquery'
$(document).ready(function() {
var $saml_debug_info = $('#saml_debug_info'),
$start_saml_debugging = $('#start_saml_debugging'),
@ -77,4 +75,3 @@ define([
});
});
});

View File

@ -16,24 +16,22 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!section',
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_date_and_time' /* time_field, datetime_field */,
'jquery.instructure_forms' /* formSubmit, formErrors */,
'jqueryui/dialog',
'jquery.instructure_misc_helpers' /* replaceTags */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.keycodes' /* keycodes */,
'jquery.loadingImg' /* loadingImage */,
'jquery.templateData' /* fillTemplateData */,
'jqueryui/autocomplete' /* /\.autocomplete/ */,
'compiled/PaginatedList',
'jst/courses/section/enrollment',
'compiled/presenters/sectionEnrollmentPresenter',
'jsx/context_cards/StudentContextCardTrigger'
], function(I18n, $, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, PaginatedList, enrollmentTemplate, sectionEnrollmentPresenter) {
import I18n from 'i18n!section'
import $ from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_date_and_time' /* time_field, datetime_field */
import 'jquery.instructure_forms' /* formSubmit, formErrors */
import 'jqueryui/dialog'
import 'jquery.instructure_misc_helpers' /* replaceTags */
import 'jquery.instructure_misc_plugins' /* confirmDelete, showIf */
import 'jquery.keycodes'
import 'jquery.loadingImg'
import 'jquery.templateData'
import 'jqueryui/autocomplete'
import PaginatedList from 'compiled/PaginatedList'
import enrollmentTemplate from 'jst/courses/section/enrollment'
import sectionEnrollmentPresenter from 'compiled/presenters/sectionEnrollmentPresenter'
import 'jsx/context_cards/StudentContextCardTrigger'
$(document).ready(function() {
var section_id = window.location.pathname.split('/')[4],
@ -184,4 +182,3 @@ define([
});
});
});
});

View File

@ -16,15 +16,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!sis_import',
'jquery' /* $ */,
'str/htmlEscape',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* formSubmit, formErrors */,
'jquery.instructure_misc_plugins' /* showIf, disableIf */,
'jqueryui/progressbar' /* /\.progressbar/ */
], function(I18n, $, htmlEscape) {
import I18n from 'i18n!sis_import'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' /* formSubmit, formErrors */
import 'jquery.instructure_misc_plugins' /* showIf, disableIf */
import 'jqueryui/progressbar'
$(document).ready(function(event) {
var state = 'nothing';
@ -203,4 +201,3 @@ $(document).ready(function(event) {
check_if_importing();
});
});

View File

@ -16,17 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!sub_accounts',
'jquery' /* jQuery, $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* formSubmit, fillFormData */,
'jquery.instructure_misc_helpers' /* replaceTags */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.keycodes' /* keycodes */,
'jquery.loadingImg' /* loadingImage */,
'jquery.templateData' /* fillTemplateData, getTemplateData */
], function(I18n, jQuery) {
import I18n from 'i18n!sub_accounts'
import jQuery from 'jquery'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' /* formSubmit, fillFormData */
import 'jquery.instructure_misc_helpers' /* replaceTags */
import 'jquery.instructure_misc_plugins' /* confirmDelete, showIf */
import 'jquery.keycodes'
import 'jquery.loadingImg'
import 'jquery.templateData'
jQuery(function($){
@ -192,4 +190,3 @@ jQuery(function($){
});
});
});

View File

@ -16,15 +16,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'INST' /* INST */,
'i18n!submissions',
'jquery' /* $ */,
'str/htmlEscape',
'jquery.ajaxJSON' /* ajaxJSON */,
'jqueryui/dialog',
'jqueryui/progressbar' /* /\.progressbar/ */
], function(INST, I18n, $, htmlEscape) {
import INST from 'INST'
import I18n from 'i18n!submissions'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON'
import 'jqueryui/dialog'
import 'jqueryui/progressbar'
INST.downloadSubmissions = function(url) {
var cancelled = false;
@ -80,4 +78,3 @@ define([
}
checkForChange();
};
});

View File

@ -16,15 +16,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!calculator',
'jquery' /* $ */,
'calcCmd',
'str/htmlEscape',
'jquery.instructure_misc_helpers' /* /\$\.raw/ */,
'jquery.instructure_misc_plugins' /* showIf */,
'jqueryui/sortable' /* /\.sortable/ */
], function(I18n, $, calcCmd, htmlEscape) {
import I18n from 'i18n!calculator'
import $ from 'jquery'
import calcCmd from 'calcCmd'
import htmlEscape from 'str/htmlEscape'
import 'jquery.instructure_misc_helpers' /* /\$\.raw/ */
import 'jquery.instructure_misc_plugins' /* showIf */
import 'jqueryui/sortable'
var generateFinds = function($table) {
var finds = {};
@ -160,4 +158,3 @@ define([
});
}
};
});

View File

@ -16,30 +16,26 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'compiled/views/quizzes/FileUploadQuestionView',
'compiled/models/File',
'i18n!quizzes.take_quiz',
'jquery' /* $ */,
'compiled/behaviors/autoBlurActiveInput',
'underscore',
'compiled/views/quizzes/LDBLoginPopup',
'quizzes/quiz_taking_police',
'compiled/quizzes/log_auditing',
'compiled/quizzes/dump_events',
'compiled/views/editor/KeyboardShortcuts',
'jsx/shared/rce/RichContentEditor',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.toJSON',
'jquery.instructure_date_and_time' /* friendlyDatetime, friendlyDate */,
'jquery.instructure_forms' /* getFormData, errorBox */,
'jqueryui/dialog',
'compiled/jquery.rails_flash_notifications',
'vendor/jquery.scrollTo' /* /\.scrollTo/ */,
'compiled/behaviors/quiz_selectmenu'
], function(FileUploadQuestionView, File, I18n, $, autoBlurActiveInput, _,
LDBLoginPopup, quizTakingPolice, QuizLogAuditing,
QuizLogAuditingEventDumper, KeyboardShortcuts, RichContentEditor) {
import FileUploadQuestionView from 'compiled/views/quizzes/FileUploadQuestionView'
import File from 'compiled/models/File'
import I18n from 'i18n!quizzes.take_quiz'
import $ from 'jquery'
import autoBlurActiveInput from 'compiled/behaviors/autoBlurActiveInput'
import _ from 'underscore'
import LDBLoginPopup from 'compiled/views/quizzes/LDBLoginPopup'
import quizTakingPolice from 'quizzes/quiz_taking_police'
import QuizLogAuditing from 'compiled/quizzes/log_auditing'
import QuizLogAuditingEventDumper from 'compiled/quizzes/dump_events'
import KeyboardShortcuts from 'compiled/views/editor/KeyboardShortcuts'
import RichContentEditor from 'jsx/shared/rce/RichContentEditor'
import 'jquery.ajaxJSON'
import 'jquery.toJSON'
import 'jquery.instructure_date_and_time' /* friendlyDatetime, friendlyDate */
import 'jquery.instructure_forms' /* getFormData, errorBox */
import 'jqueryui/dialog'
import 'compiled/jquery.rails_flash_notifications'
import 'vendor/jquery.scrollTo'
import 'compiled/behaviors/quiz_selectmenu'
RichContentEditor.preloadRemoteModule();
@ -797,4 +793,3 @@ define([
});
$('.essay_question .answers .rce_links').append((new KeyboardShortcuts()).render().el);
});

View File

@ -49,27 +49,25 @@
// options.url is used for the href of the link, and options.title
// will be the body of the link if no text is currently selected.
define([
'i18nObj',
'jquery',
'jsx/shared/rce/editorOptions',
'compiled/editor/editorAccessibility', /* editorAccessibility */
'tinymce.editor_box_list',
'tinymce.config',
'tinymce.commands',
'tinymce.editor_box_utils',
//'compiled/tinymce', // required, but the bundles that ACTUALLY use
// tiny can require it themselves or else we have
// build problems
'INST', // for IE detection; need to handle links in a special way
'decode_string',
'jqueryui/draggable' /* /\.draggable/ */,
'jquery.instructure_misc_plugins' /* /\.indicate/ */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */,
'vendor/jquery.ba-tinypubsub'
], function(I18nObj, $, editorOptions,
EditorAccessibility, EditorBoxList, EditorConfig, EditorCommands,
Utils, INST, decodeString) {
import I18nObj from 'i18nObj'
import $ from 'jquery'
import editorOptions from 'jsx/shared/rce/editorOptions'
import EditorAccessibility from 'compiled/editor/editorAccessibility'
import EditorBoxList from 'tinymce.editor_box_list'
import EditorConfig from 'tinymce.config'
import EditorCommands from 'tinymce.commands'
import Utils from 'tinymce.editor_box_utils'
//'compiled/tinymce', // required, but the bundles that ACTUALLY use
// tiny can require it themselves or else we have
// build problems
import INST from 'INST'
import decodeString from 'decode_string'
import 'jqueryui/draggable'
import 'jquery.instructure_misc_plugins' /* /\.indicate/ */
import 'vendor/jquery.scrollTo'
import 'vendor/jquery.ba-tinypubsub'
var enableBookmarking = !!INST.browser.ie;
$(document).ready(function() {
@ -521,5 +519,3 @@ define([
$(e).indicate({offset: offset, singleFlash: true, scroll: true, container: $(box).find('iframe')});
}
};
});

View File

@ -19,15 +19,13 @@
// tinymce doesn't like its plugins being async,
// all dependencies must export to window
define([
'compiled/editor/stocktiny',
'i18n!editor',
'jquery',
'str/htmlEscape',
'jsx/shared/rce/RceCommandShim',
'jqueryui/dialog',
'jquery.instructure_misc_helpers'
], function(tinymce, I18n, $, htmlEscape, RceCommandShim) {
import tinymce from 'compiled/editor/stocktiny'
import I18n from 'i18n!editor'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import {send} from 'jsx/shared/rce/RceCommandShim'
import 'jqueryui/dialog'
import 'jquery.instructure_misc_helpers'
var $box, $editor, $userURL, $altText, $actions, $flickrLink;
@ -79,7 +77,7 @@ define([
var title = data.title,
html = '<a href="' + htmlEscape(data.link_url) + '"><img src="' + htmlEscape(data.image_url) + '" title="' + htmlEscape(title) + '"alt="' + htmlEscape(title) + '" style="max-width: 500; max-height: 500"></a>';
$box.dialog('close');
RceCommandShim.send($editor, 'insert_code', html);
send($editor, 'insert_code', html);
});
}
@ -89,7 +87,7 @@ define([
event.preventDefault();
var html = "<img src='" + htmlEscape(text) + "' alt='" + htmlEscape(alt) + "'/>";
RceCommandShim.send($editor, 'insert_code', html);
send($editor, 'insert_code', html);
$box.dialog('close');
}
@ -174,4 +172,3 @@ define([
});
tinymce.PluginManager.add('instructure_embed', tinymce.plugins.InstructureEmbed);
});

View File

@ -18,12 +18,10 @@
// xsslint safeString.identifier frameHeight teaser
define([
'compiled/editor/stocktiny',
'jquery',
'tinymce_plugins/instructure_equella/initializeEquella',
'jqueryui/dialog'
], function(tinymce, $, initializeEquella) {
import tinymce from 'compiled/editor/stocktiny'
import $ from 'jquery'
import initializeEquella from 'tinymce_plugins/instructure_equella/initializeEquella'
import 'jqueryui/dialog'
tinymce.create('tinymce.plugins.InstructureEquella', {
init : function(ed, url) {
@ -51,5 +49,3 @@ define([
// Register plugin
tinymce.PluginManager.add('instructure_equella', tinymce.plugins.InstructureEquella);
});

View File

@ -16,10 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'compiled/editor/stocktiny',
'tinymce_plugins/instructure_record/mediaEditorLoader'
], function(tinymce, mediaEditorLoader) {
import tinymce from 'compiled/editor/stocktiny'
import mediaEditorLoader from 'tinymce_plugins/instructure_record/mediaEditorLoader'
tinymce.create('tinymce.plugins.InstructureRecord', {
init : function(ed, url) {
@ -44,4 +42,3 @@ define([
// Register plugin
tinymce.PluginManager.add('instructure_record', tinymce.plugins.InstructureRecord);
});

View File

@ -16,7 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define(['jquery', 'jquery.google-analytics', 'compiled/jquery/ModuleSequenceFooter'], function($) {
import $ from 'jquery'
import 'jquery.google-analytics'
import 'compiled/jquery/ModuleSequenceFooter'
var $toolForm = $("#tool_form")
@ -180,5 +182,3 @@ function removeUnloadMessage() {
beforeUnloadHandler = null;
}
}
});

View File

@ -1,5 +1,5 @@
// this file was auto-generated by rake i18n:generate_js.
// you probably shouldn't edit it directly
define(['i18nObj', 'jquery'], function(I18n, $) {
import I18n from 'i18nObj'
import $ from 'jquery'
$.extend(true, I18n, {translations: {"en":{"date":{"abbr_day_names":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"abbr_month_names":[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"datepicker":{"column_headings":["Su","Mo","Tu","We","Th","Fr","Sa"]},"day_names":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"days":{"today_lower":"today"},"formats":{"date_at_time":"%b %-d at %l:%M%P","default":"%Y-%m-%d","full":"%b %-d, %Y %-l:%M%P","full_with_weekday":"%a %b %-d, %Y %-l:%M%P","long":"%B %-d, %Y","long_with_weekday":"%A, %B %-d","medium":"%b %-d, %Y","medium_month":"%b %Y","medium_with_weekday":"%a %b %-d, %Y","short":"%b %-d","short_month":"%b","short_weekday":"%a","short_with_weekday":"%a, %b %-d","weekday":"%A"},"month_names":[null,"January","February","March","April","May","June","July","August","September","October","November","December"],"order":["year","month","day"]},"datetime":{"distance_in_words":{"about_x_hours":{"one":"about 1 hour","other":"about %{count} hours"},"about_x_months":{"one":"about 1 month","other":"about %{count} months"},"about_x_years":{"one":"about 1 year","other":"about %{count} years"},"almost_x_years":{"one":"almost 1 year","other":"almost %{count} years"},"half_a_minute":"half a minute","less_than_x_minutes":{"one":"less than a minute","other":"less than %{count} minutes"},"less_than_x_seconds":{"one":"less than 1 second","other":"less than %{count} seconds"},"over_x_years":{"one":"over 1 year","other":"over %{count} years"},"x_days":{"one":"1 day","other":"%{count} days"},"x_minutes":{"one":"1 minute","other":"%{count} minutes"},"x_months":{"one":"1 month","other":"%{count} months"},"x_seconds":{"one":"1 second","other":"%{count} seconds"}},"prompts":{"day":"Day","hour":"Hour","minute":"Minute","month":"Month","second":"Seconds","year":"Year"}},"number":{"currency":{"format":{"delimiter":",","format":"%u%n","precision":2,"separator":".","significant":false,"strip_insignificant_zeros":false,"unit":"$"}},"format":{"delimiter":",","precision":3,"separator":".","significant":false,"strip_insignificant_zeros":false},"human":{"decimal_units":{"format":"%n %u","units":{"billion":"Billion","million":"Million","quadrillion":"Quadrillion","thousand":"Thousand","trillion":"Trillion","unit":""}},"format":{"delimiter":"","precision":3,"significant":true,"strip_insignificant_zeros":true},"storage_units":{"format":"%n %u","units":{"byte":{"one":"Byte","other":"Bytes"},"gb":"GB","kb":"KB","mb":"MB","tb":"TB"}}},"percentage":{"format":{"delimiter":"","format":"%n%"}},"precision":{"format":{"delimiter":""}}},"support":{"array":{"last_word_connector":", and ","or":{"last_word_connector":", or ","two_words_connector":" or "},"two_words_connector":" and ","words_connector":", "},"help_menu":{"cisco_netacad_facebook":"Support Community","cisco_netacad_facebook_description":"Please visit our Networking Academy Facebook page for community support or contact your instructor.","community_support_description":"Interact with and get assistance from your peers.","community_support_forums":"Community Support Forums","contact_support":"Contact Support","contact_support_sub_text":"Get assistance with time-sensitive issues.","curriculum_assessment_errata":"Curriculum\/Assessment Errata","curriculum_assessment_errata_description":"View already reported assessment and curricula errors. Search for \"errata.\"","global_support_desk":"Global Support Desk","global_support_desk_description":"Our ASCs are your first line of support, and can connect you with our Global Support Desk for issues that require additional assistance.","networking_academy_description":"View Cisco answers to the most commonly asked questions.","networking_academy_faqs":"Networking Academy FAQs","support_desk_livechat":"Support Desk Live Chat"}},"time":{"am":"am","formats":{"default":"%a, %d %b %Y %H:%M:%S %z","long":"%B %d, %Y %H:%M","short":"%d %b %H:%M","tiny":"%l:%M%P","tiny_on_the_hour":"%l%P"},"pm":"pm"}}}});
});

View File

@ -16,10 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define(function(){
window.tinyMCEPreInit = {
base: '/javascripts/tinymce/jscripts/tiny_mce',
suffix: '',
query: ''
};
});

View File

@ -16,9 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'underscore'
], function(_) {
import _ from 'underscore'
// backward is a stupid requirement for discussions
_.flattenObjects = function(array, key, backward, output) {
if (!_.isArray(array)) {array = [array];}
@ -36,4 +34,3 @@ define([
});
return output;
};
});

View File

@ -16,11 +16,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!users',
'jquery' /* $ */,
'jquery.instructure_misc_plugins' /* confirmDelete */
], function(I18n, $) {
import I18n from 'i18n!users'
import $ from 'jquery'
import 'jquery.instructure_misc_plugins' /* confirmDelete */
$(function(){
$(".courses .course,.groups .group").bind('focus mouseover', function(event) {
$(this).find(".info").addClass('info_hover');
@ -41,4 +40,3 @@ $(function(){
});
});
})
});

View File

@ -16,11 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery',
'i18n!user_grades',
'jquery.ajaxJSON'
], function($, I18n) {
import $ from 'jquery'
import I18n from 'i18n!user_grades'
import 'jquery.ajaxJSON'
$(document).ready(function() {
$(".grading_periods_selector").each(function () {
var $selector = $(this),
@ -57,4 +55,3 @@ define([
});
});
});

View File

@ -16,16 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!user_logins',
'jquery' /* $ */,
'compiled/models/Pseudonym',
'jquery.instructure_forms' /* formSubmit, fillFormData, formErrors */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.templateData' /* fillTemplateData, getTemplateData */
], function(I18n, $, Pseudonym) {
import I18n from 'i18n!user_logins'
import $ from 'jquery'
import Pseudonym from 'compiled/models/Pseudonym'
import 'jquery.instructure_forms' /* formSubmit, fillFormData, formErrors */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'jquery.instructure_misc_plugins' /* confirmDelete, showIf */
import 'jquery.templateData'
$(document).ready(function() {
var $form = $("#edit_pseudonym_form");
$form.formSubmit({
@ -166,4 +165,3 @@ $(document).ready(function() {
event.preventDefault();
});
});
});

View File

@ -16,16 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!user_name',
'jquery' /* $ */,
'str/htmlEscape',
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.templateData' /* fillTemplateData */
], function(I18n, $, htmlEscape) {
import I18n from 'i18n!user_name'
import $ from 'jquery'
import htmlEscape from 'str/htmlEscape'
import 'jquery.ajaxJSON'
import 'jquery.instructure_forms' /* formSubmit */
import 'jqueryui/dialog'
import 'compiled/jquery/fixDialogButtons'
import 'jquery.templateData'
$(document).ready(function() {
$("#name_and_email").delegate('.edit_user_link', 'click', function(event) {
event.preventDefault();
@ -79,4 +78,3 @@ $(document).ready(function() {
});
});
});
});

View File

@ -16,15 +16,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'i18n!user_notes',
'jquery',
'jquery.instructure_forms',
'jquery.loadingImg',
'jquery.instructure_date_and_time',
'jquery.instructure_misc_plugins',
'vendor/jquery.pageless' /* pageless */
], function(I18n, $) {
import I18n from 'i18n!user_notes'
import $ from 'jquery'
import 'jquery.instructure_forms'
import 'jquery.loadingImg'
import 'jquery.instructure_date_and_time'
import 'jquery.instructure_misc_plugins'
import 'vendor/jquery.pageless'
if (ENV.user_note_list_pageless_options) {
$('#user_note_list').pageless(ENV.user_note_list_pageless_options);
@ -104,4 +102,3 @@ define([
}
});
});
});

View File

@ -16,10 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define([
'jquery' /* jQuery, $ */,
'user_utils' /* userUtils */
], function($, userUtils) {
import $ from 'jquery'
import userUtils from 'user_utils'
$(function () {
var $short_name = $('input[name="user[short_name]"]')
@ -43,5 +41,3 @@ $(function () {
prior_name = $(this).attr('value');
});
});
});

View File

@ -7,7 +7,7 @@
* @website: http://www.datejs.com/
*/
define(['vendor/date-js/globalization/en-US'], function() {
import 'vendor/date-js/globalization/en-US'
(function () {
var _originalDateDotPrototypeDotToString = Date.prototype.toString;
var $D = Date,
@ -870,4 +870,3 @@ define(['vendor/date-js/globalization/en-US'], function() {
) : _originalDateDotPrototypeDotToString.apply(this, arguments);
};
}());
});

View File

@ -134,6 +134,7 @@ Date.CultureInfo = {
};
});
/********************
** Future Strings **
********************

View File

@ -7,7 +7,7 @@
* @website: http://www.datejs.com/
*/
define(['vendor/date-js/sugarpak'], function() {
import 'vendor/date-js/sugarpak'
(function () {
Date.Parsing = {
Exception: function (s) {
@ -1118,4 +1118,3 @@ define(['vendor/date-js/sugarpak'], function() {
return $D.getParseFunction(fx)(s);
};
}());
});

View File

@ -13,7 +13,7 @@
**************************************************************
*/
define(['vendor/date-js/core'], function() {
import 'vendor/date-js/core'
(function () {
var $D = Date, $P = $D.prototype, $C = $D.CultureInfo, $N = Number.prototype;
@ -474,4 +474,3 @@ define(['vendor/date-js/core'], function() {
$P[nth[l]] = (l === 0) ? nthfn(-1) : nthfn(l);
}
}());
});

View File

@ -1,3 +1,3 @@
// just a stub to require the right date.js source file to behave the same as
// the old minified version
define(['vendor/date-js/parser'], function() {});
import 'vendor/date-js/parser'

View File

@ -11,7 +11,7 @@
* @licens MIT License - http://www.opensource.org/licenses/mit-license.php
*/
define(['jquery'], function($){
import $ from 'jquery'
$.fn.extend({
elastic: function(options) {
var opts = $.extend({}, options),
@ -112,4 +112,3 @@ define(['jquery'], function($){
});
}
});
});

View File

@ -47,9 +47,7 @@
// * famspam.com/facebox
// =======================================================================
define([
'jquery' /* jQuery, $ */
], function($) {
import $ from 'jquery'
var FALSE = !1
, TRUE = !FALSE
@ -216,4 +214,3 @@ define([
return this;
};
});

View File

@ -4,7 +4,7 @@
* Copyright 2010, Daniel Stocks (http://webcloud.se)
* Released under the MIT, BSD, and GPL Licenses.
*/
define(['jquery'], function($) {
import $ from 'jquery'
function Placeholder(input) {
this.input = input;
if (input.attr('type') == 'password') {
@ -103,5 +103,3 @@ define(['jquery'], function($) {
}
});
}
});

View File

@ -19,7 +19,7 @@
*
*/
define(['jquery'], function($){
import $ from 'jquery'
var methods = {
init: function(settings) {
@ -469,5 +469,3 @@ define(['jquery'], function($){
targetType : 'hint',
width : undefined
};
});

View File

@ -53,7 +53,7 @@
* @desc Scroll on both axes, to different values
* @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } );
*/
define(['jquery'], function($){
import $ from 'jquery'
var $scrollTo = $.scrollTo = function( target, duration, settings ){
$(window).scrollTo( target, duration, settings );
@ -211,5 +211,3 @@ define(['jquery'], function($){
function both( val ){
return typeof val == 'object' ? val : { top:val, left:val };
};
});

View File

@ -23,7 +23,7 @@
//
define(['jquery'], function($) {
import $ from 'jquery'
$.extend({
template : function(template, values) {
// handle a blank template or replacement value object correctly
@ -38,4 +38,3 @@ define(['jquery'], function($) {
return template.replace(regexMatchingPattern, replacementFunction);
}
});
});

View File

@ -1,4 +1,4 @@
define(['jquery'],function($) {
import $ from 'jquery'
/*!
* jquery.event.drag - v 2.2
@ -402,5 +402,3 @@ $event.fixHooks.touchcancel = {
$special.draginit = $special.dragstart = $special.dragend = drag;
})( $ );
});

View File

@ -1,4 +1,5 @@
define(['jquery','vendor/slickgrid/slick.core'],function(jQuery) {
import jQuery from 'jquery'
import 'vendor/slickgrid/slick.core'
(function ($) {
// register namespace
@ -187,5 +188,3 @@ define(['jquery','vendor/slickgrid/slick.core'],function(jQuery) {
});
}
})(jQuery);
});

View File

@ -1,4 +1,5 @@
define(['jquery','vendor/slickgrid/lib/jquery.event.drag-2.2'],function($) {
import $ from 'jquery'
import 'vendor/slickgrid/lib/jquery.event.drag-2.2'
/***
* Contains core SlickGrid classes.
@ -457,5 +458,3 @@ define(['jquery','vendor/slickgrid/lib/jquery.event.drag-2.2'],function($) {
};
}
})($);
});

View File

@ -1,4 +1,5 @@
define(['jquery','vendor/slickgrid/slick.core'],function(jQuery) {
import jQuery from 'jquery'
import 'vendor/slickgrid/slick.core'
/***
* Contains basic SlickGrid editors.
@ -649,5 +650,3 @@ define(['jquery','vendor/slickgrid/slick.core'],function(jQuery) {
}
}
})(jQuery);
});

View File

@ -1,7 +1,6 @@
define([
'jquery',
'vendor/slickgrid/slick.core',
'vendor/slickgrid/lib/jquery.event.drag-2.2'],function(jQuery) {
import jQuery from 'jquery'
import 'vendor/slickgrid/slick.core'
import 'vendor/slickgrid/lib/jquery.event.drag-2.2'
/**
* @license
@ -3878,5 +3877,3 @@ if (typeof Slick === "undefined") {
init();
}
}(jQuery));
});

View File

@ -15,22 +15,22 @@
# 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/>.
define ['course_settings_helper', 'jquery'], (courseSettingsHelper, $) ->
define ['course_settings_helper', 'jquery'], ({tabIdFromElement}, $) ->
QUnit.module "course_settings_helper",
test 'non LTI 2 tools', ->
externalTool = document.createElement('li')
externalTool.id = 'nav_edit_tab_id_context_external_tool_165'
tabId = courseSettingsHelper.tabIdFromElement(externalTool)
tabId = tabIdFromElement(externalTool)
equal tabId, 'context_external_tool_165'
test 'LTI 2 tools', ->
externalTool = document.createElement('li')
externalTool.id = 'nav_edit_tab_id_lti/message_handler_1'
tabId = courseSettingsHelper.tabIdFromElement(externalTool)
tabId = tabIdFromElement(externalTool)
equal tabId, 'lti/message_handler_1'
test 'standard navigation items', ->
externalTool = document.createElement('li')
externalTool.id = 'nav_edit_tab_id_4'
tabId = courseSettingsHelper.tabIdFromElement(externalTool)
tabId = tabIdFromElement(externalTool)
equal tabId, '4'

View File

@ -15,7 +15,7 @@
# 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/>.
define ['submit_assignment_helper','jquery'], (SubmitAssignmentHelper, $) ->
define ['submit_assignment_helper','jquery'], ({submitContentItem}, $) ->
formHtml = """
<div id="form-container">
<form accept-charset="UTF-8" action="/courses/2/assignments/1/submissions" id="submit_online_url_form" method="post">
@ -86,7 +86,7 @@ define ['submit_assignment_helper','jquery'], (SubmitAssignmentHelper, $) ->
ENV = originalEnv
test "correctly populates form values for LtiLinkItem", ->
SubmitAssignmentHelper.submitContentItem(contentItem)
submitContentItem(contentItem)
equal $("#external_tool_url").val(), url
equal $("#external_tool_submission_type").val(), 'basic_lti_launch'
@ -95,7 +95,7 @@ define ['submit_assignment_helper','jquery'], (SubmitAssignmentHelper, $) ->
fileItem['@type'] = 'FileItem'
fileItem['@id'] = fileUrl
fileItem.url = fileUrl
SubmitAssignmentHelper.submitContentItem(fileItem)
submitContentItem(fileItem)
equal $("#external_tool_url").val(), fileUrl
equal $("#external_tool_submission_type").val(), "online_url_to_file"
@ -104,7 +104,7 @@ define ['submit_assignment_helper','jquery'], (SubmitAssignmentHelper, $) ->
unsupportedItem['@type'] = 'FileItem'
unsupportedItem.url = 'https://lti-tool-provider-example.herokuapp.com/test_file.jpg'
result = SubmitAssignmentHelper.submitContentItem(unsupportedItem)
result = submitContentItem(unsupportedItem)
equal result, false
test "accepts supported file types", ->
@ -112,17 +112,17 @@ define ['submit_assignment_helper','jquery'], (SubmitAssignmentHelper, $) ->
supportedItem['@type'] = 'FileItem'
supportedItem.url = fileUrl
result = SubmitAssignmentHelper.submitContentItem(supportedItem)
result = submitContentItem(supportedItem)
equal result, true
test "correctly populates form values for FileItem", ->
unsupportedItem = contentItem
unsupportedItem['@type'] = 'UnsupportedType'
result = SubmitAssignmentHelper.submitContentItem(unsupportedItem)
result = submitContentItem(unsupportedItem)
equal result, false
test "returns false if not given an item", ->
result = SubmitAssignmentHelper.submitContentItem(undefined)
result = submitContentItem(undefined)
equal result, false

View File

@ -20,7 +20,7 @@ define([
'jquery',
'eportfolios/eportfolio_section',
'helpers/fixtures'
], ($, EportfolioSection, fixtures) => {
], ($, {fetchContent}, fixtures) => {
var $section = null
QUnit.module("EportfolioSection -> fetchContent", {
@ -44,13 +44,13 @@ define([
});
test('grabs section content for rich_text type', ()=>{
var content = EportfolioSection.fetchContent($section, 'rich_text', 'section1')
var content = fetchContent($section, 'rich_text', 'section1')
equal(content['section1[section_type]'], 'rich_text')
equal(content['section1[content]'].trim(), '<p>Some Editor Content</p>')
})
test("uses edit field value for html type", ()=>{
var content = EportfolioSection.fetchContent($section, 'html', 'section1')
var content = fetchContent($section, 'html', 'section1')
equal(content['section1[section_type]'], 'html')
equal(content['section1[content]'].trim(), 'Some HTML Content')
})