Skip to content

Commit 36bd600

Browse files
committed
fix some errors in coffeescript files
mostly things that tried to use a module without requiring it Change-Id: Iedb2826534ce842a41333c5757195e88d2a4ce38 Reviewed-on: https://gerrit.instructure.com/101114 Tested-by: Jenkins Reviewed-by: Clay Diffrient <cdiffrient@instructure.com> Product-Review: Ryan Shaw <ryan@instructure.com> QA-Review: Ryan Shaw <ryan@instructure.com>
1 parent 6bdc495 commit 36bd600

16 files changed

Lines changed: 28 additions & 18 deletions

app/coffeescripts/behaviors/firefox_number_fix.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Should be removed once firefox fixes the issue and is used in production version of firefox.
33
define [
44
'jquery'
5-
'jquery.instructure_forms'
65
'i18n!firefox_fix'
7-
], ($) ->
6+
'jquery.instructure_forms'
7+
], ($, I18n) ->
88

99
onChangeHandler = (e) ->
1010
numInput = $(e.target)

app/coffeescripts/bundles/legacy/external_content_success.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require [
88

99
dataReady = (data, service_id) ->
1010

11-
e = jQuery.Event( "externalContentReady" )
11+
e = $.Event( "externalContentReady" )
1212
e.contentItems = data
1313
e.service_id = service_id
1414
parentWindow.$(parentWindow).trigger "externalContentReady", e

app/coffeescripts/bundles/student_group_dialog.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
require [
2+
'jquery'
23
'compiled/models/Group'
34
'compiled/models/GroupCategory'
45
'compiled/views/groups/manage/GroupEditView'
5-
], (Group, GroupCategory, GroupEditView) ->
6+
], ($, Group, GroupCategory, GroupEditView) ->
7+
68
group = new Group(ENV.group)
79
groupCategory = new GroupCategory(ENV.group_category)
810
@editView = new GroupEditView({model: group, groupCategory: groupCategory, nameOnly: true})

app/coffeescripts/collections/PaginatedCollection.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
#
1818

1919
define [
20+
'jquery'
2021
'Backbone'
2122
'underscore'
22-
], (Backbone, _) ->
23+
], ($, Backbone, _) ->
2324

2425
capitalize = (string = '') ->
2526
string.charAt(0).toUpperCase() + string.substring(1).toLowerCase()

app/coffeescripts/jquery.kylemenu.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ define [
4646
else
4747
tabKey = { which: $.ui.keyCode.TAB }
4848

49-
pressTab = jQuery.Event('keydown', tabKey)
49+
pressTab = $.Event('keydown', tabKey)
5050
@$trigger.focus().trigger(pressTab)
5151

5252
popupInstance = @$menu.data('popup')

app/coffeescripts/react_files/utils/setUsageRights.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ define [
4747
},
4848
success: (data) ->
4949
callback(true, data)
50-
error: ->
50+
error: (data) ->
5151
callback(false, data)
5252
)

app/coffeescripts/registration/signupDialog.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ define [
6565
$("input[name='#{htmlEscape data.error.input_name}']").
6666
next('.error_message').
6767
text(htmlEscape error_msg)
68-
$.screenReaderFlashMessage(error_message)
68+
$.screenReaderFlashMessage(error_msg)
6969

7070
$node.dialog
7171
resizable: false

app/coffeescripts/str/TextHelper.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
#
1818

1919
define [
20+
'jquery'
2021
'i18n!lib.text_helper'
2122
'str/htmlEscape'
22-
], (I18n, htmlEscape) ->
23+
], ($, I18n, htmlEscape) ->
2324

2425
AUTO_LINKIFY_PLACEHOLDER = "LINK-PLACEHOLDER"
2526
AUTO_LINKIFY_REGEX = ///

app/coffeescripts/util/addPrivacyLinkToDialog.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
define [
2+
'jquery'
23
'i18n!site'
3-
], (I18n) ->
4+
], ($, I18n) ->
45

56
addPrivacyLinkToDialog = ($dialog) ->
67
return unless ENV.ACCOUNT.privacy_policy_url

app/coffeescripts/util/mimeClass.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
define [
22
'i18n!mimeClass'
3-
], ->
3+
], (I18n) ->
44

55
# this module works together with app/stylesheets/components/_MimeClassIcons.scss
66
# so, given the mime-type of a file you can give it a css class name that corresponds to it.
@@ -122,4 +122,4 @@ define [
122122
mimeClass.mimeClasses[mimeType] = cls
123123

124124

125-
return mimeClass
125+
return mimeClass

0 commit comments

Comments
 (0)