Use double quotes in CoffeeScript
We accidentally added some single quotes recently.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
App.Answers =
|
||||
|
||||
initializeAnswers: (answers) ->
|
||||
$(answers).on 'cocoon:after-insert', (e, new_answer) ->
|
||||
$(answers).on "cocoon:after-insert", (e, new_answer) ->
|
||||
given_order = App.Answers.maxGivenOrder(answers) + 1
|
||||
$(new_answer).find("[name$='[given_order]']").val(given_order)
|
||||
|
||||
@@ -15,7 +15,7 @@ App.Answers =
|
||||
return max_order
|
||||
|
||||
nestedAnswers: ->
|
||||
$('.js-answers').each (index, answers) ->
|
||||
$(".js-answers").each (index, answers) ->
|
||||
App.Answers.initializeAnswers(answers)
|
||||
|
||||
initialize: ->
|
||||
|
||||
@@ -135,7 +135,7 @@ var initialize_modules = function() {
|
||||
App.SendAdminNotificationAlert.initialize();
|
||||
App.ModalDownload.initialize();
|
||||
App.Settings.initialize();
|
||||
if ( $('#js-columns-selector').length )
|
||||
if ( $("#js-columns-selector").length )
|
||||
App.ColumnsSelector.initialize();
|
||||
App.BudgetEditAssociations.initialize();
|
||||
if ( $("#votation_type_enum_type").length )
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
//= require ckeditor/init
|
||||
|
||||
CKEDITOR.config.customConfig = "<%= javascript_path 'ckeditor/config.js' %>";
|
||||
CKEDITOR.config.customConfig = "<%= javascript_path "ckeditor/config.js" %>";
|
||||
|
||||
@@ -7,19 +7,19 @@ App.Cookies =
|
||||
if days
|
||||
date = new Date
|
||||
date.setTime date.getTime() + days * 24 * 60 * 60 * 1000
|
||||
expires = '; expires=' + date.toGMTString()
|
||||
expires = "; expires=" + date.toGMTString()
|
||||
else
|
||||
expires = ''
|
||||
document.cookie = name + '=' + value + expires + '; path=/'
|
||||
expires = ""
|
||||
document.cookie = name + "=" + value + expires + "; path=/"
|
||||
return
|
||||
|
||||
getCookie: (name) ->
|
||||
if document.cookie.length > 0
|
||||
c_start = document.cookie.indexOf(name + '=')
|
||||
c_start = document.cookie.indexOf(name + "=")
|
||||
if c_start != -1
|
||||
c_start = c_start + name.length + 1
|
||||
c_end = document.cookie.indexOf(';', c_start)
|
||||
c_end = document.cookie.indexOf(";", c_start)
|
||||
if c_end == -1
|
||||
c_end = document.cookie.length
|
||||
return unescape(document.cookie.substring(c_start, c_end))
|
||||
''
|
||||
""
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// TODO: This module is complex enough to require its own tests. Rewrite it using Ecma6 class syntax and
|
||||
// write tests for this feature after consul has been migrated to Rails 5.1
|
||||
(function(){
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
var ProposalGraph = function(url) {
|
||||
this.url = url;
|
||||
@@ -15,9 +15,9 @@
|
||||
this.groupBy = null;
|
||||
this.proposalSuccess = null;
|
||||
this.maximumValue = 0;
|
||||
this.progressLabel = 'Progress';
|
||||
this.supportsLabel = 'Supports';
|
||||
this.successLabel = 'Success';
|
||||
this.progressLabel = "Progress";
|
||||
this.supportsLabel = "Supports";
|
||||
this.successLabel = "Success";
|
||||
this.goals = null;
|
||||
this.achievements = null;
|
||||
this.xColumnValues = null;
|
||||
@@ -132,7 +132,7 @@
|
||||
this.achievements.push({
|
||||
value: this.formatGroup(group),
|
||||
text: data[group].title,
|
||||
position: 'start'
|
||||
position: "start"
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -150,13 +150,13 @@
|
||||
|
||||
this.formatXColumnValues();
|
||||
|
||||
colors[this.progressColumnValues[0]] = '#004a83';
|
||||
colors[this.successfulColumnValues[0]] = '#ff7f0e';
|
||||
colors[this.progressColumnValues[0]] = "#004a83";
|
||||
colors[this.successfulColumnValues[0]] = "#ff7f0e";
|
||||
|
||||
c3.generate({
|
||||
bindto: '#' + this.targetId,
|
||||
bindto: "#" + this.targetId,
|
||||
data: {
|
||||
x: 'x',
|
||||
x: "x",
|
||||
columns: [
|
||||
this.xColumnValues,
|
||||
this.progressColumnValues,
|
||||
@@ -166,7 +166,7 @@
|
||||
color: function (color, d) {
|
||||
var achievement;
|
||||
|
||||
if (d.id === this.successfulColumnValues[0] || !Object.prototype.hasOwnProperty.call(d, 'x')) {
|
||||
if (d.id === this.successfulColumnValues[0] || !Object.prototype.hasOwnProperty.call(d, "x")) {
|
||||
return color;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
}.bind(this));
|
||||
|
||||
if (achievement !== undefined) {
|
||||
return '#ff0000';
|
||||
return "#ff0000";
|
||||
}
|
||||
|
||||
return color;
|
||||
@@ -190,11 +190,11 @@
|
||||
max: maximumValue,
|
||||
label: {
|
||||
text: this.supportsLabel,
|
||||
position: 'outer-middle'
|
||||
position: "outer-middle"
|
||||
}
|
||||
},
|
||||
x: {
|
||||
type: 'category',
|
||||
type: "category",
|
||||
tick: {
|
||||
values: this.tickXValues(),
|
||||
centered: true
|
||||
@@ -217,7 +217,7 @@
|
||||
}.bind(this));
|
||||
|
||||
if (achievement !== undefined) {
|
||||
return this.xColumnValues[d + 1] + ': ' + achievement.text;
|
||||
return this.xColumnValues[d + 1] + ": " + achievement.text;
|
||||
}
|
||||
|
||||
return this.xColumnValues[d + 1];
|
||||
@@ -270,7 +270,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
this.xColumnValues.unshift('x');
|
||||
this.xColumnValues.unshift("x");
|
||||
};
|
||||
|
||||
ProposalGraph.prototype.formatGroup = function(group) {
|
||||
@@ -283,21 +283,21 @@
|
||||
};
|
||||
|
||||
ProposalGraph.prototype.isDailyGrouped = function() {
|
||||
return this.groupBy === undefined || this.groupBy === '' || this.groupBy === null;
|
||||
return this.groupBy === undefined || this.groupBy === "" || this.groupBy === null;
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
$('[data-proposal-graph-url]').each(function () {
|
||||
var graph = new ProposalGraph($(this).data('proposal-graph-url'));
|
||||
graph.successfulProposalDataUrl = $(this).data('successful-proposal-graph-url');
|
||||
graph.proposalAchievementsUrl = $(this).data('proposal-achievements-url');
|
||||
graph.targetId = $(this).attr('id');
|
||||
graph.groupBy = $(this).data('proposal-graph-group-by');
|
||||
graph.progressLabel = $(this).data('proposal-graph-progress-label');
|
||||
graph.supportsLabel = $(this).data('proposal-graph-supports-label');
|
||||
graph.successLabel = $(this).data('proposal-graph-success-label');
|
||||
graph.proposalSuccess = parseInt($(this).data('proposal-success'), 10);
|
||||
graph.resourcesUrl = $(this).data('proposal-resources-url');
|
||||
$("[data-proposal-graph-url]").each(function () {
|
||||
var graph = new ProposalGraph($(this).data("proposal-graph-url"));
|
||||
graph.successfulProposalDataUrl = $(this).data("successful-proposal-graph-url");
|
||||
graph.proposalAchievementsUrl = $(this).data("proposal-achievements-url");
|
||||
graph.targetId = $(this).attr("id");
|
||||
graph.groupBy = $(this).data("proposal-graph-group-by");
|
||||
graph.progressLabel = $(this).data("proposal-graph-progress-label");
|
||||
graph.supportsLabel = $(this).data("proposal-graph-supports-label");
|
||||
graph.successLabel = $(this).data("proposal-graph-success-label");
|
||||
graph.proposalSuccess = parseInt($(this).data("proposal-success"), 10);
|
||||
graph.resourcesUrl = $(this).data("proposal-resources-url");
|
||||
|
||||
graph.refresh();
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@ App.ModalDownload =
|
||||
|
||||
enableButton: ->
|
||||
$("#js-download-modal-submit").attr("disabled", false)
|
||||
$("#js-download-modal-submit").removeClass('disabled')
|
||||
$("#js-download-modal-submit").removeClass("disabled")
|
||||
|
||||
initialize: ->
|
||||
$("#js-download-modal-submit").on "click", ->
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
App.Questions =
|
||||
|
||||
nestedQuestions: ->
|
||||
$('.js-questions').on 'cocoon:after-insert', (e, new_question) ->
|
||||
App.Answers.initializeAnswers($(new_question).find('.js-answers'))
|
||||
$(".js-questions").on "cocoon:after-insert", (e, new_question) ->
|
||||
App.Answers.initializeAnswers($(new_question).find(".js-answers"))
|
||||
|
||||
initialize: ->
|
||||
App.Questions.nestedQuestions()
|
||||
|
||||
Reference in New Issue
Block a user