This repository was archived by the owner on Aug 2, 2022. It is now read-only.
File tree 3 files changed +13
-11
lines changed
3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " __MSG_appName__ " ,
3
- "version" : " 0.0.10 " ,
2
+ "name" : " Better Go Playground " ,
3
+ "version" : " 0.0.11 " ,
4
4
"manifest_version" : 2 ,
5
- "description" : " __MSG_appDescription__ " ,
5
+ "description" : " Improves the Go Playground experience " ,
6
6
"icons" : {
7
7
"16" : " images/icon-16.png" ,
8
8
"128" : " images/icon-128.png"
Original file line number Diff line number Diff line change @@ -121,18 +121,18 @@ $(function () {
121
121
localStorage . setItem ( 'ace_theme' , theme ) ;
122
122
}
123
123
124
- function toggleTheme ( editor ) {
124
+ function toggleTheme ( editor , themeEl ) {
125
125
if ( editor . getTheme ( ) === 'ace/theme/solarized_light' ) {
126
- setTheme ( 'ace/theme/tomorrow_night' ) ;
126
+ setTheme ( editor , themeEl , 'ace/theme/tomorrow_night' ) ;
127
127
} else {
128
- setTheme ( 'ace/theme/solarized_light' ) ;
128
+ setTheme ( editor , themeEl , 'ace/theme/solarized_light' ) ;
129
129
}
130
130
}
131
131
132
132
function addThemeButton ( editor ) {
133
133
var bannerEl = document . getElementById ( 'banner' ) ;
134
134
var themeEl = $ ( '<input type="button" value="Dark" id="toggleTheme">' ) ;
135
- themeEl . click ( toggleTheme ) ;
135
+ themeEl . click ( ( ) => toggleTheme ( editor , themeEl ) ) ;
136
136
var theme = localStorage . getItem ( 'ace_theme' ) ;
137
137
138
138
if ( theme ) {
Original file line number Diff line number Diff line change @@ -120,18 +120,20 @@ $(function () {
120
120
localStorage . setItem ( 'ace_theme' , theme ) ;
121
121
}
122
122
123
- function toggleTheme ( editor ) {
123
+ function toggleTheme ( editor , themeEl ) {
124
124
if ( editor . getTheme ( ) === 'ace/theme/solarized_light' ) {
125
- setTheme ( 'ace/theme/tomorrow_night' ) ;
125
+ setTheme ( editor , themeEl , 'ace/theme/tomorrow_night' ) ;
126
126
} else {
127
- setTheme ( 'ace/theme/solarized_light' ) ;
127
+ setTheme ( editor , themeEl , 'ace/theme/solarized_light' ) ;
128
128
}
129
129
}
130
130
131
131
function addThemeButton ( editor ) {
132
132
var bannerEl = document . getElementById ( 'banner' ) ;
133
133
var themeEl = $ ( '<input type="button" value="Dark" id="toggleTheme">' ) ;
134
- themeEl . click ( toggleTheme ) ;
134
+ themeEl . click ( function ( ) {
135
+ return toggleTheme ( editor , themeEl ) ;
136
+ } ) ;
135
137
var theme = localStorage . getItem ( 'ace_theme' ) ;
136
138
137
139
if ( theme ) {
You can’t perform that action at this time.
0 commit comments