Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sanket Bhukan
purr-data
Commits
59dd8049
Commit
59dd8049
authored
9 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Patches
Plain Diff
clean up code per jslint
parent
d0be7d25
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pd/nw/dialog_font.html
+19
-18
19 additions, 18 deletions
pd/nw/dialog_font.html
with
19 additions
and
18 deletions
pd/nw/dialog_font.html
+
19
−
18
View file @
59dd8049
...
@@ -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();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment