-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use double quotes in CoffeeScript files #1900
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
App.AdvancedSearch = | ||
|
||
advanced_search_terms: -> | ||
$('#js-advanced-search').data('advanced-search-terms') | ||
$("#js-advanced-search").data("advanced-search-terms") | ||
|
||
toggle_form: (event) -> | ||
event.preventDefault() | ||
$('#js-advanced-search').slideToggle() | ||
$("#js-advanced-search").slideToggle() | ||
|
||
toggle_date_options: -> | ||
if $('#js-advanced-search-date-min').val() == 'custom' | ||
$('#js-custom-date').show() | ||
if $("#js-advanced-search-date-min").val() == "custom" | ||
$("#js-custom-date").show() | ||
$( ".js-calendar" ).datepicker( "option", "disabled", false ) | ||
else | ||
$('#js-custom-date').hide() | ||
$("#js-custom-date").hide() | ||
$( ".js-calendar" ).datepicker( "option", "disabled", true ) | ||
|
||
init_calendar: -> | ||
locale = $('#js-locale').data('current-locale') | ||
if locale == 'en' | ||
locale = '' | ||
locale = $("#js-locale").data("current-locale") | ||
if locale == "en" | ||
locale = "" | ||
|
||
$('.js-calendar').datepicker | ||
$(".js-calendar").datepicker | ||
regional: locale | ||
maxDate: "+0d" | ||
$('.js-calendar-full').datepicker | ||
$(".js-calendar-full").datepicker | ||
regional: locale | ||
|
||
initialize: -> | ||
App.AdvancedSearch.init_calendar() | ||
|
||
if App.AdvancedSearch.advanced_search_terms() | ||
$('#js-advanced-search').show() | ||
$("#js-advanced-search").show() | ||
App.AdvancedSearch.toggle_date_options() | ||
|
||
$('#js-advanced-search-title').on | ||
$("#js-advanced-search-title").on | ||
click: (event) -> | ||
App.AdvancedSearch.toggle_form(event) | ||
|
||
$('#js-advanced-search-date-min').on | ||
$("#js-advanced-search-date-min").on | ||
change: -> | ||
App.AdvancedSearch.toggle_date_options() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
App.CheckAllNone = | ||
|
||
initialize: -> | ||
$('[data-check-all]').on 'click', -> | ||
target_name = $(this).data('check-all') | ||
$("[name='" + target_name + "']").prop('checked', true) | ||
$("[data-check-all]").on "click", -> | ||
target_name = $(this).data("check-all") | ||
$("[name='#{target_name}']").prop("checked", true) | ||
|
||
$('[data-check-none]').on 'click', -> | ||
target_name = $(this).data('check-none') | ||
$("[name='" + target_name + "']").prop('checked', false) | ||
$("[data-check-none]").on "click", -> | ||
target_name = $(this).data("check-none") | ||
$("[name='#{target_name}']").prop("checked", false) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
App.CheckboxToggle = | ||
|
||
initialize: -> | ||
$('[data-checkbox-toggle]').on 'change', -> | ||
$("[data-checkbox-toggle]").on "change", -> | ||
$this = $(this) | ||
$target = $($this.data('checkbox-toggle')) | ||
if $this.is(':checked') | ||
$target = $($this.data("checkbox-toggle")) | ||
if $this.is(":checked") | ||
$target.show() | ||
else | ||
$target.hide() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,16 @@ App.Documentable = | |
|
||
initialize: -> | ||
|
||
inputFiles = $('.js-document-attachment') | ||
inputFiles = $(".js-document-attachment") | ||
$.each inputFiles, (index, input) -> | ||
App.Documentable.initializeDirectUploadInput(input) | ||
|
||
$('#nested-documents').on 'cocoon:after-remove', (e, insertedItem) -> | ||
$("#nested-documents").on "cocoon:after-remove", (e, insertedItem) -> | ||
App.Documentable.unlockUploads() | ||
|
||
$('#nested-documents').on 'cocoon:after-insert', (e, nested_document) -> | ||
input = $(nested_document).find('.js-document-attachment') | ||
input["lockUpload"] = $(nested_document).closest('#nested-documents').find('.document:visible').length >= $('#nested-documents').data('max-documents-allowed') | ||
$("#nested-documents").on "cocoon:after-insert", (e, nested_document) -> | ||
input = $(nested_document).find(".js-document-attachment") | ||
input["lockUpload"] = $(nested_document).closest("#nested-documents").find(".document:visible").length >= $("#nested-documents").data("max-documents-allowed") | ||
App.Documentable.initializeDirectUploadInput(input) | ||
App.Documentable.lockUploads() if input["lockUpload"] | ||
|
||
|
@@ -30,7 +30,7 @@ App.Documentable = | |
add: (e, data) -> | ||
data = App.Documentable.buildFileUploadData(e, data) | ||
App.Documentable.clearProgressBar(data) | ||
App.Documentable.setProgressBar(data, 'uploading') | ||
App.Documentable.setProgressBar(data, "uploading") | ||
data.submit() | ||
|
||
change: (e, data) -> | ||
|
@@ -40,26 +40,26 @@ App.Documentable = | |
fail: (e, data) -> | ||
$(data.cachedAttachmentField).val("") | ||
App.Documentable.clearFilename(data) | ||
App.Documentable.setProgressBar(data, 'errors') | ||
App.Documentable.setProgressBar(data, "errors") | ||
App.Documentable.clearInputErrors(data) | ||
App.Documentable.setInputErrors(data) | ||
$(data.destroyAttachmentLinkContainer).find("a.delete:not(.remove-nested)").remove() | ||
$(data.addAttachmentLabel).addClass('error') | ||
$(data.addAttachmentLabel).addClass("error") | ||
$(data.addAttachmentLabel).show() | ||
|
||
done: (e, data) -> | ||
$(data.cachedAttachmentField).val(data.result.cached_attachment) | ||
App.Documentable.setTitleFromFile(data, data.result.filename) | ||
App.Documentable.setProgressBar(data, 'complete') | ||
App.Documentable.setProgressBar(data, "complete") | ||
App.Documentable.setFilename(data, data.result.filename) | ||
App.Documentable.clearInputErrors(data) | ||
$(data.addAttachmentLabel).hide() | ||
$(data.wrapper).find(".attachment-actions").removeClass('small-12').addClass('small-6 float-right') | ||
$(data.wrapper).find(".attachment-actions .action-remove").removeClass('small-3').addClass('small-12') | ||
$(data.wrapper).find(".attachment-actions").removeClass("small-12").addClass("small-6 float-right") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line exceeds maximum allowed length. Length is 107, max is 100. |
||
$(data.wrapper).find(".attachment-actions .action-remove").removeClass("small-3").addClass("small-12") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line exceeds maximum allowed length. Length is 110, max is 100. |
||
|
||
destroyAttachmentLink = $(data.result.destroy_link) | ||
$(data.destroyAttachmentLinkContainer).html(destroyAttachmentLink) | ||
$(destroyAttachmentLink).on 'click', (e) -> | ||
$(destroyAttachmentLink).on "click", (e) -> | ||
e.preventDefault() | ||
e.stopPropagation() | ||
App.Documentable.doDeleteCachedAttachmentRequest(this.href, data) | ||
|
@@ -69,61 +69,61 @@ App.Documentable = | |
|
||
progress: (e, data) -> | ||
progress = parseInt(data.loaded / data.total * 100, 10) | ||
$(data.progressBar).find('.loading-bar').css 'width', progress + '%' | ||
$(data.progressBar).find(".loading-bar").css "width", "#{progress}%" | ||
return | ||
|
||
buildFileUploadData: (e, data) -> | ||
data = @buildData(data, e.target) | ||
return data | ||
|
||
buildData: (data, input) -> | ||
wrapper = $(input).closest('.direct-upload') | ||
wrapper = $(input).closest(".direct-upload") | ||
data.input = input | ||
data.wrapper = wrapper | ||
data.progressBar = $(wrapper).find('.progress-bar-placeholder') | ||
data.errorContainer = $(wrapper).find('.attachment-errors') | ||
data.fileNameContainer = $(wrapper).find('p.file-name') | ||
data.destroyAttachmentLinkContainer = $(wrapper).find('.action-remove') | ||
data.addAttachmentLabel = $(wrapper).find('.action-add label') | ||
data.progressBar = $(wrapper).find(".progress-bar-placeholder") | ||
data.errorContainer = $(wrapper).find(".attachment-errors") | ||
data.fileNameContainer = $(wrapper).find("p.file-name") | ||
data.destroyAttachmentLinkContainer = $(wrapper).find(".action-remove") | ||
data.addAttachmentLabel = $(wrapper).find(".action-add label") | ||
data.cachedAttachmentField = $(wrapper).find("input[name$='[cached_attachment]']") | ||
data.titleField = $(wrapper).find("input[name$='[title]']") | ||
$(wrapper).find('.progress-bar-placeholder').css('display', 'block') | ||
$(wrapper).find(".progress-bar-placeholder").css("display", "block") | ||
return data | ||
|
||
clearFilename: (data) -> | ||
$(data.fileNameContainer).text('') | ||
$(data.fileNameContainer).text("") | ||
$(data.fileNameContainer).hide() | ||
|
||
clearInputErrors: (data) -> | ||
$(data.errorContainer).find('small.error').remove() | ||
$(data.errorContainer).find("small.error").remove() | ||
|
||
clearProgressBar: (data) -> | ||
$(data.progressBar).find('.loading-bar').removeClass('complete errors uploading').css('width', "0px") | ||
$(data.progressBar).find(".loading-bar").removeClass("complete errors uploading").css("width", "0px") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line exceeds maximum allowed length. Length is 105, max is 100. |
||
|
||
setFilename: (data, file_name) -> | ||
$(data.fileNameContainer).text(file_name) | ||
$(data.fileNameContainer).show() | ||
|
||
setProgressBar: (data, klass) -> | ||
$(data.progressBar).find('.loading-bar').addClass(klass) | ||
$(data.progressBar).find(".loading-bar").addClass(klass) | ||
|
||
setTitleFromFile: (data, title) -> | ||
if $(data.titleField).val() == "" | ||
$(data.titleField).val(title) | ||
|
||
setInputErrors: (data) -> | ||
errors = '<small class="error">' + data.jqXHR.responseJSON.errors + '</small>' | ||
errors = "<small class='error'>#{data.jqXHR.responseJSON.errors}</small>" | ||
$(data.errorContainer).append(errors) | ||
|
||
lockUploads: -> | ||
$('#new_document_link').addClass('hide') | ||
$("#new_document_link").addClass("hide") | ||
|
||
unlockUploads: -> | ||
$('#max-documents-notice').addClass('hide') | ||
$('#new_document_link').removeClass('hide') | ||
$("#max-documents-notice").addClass("hide") | ||
$("#new_document_link").removeClass("hide") | ||
|
||
showNotice: -> | ||
$('#max-documents-notice').removeClass('hide') | ||
$("#max-documents-notice").removeClass("hide") | ||
|
||
doDeleteCachedAttachmentRequest: (url, data) -> | ||
$.ajax | ||
|
@@ -140,21 +140,21 @@ App.Documentable = | |
App.Documentable.clearProgressBar(data) | ||
|
||
App.Documentable.unlockUploads() | ||
$(data.wrapper).find(".attachment-actions").addClass('small-12').removeClass('small-6 float-right') | ||
$(data.wrapper).find(".attachment-actions .action-remove").addClass('small-3').removeClass('small-12') | ||
$(data.wrapper).find(".attachment-actions").addClass("small-12").removeClass("small-6 float-right") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line exceeds maximum allowed length. Length is 107, max is 100. |
||
$(data.wrapper).find(".attachment-actions .action-remove").addClass("small-3").removeClass("small-12") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line exceeds maximum allowed length. Length is 110, max is 100. |
||
|
||
if $(data.input).data('nested-document') == true | ||
if $(data.input).data("nested-document") == true | ||
$(data.wrapper).remove() | ||
else | ||
$(data.wrapper).find('a.remove-cached-attachment').remove() | ||
$(data.wrapper).find("a.remove-cached-attachment").remove() | ||
|
||
initializeRemoveCachedDocumentLink: (input, data) -> | ||
wrapper = $(input).closest(".direct-upload") | ||
remove_document_link = $(wrapper).find('a.remove-cached-attachment') | ||
$(remove_document_link).on 'click', (e) -> | ||
remove_document_link = $(wrapper).find("a.remove-cached-attachment") | ||
$(remove_document_link).on "click", (e) -> | ||
e.preventDefault() | ||
e.stopPropagation() | ||
App.Documentable.doDeleteCachedAttachmentRequest(this.href, data) | ||
|
||
removeDocument: (id) -> | ||
$('#' + id).remove() | ||
$("##{id}").remove() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
App.EmbedVideo = | ||
|
||
initialize: -> | ||
$('#js-embedded-video').each -> | ||
$("#js-embedded-video").each -> | ||
code = $(this).data("video-code") | ||
$('#js-embedded-video').html(code) | ||
$("#js-embedded-video").html(code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line exceeds maximum allowed length. Length is 164, max is 100.