Commit 042f9ffb authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix some jslint warnings and remove unnecessary use of `this`

parent 8f6eb44d
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8">
<link id="page_style" rel="stylesheet" type="text/css" href="css/default.css"> <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css">
<title>Pd Preferences</title> <title>Pd Preferences</title>
</head> </head>
...@@ -277,14 +278,14 @@ ...@@ -277,14 +278,14 @@
<script> <script>
"use strict"; "use strict";
var gui = require("nw.gui"); var gui = require("nw.gui");
var pdgui = require("./pdgui.js"); var pdgui = require("./pdgui.js");
// For translations // For translations
var l = pdgui.get_local_string; var l = pdgui.get_local_string;
// gui preset // gui preset
pdgui.skin.apply(this); pdgui.skin.apply(window);
var pd_object_callback; var pd_object_callback;
...@@ -422,9 +423,9 @@ function array_choose(array_index) { ...@@ -422,9 +423,9 @@ function array_choose(array_index) {
} }
var arrays_select = document.getElementById("arrays_select"); var arrays_select = document.getElementById("arrays_select");
arrays_select.addEventListener("change", function() { arrays_select.addEventListener("change", function(evt) {
pdgui.post("changed the thing is " + this.value); pdgui.post("changing to array index " + evt.target.value);
array_choose(this.value); array_choose(evt.target.value);
}); });
var gop_label = document.getElementById("gop_label"); var gop_label = document.getElementById("gop_label");
...@@ -487,9 +488,10 @@ function substitute_space(arg) { ...@@ -487,9 +488,10 @@ function substitute_space(arg) {
} }
function strip_problem_chars(arg) { function strip_problem_chars(arg) {
var problem_chars = [";", ",", "{", "}", "\\"]; var problem_chars = [";", ",", "{", "}", "\\"],
var ret = arg; ret = arg,
for(var i = 0; i < problem_chars.length; i++) { i;
for (i = 0; i < problem_chars.length; i++) {
ret = ret.split(";").join(""); ret = ret.split(";").join("");
} }
return ret; return ret;
...@@ -598,10 +600,10 @@ function populate_array_form(objects) { ...@@ -598,10 +600,10 @@ function populate_array_form(objects) {
opt.textContent = "Array #" + (i+1); opt.textContent = "Array #" + (i+1);
arrays_select.appendChild(opt); arrays_select.appendChild(opt);
} }
// We're permanently hiding the checkbutton for creating a new array // We're permanently hiding the checkbutton for creating a new array
// inside an existing graph. It's just a weird interface with very // inside an existing graph. It's just a weird interface with very
// few benefits. However, patches that already have multiple arrays // few benefits. However, patches that already have multiple arrays
// inside a graph will continue to work. (And if users really want // inside a graph will continue to work. (And if users really want
// this feature back it's easy to turn it back on. // this feature back it's easy to turn it back on.
if (!new_array_dialog || 1) { // to re-enable, remove the "|| 1" if (!new_array_dialog || 1) { // to re-enable, remove the "|| 1"
document.getElementsByClassName("array_in_existing_graph")[0] document.getElementsByClassName("array_in_existing_graph")[0]
...@@ -616,7 +618,7 @@ function populate_array_form(objects) { ...@@ -616,7 +618,7 @@ function populate_array_form(objects) {
} }
// Set up arrays in an object // Set up arrays in an object
function init_arrays(attr_objects) { function init_arrays(attr_objects) {
if (attr_objects.length) { if (attr_objects.length) {
// populate form with first array // populate form with first array
...@@ -648,7 +650,7 @@ function register_window_id(gfxstub, attr_objects) { ...@@ -648,7 +650,7 @@ function register_window_id(gfxstub, attr_objects) {
// If this is a new array dialog we might not have any canvas // If this is a new array dialog we might not have any canvas
// properties to set. If so, just show the array form elements // properties to set. If so, just show the array form elements
if (attr_objects[0].hasOwnProperty("array_gfxstub")) { if (attr_objects[0].hasOwnProperty("array_gfxstub")) {
pd_garray_attrs = attr_objects; pd_garray_attrs = attr_objects;
new_array_dialog = true; // this is a new array dialog new_array_dialog = true; // this is a new array dialog
canvas_fieldsets = document.getElementsByClassName("canvas"); canvas_fieldsets = document.getElementsByClassName("canvas");
for (i = 0; i < canvas_fieldsets.length; i++) { for (i = 0; i < canvas_fieldsets.length; i++) {
...@@ -709,7 +711,7 @@ function populate_form(attr_object) { ...@@ -709,7 +711,7 @@ function populate_form(attr_object) {
// Set the gop-related parts of the form to be // Set the gop-related parts of the form to be
// enabled/disabled based on state // enabled/disabled based on state
set_gop(!!flag); set_gop(!!flag);
} }
var elem = document.getElementsByName(prop); var elem = document.getElementsByName(prop);
if (elem.length > 0) { if (elem.length > 0) {
if(prop.slice(-5) === "color") { if(prop.slice(-5) === "color") {
......
...@@ -94,7 +94,7 @@ var pdgui = require("./pdgui.js"); ...@@ -94,7 +94,7 @@ var pdgui = require("./pdgui.js");
// For translations // For translations
var l = pdgui.get_local_string; var l = pdgui.get_local_string;
pdgui.skin.apply(this); pdgui.skin.apply(window);
var pd_object_callback; var pd_object_callback;
var current_size; var current_size;
......
...@@ -152,7 +152,7 @@ var pdgui = require("./pdgui.js"); ...@@ -152,7 +152,7 @@ var pdgui = require("./pdgui.js");
// For translations // For translations
var l = pdgui.get_local_string; var l = pdgui.get_local_string;
pdgui.skin.apply(this); pdgui.skin.apply(window);
var pd_object_callback, var pd_object_callback,
old_attrs = {}, // original state. Used if we cancel the dialog old_attrs = {}, // original state. Used if we cancel the dialog
......
...@@ -334,7 +334,7 @@ var pdgui = require("./pdgui.js"); ...@@ -334,7 +334,7 @@ var pdgui = require("./pdgui.js");
var l = pdgui.get_local_string; var l = pdgui.get_local_string;
// gui preset // gui preset
pdgui.skin.apply(this); pdgui.skin.apply(window);
var pd_object_callback, var pd_object_callback,
old_attrs = {}, // original state. Used if we cancel the dialog old_attrs = {}, // original state. Used if we cancel the dialog
......
...@@ -259,7 +259,7 @@ var pdgui = require("./pdgui.js"); ...@@ -259,7 +259,7 @@ var pdgui = require("./pdgui.js");
var l = pdgui.get_local_string; var l = pdgui.get_local_string;
// Gui presets // Gui presets
pdgui.skin.apply(this); pdgui.skin.apply(window);
var pd_object_callback; var pd_object_callback;
......
...@@ -15,6 +15,9 @@ var dive = require("./dive.js"); // small module to recursively search dirs ...@@ -15,6 +15,9 @@ var dive = require("./dive.js"); // small module to recursively search dirs
var l = pdgui.get_local_string; var l = pdgui.get_local_string;
var index = elasticlunr(); var index = elasticlunr();
pdgui.skin.apply(window);
index.addField("title"); index.addField("title");
index.addField("keywords"); index.addField("keywords");
index.addField("description"); index.addField("description");
...@@ -333,6 +336,9 @@ function doc_search() { ...@@ -333,6 +336,9 @@ function doc_search() {
</script> </script>
</head> </head>
<body> <body>
<div style="font-family: Courier 10 Pitch; font-size: 2.5em;">
<span style="color: #c44654;">P</span><span style="color: #ac399c;">u</span><span style="color: #54439c;">r</span><span style="color: #ce4d3d;">e</span><span style="color: #3c9e54;">d</span><span style="color: #7349a4;">a</span><span style="color: purple;">t</span><span style="color: #7349a4;">a</span>
</div>
<svg xmlns="http://www.w3.org/2000/svg" <svg xmlns="http://www.w3.org/2000/svg"
version="1.1" version="1.1"
viewBox="0 0 450 65" viewBox="0 0 450 65"
......
...@@ -9,7 +9,7 @@ var pd_menus = require("./pd_menus.js"); ...@@ -9,7 +9,7 @@ var pd_menus = require("./pd_menus.js");
var pwd = process.env.PWD !== undefined ? process.env.PWD : process.env.HOME; var pwd = process.env.PWD !== undefined ? process.env.PWD : process.env.HOME;
// gui preset // gui preset
pdgui.skin.apply(this); pdgui.skin.apply(window);
// For translations // For translations
var l = pdgui.get_local_string; var l = pdgui.get_local_string;
......
...@@ -5,7 +5,7 @@ var pdgui = require("./pdgui.js"); ...@@ -5,7 +5,7 @@ var pdgui = require("./pdgui.js");
var pd_menus = require("./pd_menus.js"); var pd_menus = require("./pd_menus.js");
// Apply gui preset to this canvas // Apply gui preset to this canvas
pdgui.skin.apply(this); pdgui.skin.apply(window);
//var name = pdgui.last_loaded(); //var name = pdgui.last_loaded();
......
Supports Markdown
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