@@ -271,9 +271,12 @@ const saveBindingValues = async () => {
271271 . replace ( '{bgshape}' , getShapeCSS ( 'bg' ) )
272272 . replace ( '{fgshape}' , getShapeCSS ( 'fg' ) )
273273 . replace ( '{shcolor}' , PrettyRefresh . ini . shcolor )
274- await browser . storage . local . set ( { 'pretty_refresh' : PrettyRefresh . ini } ) ;
274+ await saveIni ( ) ;
275275 PrettyRefresh . loadIni ( ) ;
276276} ;
277+ const saveIni = async ( ) => {
278+ await browser . storage . local . set ( { 'pretty_refresh' : PrettyRefresh . ini } ) ;
279+ } ;
277280const saveBindingValuesDelay = ( ) => {
278281 resetTimer ( 'saveBindingValues' , saveBindingValues , 3000 ) ;
279282} ;
@@ -287,15 +290,7 @@ const importSetting = async text => {
287290 try {
288291 const obj = JSON . parse ( text ) ;
289292 Object . assign ( PrettyRefresh . ini , obj . ini ) ;
290- exData = obj . exData ;
291- saveIni ( ) ;
292- if ( obj . customGestureDetails ) {
293- for ( const c of obj . customGestureDetails ) {
294- const d = { } ;
295- d [ c . id ] = c . detail ;
296- await browser . storage . local . set ( d ) ;
297- }
298- }
293+ await saveIni ( ) ;
299294 location . reload ( ) ;
300295 } catch ( e ) {
301296 alert ( e . message ) ;
@@ -314,14 +309,7 @@ const importSettingOnChange = e => {
314309const exportSetting = async ( ) => {
315310 const data = {
316311 ini : PrettyRefresh . ini ,
317- exData : exData ,
318- customGestureDetails : [ ]
319312 } ;
320- for ( const c of exData . customGestureList ) {
321- const id = `pretty_refresh_${ c . id } ` ;
322- const detail = await storageValue ( id ) ;
323- data . customGestureDetails . push ( { id : id , detail :detail } ) ;
324- }
325313 const href = 'data:application/octet-stream,' + encodeURIComponent ( JSON . stringify ( data ) ) ;
326314 const link = byId ( 'exportSettingLink' ) ;
327315 link . setAttribute ( 'href' , href ) ;
@@ -350,6 +338,7 @@ const setupContents = () => {
350338 onChangeColorText ( { target : elm } ) ;
351339 }
352340} ;
341+
353342const setupEventListeners = ( ) => {
354343 for ( const elm of $bidingForms ) {
355344 elm . addEventListener ( 'change' , saveBindingValues ) ;
@@ -382,7 +371,6 @@ const setupEventListeners = () => {
382371 } ) ;
383372} ;
384373
385-
386374// control Back button
387375const changeState = state => {
388376 if ( ! state . dlg ) return ;
0 commit comments