Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 09fc4c8

Browse files
author
Daniel Cannon
committed
Fix theme button and bump version
1 parent feab06b commit 09fc4c8

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

Diff for: app/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "__MSG_appName__",
3-
"version": "0.0.10",
2+
"name": "Better Go Playground",
3+
"version": "0.0.11",
44
"manifest_version": 2,
5-
"description": "__MSG_appDescription__",
5+
"description": "Improves the Go Playground experience",
66
"icons": {
77
"16": "images/icon-16.png",
88
"128": "images/icon-128.png"

Diff for: app/scripts.babel/contentscript.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ $(function () {
121121
localStorage.setItem('ace_theme', theme);
122122
}
123123

124-
function toggleTheme(editor) {
124+
function toggleTheme(editor, themeEl) {
125125
if (editor.getTheme() === 'ace/theme/solarized_light') {
126-
setTheme('ace/theme/tomorrow_night');
126+
setTheme(editor, themeEl, 'ace/theme/tomorrow_night');
127127
} else {
128-
setTheme('ace/theme/solarized_light');
128+
setTheme(editor, themeEl, 'ace/theme/solarized_light');
129129
}
130130
}
131131

132132
function addThemeButton(editor) {
133133
var bannerEl = document.getElementById('banner');
134134
var themeEl = $('<input type="button" value="Dark" id="toggleTheme">');
135-
themeEl.click(toggleTheme);
135+
themeEl.click(() => toggleTheme(editor, themeEl));
136136
var theme = localStorage.getItem('ace_theme');
137137

138138
if (theme) {

Diff for: app/scripts/contentscript.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,20 @@ $(function () {
120120
localStorage.setItem('ace_theme', theme);
121121
}
122122

123-
function toggleTheme(editor) {
123+
function toggleTheme(editor, themeEl) {
124124
if (editor.getTheme() === 'ace/theme/solarized_light') {
125-
setTheme('ace/theme/tomorrow_night');
125+
setTheme(editor, themeEl, 'ace/theme/tomorrow_night');
126126
} else {
127-
setTheme('ace/theme/solarized_light');
127+
setTheme(editor, themeEl, 'ace/theme/solarized_light');
128128
}
129129
}
130130

131131
function addThemeButton(editor) {
132132
var bannerEl = document.getElementById('banner');
133133
var themeEl = $('<input type="button" value="Dark" id="toggleTheme">');
134-
themeEl.click(toggleTheme);
134+
themeEl.click(function () {
135+
return toggleTheme(editor, themeEl);
136+
});
135137
var theme = localStorage.getItem('ace_theme');
136138

137139
if (theme) {

0 commit comments

Comments
 (0)