-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
93 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
export type URLPattern = string | ||
export type SiteOption = { | ||
import { DefinePreferences } from './' | ||
|
||
type URLPattern = string | ||
type SiteOption = { | ||
id: string | ||
icon: string | null | ||
name: string | ||
url_pattern: URLPattern | ||
enable_mobile: boolean | ||
} | ||
export type SiteSettingsRow = { | ||
type SiteSettingsRow = { | ||
id: string | ||
name: string | ||
row: Array<SiteOption> | ||
} | ||
export type SiteSettings = Array<SiteSettingsRow> | ||
type SiteSettings = Array<SiteSettingsRow> | ||
|
||
export type PreferencesV3 = Readonly<{ | ||
__is_poker__: true, | ||
version: 3 | ||
export type PreferencesV3 = DefinePreferences<3, { | ||
launch_poker_contextmenu: boolean | ||
site_settings: SiteSettings | ||
}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// v2.0.0 启用 | ||
|
||
import { DefinePreferences } from './' | ||
|
||
export type URLPattern = string | ||
export type SiteOption = { | ||
id: string | ||
icon: string | null | ||
name: string | ||
url_pattern: URLPattern | ||
access_mode: 'DESKTOP' | 'MOBILE' | 'MOBILE-STRONG' | ||
width_size: number | ||
} | ||
export type SiteSettingFloorID = string | ||
export type SiteSettingFloor = { | ||
id: SiteSettingFloorID | ||
name: string | ||
row: Array<SiteOption> | ||
} | ||
export type SiteSettings = Array<SiteSettingFloor> | ||
|
||
export type PreferencesV5 = DefinePreferences<5, { | ||
// 右键菜单栏【启动Poker】 | ||
launch_poker_contextmenu: boolean | ||
|
||
// 将每一层的页面填充满 | ||
fill_empty_window: boolean | ||
|
||
// 「唤回 Poker」窗口 | ||
refocus_window: boolean | ||
|
||
site_settings: SiteSettings | ||
}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { PreferencesV4 } from './v4-type' | ||
import { PreferencesV5 } from './v5-type' | ||
|
||
export function updater(v4: PreferencesV4): PreferencesV5 { | ||
return { | ||
...v4, | ||
|
||
version: 5, | ||
|
||
site_settings: v4.site_settings.map(settings_row => { | ||
return { | ||
...settings_row, | ||
row: settings_row.row.map(opt => { | ||
return { | ||
...opt, | ||
width_size: 1 | ||
} | ||
}) | ||
} | ||
}), | ||
} | ||
} |