Commit c3bc6934 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix problems discovered with jslint

parent 59dd8049
......@@ -146,7 +146,7 @@
<script>
"use strict";
var gui = require("nw.gui");
var gui = require("nw.gui");
var pdgui = require("./pdgui.js");
// For translations
......@@ -197,7 +197,7 @@ function update_attr(elem) {
function send_params(attrs, create_undo_point) {
//pdgui.post("we're applying gatom changes!");
pdgui.pdsend(pd_object_callback, "param",
pdgui.pdsend(pd_object_callback, "param",
+attrs.width,
+attrs.draglo,
+attrs.draghi,
......
......@@ -327,7 +327,7 @@
<script>
"use strict";
var gui = require("nw.gui");
var gui = require("nw.gui");
var pdgui = require("./pdgui.js");
// For translations
......@@ -346,9 +346,10 @@ function substitute_space(arg) {
}
function strip_problem_chars(arg) {
var problem_chars = [";", ",", "{", "}", "\\"];
var ret = arg;
for(var i = 0; i < problem_chars.length; i++) {
var problem_chars = [";", ",", "{", "}", "\\"],
ret = arg,
i;
for(i = 0; i < problem_chars.length; i++) {
ret = ret.split(";").join("");
}
return ret;
......
......@@ -252,7 +252,7 @@
</div>
<script>
"use strict";
var gui = require("nw.gui");
var gui = require("nw.gui");
var pdgui = require("./pdgui.js");
// For translations
......@@ -451,7 +451,7 @@ function populate_devs(type, attrs) {
elem.appendChild(opt);
for (j = 0; j < devs.length; j++) {
opt = document.createElement("option");
opt.value = j;
opt.value = j;
opt.textContent = devs[j];
elem.appendChild(opt);
}
......@@ -479,7 +479,7 @@ function populate_midi_devs(type, attrs) {
elem.appendChild(opt);
for (j = 0; j < devs.length; j++) {
opt = document.createElement("option");
opt.value = j;
opt.value = j;
opt.textContent = devs[j];
elem.appendChild(opt);
}
......@@ -507,8 +507,8 @@ function audio_prefs_callback(attrs) {
document.getElementById("blocksize").value = get_attr("blocksize", attrs);
document.getElementById("advance").value = get_attr("advance", attrs);
var callback = get_attr("cancallback", attrs);
//show the checkbox if the API allows
callback = get_attr("cancallback", attrs);
//show the checkbox if the API allows
if (callback !== -1) {
document.getElementById("callback_container")
.classList.remove("hidden");
......@@ -594,10 +594,11 @@ function tr_text(id) {
// Stop-gap translator
function translate_form() {
var i;
var elements = document.querySelectorAll("[data-i18n]");
var elements = document.querySelectorAll("[data-i18n]"),
data,
i;
for (i = 0; i < elements.length; i++) {
var data = elements[i].dataset.i18n;
data = elements[i].dataset.i18n;
if (data.slice(0,7) === "[title]") {
elements[i].title = l(data.slice(7));
} else {
......@@ -608,8 +609,8 @@ function translate_form() {
function populate_form(attr_array) {
// First, let's put the translated text for the form labels:
for(var i = 0; i < attr_array.length; i+=2) {
var i;
for(i = 0; i < attr_array.length; i+=2) {
// Unhide the span with the class with the same name as the id
var prop_group = document.getElementsByClassName(attr_array[i])[0];
if (prop_group !== undefined) {
......
......@@ -28,10 +28,11 @@ var doc_id = 0;
// Stop-gap translator
function translate_form() {
var i;
var elements = document.querySelectorAll("[data-i18n]");
var elements = document.querySelectorAll("[data-i18n]"),
data,
i;
for (i = 0; i < elements.length; i++) {
var data = elements[i].dataset.i18n;
data = elements[i].dataset.i18n;
if (data.slice(0,7) === "[title]") {
elements[i].title = l(data.slice(7));
} else {
......@@ -67,7 +68,6 @@ function add_doc_to_index(filename, data) {
//"body": big_line,
"path": filename
});
}
function read_file(err, filename, stat) {
......@@ -107,7 +107,7 @@ function console_unwrap_tag(console_elem, tag_name) {
while(b[0].firstChild) {
parent_elem.insertBefore(b[0].firstChild, b[0]);
}
parent_elem.removeChild(b[0]);
parent_elem.removeChild(b[0]);
parent_elem.normalize();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment