Skip to content
Snippets Groups Projects
Commit 59dd8049 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

clean up code per jslint

parent d0be7d25
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<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
...@@ -100,19 +100,9 @@ var pd_object_callback; ...@@ -100,19 +100,9 @@ var pd_object_callback;
var current_size; var current_size;
var canvas; var canvas;
function ok() {
apply();
cancel();
}
function change_size() {
pdgui.post("changing the size");
apply();
}
function apply() { function apply() {
pdgui.post("we're applying font size changes!"); pdgui.post("we're applying font size changes!");
pdgui.pdsend(canvas, "font", pdgui.pdsend(canvas, "font",
+document.querySelector('input[name="font_size"]:checked').value, +document.querySelector('input[name="font_size"]:checked').value,
current_size, current_size,
100, 100,
...@@ -125,6 +115,16 @@ function cancel() { ...@@ -125,6 +115,16 @@ function cancel() {
pdgui.pdsend(pd_object_callback, "cancel"); pdgui.pdsend(pd_object_callback, "cancel");
} }
function ok() {
apply();
cancel();
}
function change_size() {
pdgui.post("changing the size");
apply();
}
// This gets called from the nw_create_window function in index.html // This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it // It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks // we can create the menu and register event callbacks
...@@ -146,11 +146,12 @@ function register_window_id(gfxstub, attrs) { ...@@ -146,11 +146,12 @@ function register_window_id(gfxstub, attrs) {
// Stop-gap translator // Stop-gap translator
function translate_form() { 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++) { for (i = 0; i < elements.length; i++) {
var data = elements[i].dataset.i18n; data = elements[i].dataset.i18n;
if (data.slice(0,7) === "[title]") { if (data.slice(0, 7) === "[title]") {
elements[i].title = l(data.slice(7)); elements[i].title = l(data.slice(7));
} else { } else {
elements[i].textContent = l(data); elements[i].textContent = l(data);
...@@ -159,7 +160,7 @@ function translate_form() { ...@@ -159,7 +160,7 @@ function translate_form() {
} }
function get_attr(name, attrs) { function get_attr(name, attrs) {
return attrs[attrs.indexOf(name)+1]; return attrs[attrs.indexOf(name) + 1];
} }
function get_elem(name) { function get_elem(name) {
...@@ -174,7 +175,7 @@ function populate_form(attrs) { ...@@ -174,7 +175,7 @@ function populate_form(attrs) {
function add_events(name) { function add_events(name) {
// closing the Window // closing the Window
gui.Window.get().on("close", function() { gui.Window.get().on("close", function () {
// this needs to do whatever the "cancel" button does // this needs to do whatever the "cancel" button does
//pdgui.pdsend(name, "menuclose 0"); //pdgui.pdsend(name, "menuclose 0");
//cancel(); //cancel();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment