Use double quotes for string literal

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-07-18 12:30:47 +09:00
parent 74c1bf5ef3
commit 9502a63cf4
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1
17 changed files with 90 additions and 90 deletions

View File

@ -7,33 +7,33 @@
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb // layout file, like app/views/layouts/application.html.erb
console.log('Hello World from Webpacker'); console.log("Hello World from Webpacker");
import jQuery from 'jquery/dist/jquery'; import jQuery from "jquery/dist/jquery";
window.$ = jQuery; window.$ = jQuery;
window.jQuery = jQuery; window.jQuery = jQuery;
import Rails from 'rails-ujs/lib/assets/compiled/rails-ujs.js'; import Rails from "rails-ujs/lib/assets/compiled/rails-ujs.js";
window.Rails = Rails; window.Rails = Rails;
Rails.start(); Rails.start();
import 'popper.js/dist/popper'; import "popper.js/dist/popper";
import 'bootstrap/dist/js/bootstrap'; import "bootstrap/dist/js/bootstrap";
import 'datatables.net/js/jquery.dataTables'; import "datatables.net/js/jquery.dataTables";
import 'startbootstrap-sb-admin/js/sb-admin'; import "startbootstrap-sb-admin/js/sb-admin";
import 'startbootstrap-sb-admin/js/sb-admin-datatables'; import "startbootstrap-sb-admin/js/sb-admin-datatables";
import Vue from 'vue/dist/vue.esm'; import Vue from "vue/dist/vue.esm";
Vue.filter('to_json', function (value) { Vue.filter("to_json", function (value) {
return JSON.stringify(value); return JSON.stringify(value);
}); });
window.Vue = Vue; window.Vue = Vue;
import '../stylesheets/application.scss'; import "../stylesheets/application.scss";
$(document).ready(() => { $(document).ready(() => {
$("[data-toggle=tooltip]").tooltip(); $("[data-toggle=tooltip]").tooltip();

View File

@ -1,6 +1,6 @@
'use strict'; "use strict";
import ConfigField from './config_field'; import ConfigField from "./config_field";
const AwsCredential = { const AwsCredential = {
template: "#vue-aws-credential", template: "#vue-aws-credential",
@ -45,7 +45,7 @@ const AwsCredential = {
method: "GET", method: "GET",
url: "/api/config_definitions", url: "/api/config_definitions",
headers: { headers: {
'X-CSRF-Token': this.token "X-CSRF-Token": this.token
}, },
data: { data: {
type: this.pluginType, type: this.pluginType,

View File

@ -1,10 +1,10 @@
import CodeMirror from 'codemirror/lib/codemirror'; import CodeMirror from "codemirror/lib/codemirror";
import 'lodash/lodash'; import "lodash/lodash";
// See: http://codemirror.net/doc/manual.html#modeapi // See: http://codemirror.net/doc/manual.html#modeapi
// and sample mode files: https://github.com/codemirror/CodeMirror/tree/master/mode // and sample mode files: https://github.com/codemirror/CodeMirror/tree/master/mode
CodeMirror.defineMode('fluentd', function(){ CodeMirror.defineMode("fluentd", function(){
return { return {
startState: function(aa){ startState: function(aa){
return { "context" : null }; return { "context" : null };
@ -70,18 +70,18 @@ function codemirrorify(el) {
} }
$(function(){ $(function(){
$('.js-fluentd-config-editor').each(function(_, el){ $(".js-fluentd-config-editor").each(function(_, el){
codemirrorify(el); codemirrorify(el);
}); });
}); });
Vue.directive('config-editor', { Vue.directive("config-editor", {
bind: function(el, binding, vnode, oldVnode){ bind: function(el, binding, vnode, oldVnode){
// NOTE: needed delay for waiting CodeMirror setup // NOTE: needed delay for waiting CodeMirror setup
_.delay(function(textarea){ _.delay(function(textarea){
let cm = codemirrorify(textarea); let cm = codemirrorify(textarea);
// textarea.codemirror = cm; // for test, but doesn't work for now (working on Chrome, but Poltergeist not) // textarea.codemirror = cm; // for test, but doesn't work for now (working on Chrome, but Poltergeist not)
cm.on('change', function(code_mirror){ cm.on("change", function(code_mirror){
// bridge Vue - CodeMirror world // bridge Vue - CodeMirror world
el.dataset.content = code_mirror.getValue(); el.dataset.content = code_mirror.getValue();
}); });

View File

@ -1,5 +1,5 @@
'use strict'; "use strict";
import 'lodash/lodash'; import "lodash/lodash";
const ConfigField = { const ConfigField = {
template: "#vue-config-field", template: "#vue-config-field",

View File

@ -1,4 +1,4 @@
'use strict'; "use strict";
$(document).ready(()=> { $(document).ready(()=> {
new Vue({ new Vue({
el: "#fluent-log", el: "#fluent-log",

View File

@ -1,12 +1,12 @@
'use strict'; "use strict";
import 'lodash/lodash'; import "lodash/lodash";
import 'popper.js/dist/popper'; import "popper.js/dist/popper";
import 'bootstrap/dist/js/bootstrap'; import "bootstrap/dist/js/bootstrap";
import OwnedPluginForm from './owned_plugin_form'; import OwnedPluginForm from "./owned_plugin_form";
$(document).ready(() => { $(document).ready(() => {
new Vue({ new Vue({
el: '#in-tail-parse', el: "#in-tail-parse",
props: [ props: [
"path", "path",
"parseType" "parseType"
@ -22,18 +22,18 @@ $(document).ready(() => {
} }
}, },
components: { components: {
'owned-plugin-form': OwnedPluginForm "owned-plugin-form": OwnedPluginForm
}, },
watch: { watch: {
'parse.expression': function() { "parse.expression": function() {
console.log(`parse.expression: ${this.parse.expression}`); console.log(`parse.expression: ${this.parse.expression}`);
this.preview(); this.preview();
}, },
'parse.time_format': function() { "parse.time_format": function() {
console.log(`parse.time_format: ${this.parse.time_format}`); console.log(`parse.time_format: ${this.parse.time_format}`);
this.preview(); this.preview();
}, },
'parseType': function() { "parseType": function() {
this.preview(); this.preview();
}, },
}, },
@ -71,7 +71,7 @@ $(document).ready(() => {
return; return;
} }
let $container = $('<div>'); let $container = $("<div>");
_.each(matches, (match) => { _.each(matches, (match) => {
const colors = ["#ff9", "#cff", "#fcf", "#dfd"]; const colors = ["#ff9", "#cff", "#fcf", "#dfd"];
const whole = match.whole; const whole = match.whole;
@ -99,7 +99,7 @@ $(document).ready(() => {
"data-toggle": "tooltip", "data-toggle": "tooltip",
"data-placement": "top", "data-placement": "top",
"title": m.key, "title": m.key,
'style': 'background-color:' + currentColor "style": "background-color:" + currentColor
}); });
let highlightedHtml = $highlighted.wrap("<div>").parent().html(); let highlightedHtml = $highlighted.wrap("<div>").parent().html();
let pos = { let pos = {
@ -132,7 +132,7 @@ $(document).ready(() => {
method: "POST", method: "POST",
url: "/api/regexp_preview", url: "/api/regexp_preview",
headers: { headers: {
'X-CSRF-Token': this.token "X-CSRF-Token": this.token
}, },
data: { data: {
parse_type: _.isEmpty(this.parseType) ? "regexp" : this.parseType, parse_type: _.isEmpty(this.parseType) ? "regexp" : this.parseType,

View File

@ -1,40 +1,40 @@
'use strict'; "use strict";
import 'lodash/lodash'; import "lodash/lodash";
$(document).ready(()=> { $(document).ready(()=> {
var $firstSetting = $('.js-nested-column.js-multiple:first'); var $firstSetting = $(".js-nested-column.js-multiple:first");
if ($firstSetting.length === 0) { if ($firstSetting.length === 0) {
return; return;
} }
var counter = 0; var counter = 0;
$('.js-append', $firstSetting).on('click', function(ev){ $(".js-append", $firstSetting).on("click", function(ev){
ev.preventDefault(); ev.preventDefault();
var $new = $firstSetting.clone(true); var $new = $firstSetting.clone(true);
counter++; counter++;
var fields = $('input,select,textarea', $new); var fields = $("input,select,textarea", $new);
_.each(fields, function(elm){ _.each(fields, function(elm){
elm.name = elm.name.replace("0", counter); elm.name = elm.name.replace("0", counter);
}); });
$('label', $new).each(function(_, label){ $("label", $new).each(function(_, label){
var $label = $(label); var $label = $(label);
$label.attr('for', $label.attr('for').replace("0", counter)); $label.attr("for", $label.attr("for").replace("0", counter));
}); });
$('.js-remove', $new).show(); $(".js-remove", $new).show();
$('.js-append', $new).hide(); $(".js-append", $new).hide();
$new.appendTo($firstSetting.parent()); $new.appendTo($firstSetting.parent());
}); });
$('.js-remove').on('click', function(ev){ $(".js-remove").on("click", function(ev){
ev.preventDefault(); ev.preventDefault();
$(this).closest('.js-nested-column').remove(); $(this).closest(".js-nested-column").remove();
}); });
var $allSettings = $('.js-nested-column.js-multiple'); var $allSettings = $(".js-nested-column.js-multiple");
$('.js-append', $allSettings).hide(); $(".js-append", $allSettings).hide();
$('.js-remove', $allSettings).show(); $(".js-remove", $allSettings).show();
$('.js-append', $firstSetting).show(); $(".js-append", $firstSetting).show();
$('.js-remove', $firstSetting).hide(); $(".js-remove", $firstSetting).hide();
}); });

View File

@ -30,11 +30,11 @@ $(document).ready(()=> {
} }
}); });
}; };
window.addEventListener('focus', function(ev){ window.addEventListener("focus", function(ev){
currentInterval = POLLING_INTERVAL; currentInterval = POLLING_INTERVAL;
timer = setTimeout(fetch, currentInterval); timer = setTimeout(fetch, currentInterval);
}, false); }, false);
window.addEventListener('blur', function(ev){ window.addEventListener("blur", function(ev){
clearTimeout(timer); clearTimeout(timer);
}, false); }, false);
fetch(); fetch();

View File

@ -1,4 +1,4 @@
'use strict'; "use strict";
import TransportConfig from "./transport_config"; import TransportConfig from "./transport_config";
import OwnedPluginForm from "./owned_plugin_form"; import OwnedPluginForm from "./owned_plugin_form";

View File

@ -1,4 +1,4 @@
'use strict'; "use strict";
import OwnedPluginForm from "./owned_plugin_form"; import OwnedPluginForm from "./owned_plugin_form";
import AwsCredential from "./aws_credential"; import AwsCredential from "./aws_credential";

View File

@ -1,7 +1,7 @@
'use strict'; "use strict";
import ParserMultilineForm from './parser_multiline_form'; import ParserMultilineForm from "./parser_multiline_form";
import ConfigField from './config_field'; import ConfigField from "./config_field";
const OwnedPluginForm = { const OwnedPluginForm = {
template: "#vue-owned-plugin-form", template: "#vue-owned-plugin-form",
@ -78,7 +78,7 @@ const OwnedPluginForm = {
method: "GET", method: "GET",
url: "/api/config_definitions", url: "/api/config_definitions",
headers: { headers: {
'X-CSRF-Token': this.token "X-CSRF-Token": this.token
}, },
data: { data: {
type: this.pluginType, type: this.pluginType,

View File

@ -1,5 +1,5 @@
'use strict'; "use strict";
import 'lodash/lodash'; import "lodash/lodash";
const ParserMultilineForm = { const ParserMultilineForm = {
template: "#vue-parser-multiline-form", template: "#vue-parser-multiline-form",
props: [ props: [

View File

@ -1,17 +1,17 @@
'use strict'; "use strict";
import 'lodash/lodash'; import "lodash/lodash";
import 'popper.js/dist/popper'; import "popper.js/dist/popper";
import 'bootstrap/dist/js/bootstrap'; import "bootstrap/dist/js/bootstrap";
import OwnedPluginForm from './owned_plugin_form'; import OwnedPluginForm from "./owned_plugin_form";
window.addEventListener('load', () => { window.addEventListener("load", () => {
new Vue({ new Vue({
el: '#plugin-setting', el: "#plugin-setting",
data: () => { data: () => {
return {}; return {};
}, },
components: { components: {
'owned-plugin-form': OwnedPluginForm "owned-plugin-form": OwnedPluginForm
}, },
methods: { methods: {
} }

View File

@ -1,10 +1,10 @@
$(document).ready(() => { $(document).ready(() => {
const SettingSection = { const SettingSection = {
template: '#vue-setting-section', template: "#vue-setting-section",
props: ['id', 'content', 'type', 'name', 'arg'], props: ["id", "content", "type", "name", "arg"],
data: function() { data: function() {
return { return {
mode: 'default', mode: "default",
processing: false processing: false
}; };
}, },
@ -13,7 +13,7 @@ $(document).ready(() => {
}, },
computed: { computed: {
endpoint: function() { endpoint: function() {
return '/api/settings/' + this.id; return "/api/settings/" + this.id;
} }
}, },
methods: { methods: {
@ -30,7 +30,7 @@ $(document).ready(() => {
this.destroy(); this.destroy();
}, },
onSubmit: function(ev) { onSubmit: function(ev) {
const token = document.getElementsByName("csrf-token")[0].getAttribute('content'); const token = document.getElementsByName("csrf-token")[0].getAttribute("content");
this.processing = true; this.processing = true;
this.content = $(`#${this.id} textarea.form-control`)[0].dataset.content; this.content = $(`#${this.id} textarea.form-control`)[0].dataset.content;
$.ajax({ $.ajax({
@ -42,7 +42,7 @@ $(document).ready(() => {
content: this.content content: this.content
}, },
headers: { headers: {
'X-CSRF-Token': token "X-CSRF-Token": token
} }
}).then((data)=> { }).then((data)=> {
_.each(data, function(v,k){ _.each(data, function(v,k){
@ -55,10 +55,10 @@ $(document).ready(() => {
}, },
initialState: function(){ initialState: function(){
this.processing = false; this.processing = false;
this.mode = 'default'; this.mode = "default";
}, },
destroy: function(){ destroy: function(){
const token = document.getElementsByName("csrf-token")[0].getAttribute('content'); const token = document.getElementsByName("csrf-token")[0].getAttribute("content");
$.ajax({ $.ajax({
url: this.endpoint, url: this.endpoint,
method: "POST", method: "POST",
@ -67,7 +67,7 @@ $(document).ready(() => {
id: this.id id: this.id
}, },
headers: { headers: {
'X-CSRF-Token': token "X-CSRF-Token": token
} }
}).then(()=> { }).then(()=> {
this.$parent.update(); this.$parent.update();
@ -94,7 +94,7 @@ $(document).ready(() => {
}); });
}, },
components: { components: {
'setting-section': SettingSection "setting-section": SettingSection
}, },
methods: { methods: {
update: function() { update: function() {

View File

@ -1,6 +1,6 @@
'use strict'; "use strict";
import ConfigField from './config_field'; import ConfigField from "./config_field";
const TransportConfig = { const TransportConfig = {
template: "#vue-transport-config", template: "#vue-transport-config",
@ -44,7 +44,7 @@ const TransportConfig = {
method: "GET", method: "GET",
url: "/api/config_definitions", url: "/api/config_definitions",
headers: { headers: {
'X-CSRF-Token': this.token "X-CSRF-Token": this.token
}, },
data: { data: {
type: this.pluginType, type: this.pluginType,

View File

@ -1,11 +1,11 @@
'use strict'; "use strict";
import 'lodash/lodash'; import "lodash/lodash";
import ConfigField from './config_field'; import ConfigField from "./config_field";
$(document).ready(() => { $(document).ready(() => {
new Vue({ new Vue({
el: '#transport-section', el: "#transport-section",
components: { components: {
"config-field": ConfigField "config-field": ConfigField
}, },
@ -55,7 +55,7 @@ $(document).ready(() => {
method: "GET", method: "GET",
url: "/api/config_definitions", url: "/api/config_definitions",
headers: { headers: {
'X-CSRF-Token': this.token "X-CSRF-Token": this.token
}, },
data: { data: {
type: this.pluginType, type: this.pluginType,

View File

@ -1,5 +1,5 @@
'use strict'; "use strict";
import 'lodash/lodash'; import "lodash/lodash";
$(document).ready(() => { $(document).ready(() => {
new Vue({ new Vue({
el: "#treeview", el: "#treeview",