Skip to content

Commit

Permalink
1.3.8: fix some bugs & appearance improvement
Browse files Browse the repository at this point in the history
 - fix: popup simple list is too short (fixes cnwangjie#44)
 - fix: store all tabs in all window command not work (fixes cnwangjie#47)
 - change: untitled list will show the title of tabs in popup simple list (fixes cnwangjie#45)
 - change: do not display the change logs in about page
 - change: apply the nightmode to the popup simple list (fixes cnwangjie#46)
  • Loading branch information
cnwangjie committed Sep 21, 2018
1 parent 4d75e7c commit 6d5534e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### v1.3.8 9/21/2018

- fix: popup simple list is too short
- fix: store all tabs in all window command not work
- change: untitled list will show the title of tabs in popup simple list
- change: do not display the change logs in about page
- change: apply the nightmode to the popup simple list

### v1.3.7 9/19/2018

- feat: search function in the detail list page & add an option to allow to enable or disable it
Expand Down
2 changes: 2 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ const dynamicDisableMenu = async () => {
}

const commandHandler = async command => {
console.log('received command', command)
if (command === 'store-selected-tabs') tabs.storeSelectedTabs()
else if (command === 'store-all-tabs') tabs.storeAllTabs()
else if (command === 'store-all-in-all-windows') tabs.storeAllTabInAllWindows()
else if (command === 'restore-lastest-list') {
const lists = await storage.getLists()
if (lists.length === 0) return true
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "__MSG_ext_name__",
"version": "1.3.7",
"version": "1.3.8",
"default_locale": "en",
"description": "__MSG_ext_desc__",
"author": "WangJie <[email protected]>",
Expand Down
7 changes: 1 addition & 6 deletions src/page/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,19 @@
</v-list>
</v-card>
<v-subheader>Change Logs</v-subheader>
<v-card>
<v-card-text v-html="changelog">
</v-card-text>
</v-card>
<v-btn flat block href="https://github.com/cnwangjie/better-onetab/blob/master/CHANGELOG.md">Click to view the whole change logs</v-btn>
</v-flex>
</v-layout>
</div>
</template>
<script>
import __ from '@/common/i18n'
import changelog from '@/../CHANGELOG.md'
export default {
data() {
return {
version: '',
update: '',
changelog,
}
},
created() {
Expand Down
22 changes: 20 additions & 2 deletions src/page/Popup.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-app :style="{width: '320px', height: 'auto', maxHeight: '75vh'}">
<v-app :style="{width: '320px'}" :dark="nightmode">
<v-list dense>
<template v-for="(list, index) in lists">
<v-list-tile
Expand All @@ -9,7 +9,7 @@
:color="list.color"
>
<v-list-tile-content>
<v-list-tile-title><strong>[{{ list.tabs.length }}]</strong> {{ list.title || __('ui_untitled') }}</v-list-tile-title>
<v-list-tile-title><strong>[{{ list.tabs.length }}]</strong> {{ friendlyTitle(list) }}</v-list-tile-title>
<v-list-tile-sub-title>{{ formatTime(list.time) }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
Expand All @@ -26,12 +26,14 @@ import __ from '@/common/i18n'
import tabs from '@/common/tabs'
import storage from '@/common/storage'
import {formatTime} from '@/common/utils'
import browser from 'webextension-polyfill'
export default {
data() {
return {
lists: [],
action: '',
nightmode: false,
}
},
created() {
Expand All @@ -40,7 +42,23 @@ export default {
methods: {
__,
formatTime,
friendlyTitle(list) {
if (list.title) return list.title
const maxLen = 100
const titles = list.tabs.map(i => i.title)
let title = ''
while (title.length < maxLen && titles.length !== 0) {
title += titles.shift() + ', '
}
title = ': ' + title.slice(0, -2).substr(0, maxLen - 3) + '...'
return title
},
async switchNightMode() {
const window = await browser.runtime.getBackgroundPage()
if ('nightmode' in window) this.nightmode = window.nightmode || false
},
async init() {
this.switchNightMode()
const lists = await storage.getLists()
this.lists = lists
const opts = await storage.getOptions()
Expand Down

0 comments on commit 6d5534e

Please sign in to comment.