Skip to content

Commit

Permalink
使用直角引号 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored and riophae committed Apr 18, 2019
1 parent 4e0c38e commit aacc410
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
- 尽量不去调用饭否的 jQuery / YUI
- 使用图片素材时应考虑到 HiDPI 显示器的适配
- SVG 图片应该使用 [svgo](https://github.com/svg/svgo) 作优化处理
- 在 merge pull request 时应选择Squash and merge
- 在 merge pull request 时应选择Squash and merge
4 changes: 2 additions & 2 deletions docs/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

### 更新历史的显示位置

- “设置” → “更新历史,显示完整的更新历史
- 「设置」→「更新历史,显示完整的更新历史
- 扩展启动时弹出通知,显示本次版本更新内容的概要(如果刚刚升级到了新版本、开启了相关设置,并且 `versionHistory` 中包含了该版本的更新内容)

### 如何编写更新历史内容

- 更新历史应该介绍该版本在功能、设计及用户体验方面新引入或修正的内容
- 应该避免无意义的文字,如修正了一些 bug,尽量不打扰用户
- 应该避免无意义的文字,如修正了一些 bug,尽量不打扰用户
- 如果更新内容过多,可以在前面写一行概要,用于作为桌面通知内容显示

### 如何发布新版?
Expand Down
6 changes: 3 additions & 3 deletions src/background/environment/messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function createMessageHandler(port) {
port.postMessage({ senderId, message: respondedMessage })
}
} else {
throw new Error(`未知消息类型 ${message.action}`)
throw new Error(`未知消息类型 ${message.action}`)
}
}
}
Expand All @@ -49,15 +49,15 @@ const messaging = {

registerHandler(actionType, handler) {
if (messageHandlers[actionType]) {
throw new Error(`重复注册 ${actionType} 类型的消息处理器`)
throw new Error(`重复注册 ${actionType} 类型的消息处理器`)
} else {
messageHandlers[actionType] = handler
}
},

unregisterHandler(actionType) {
if (!delete messageHandlers[actionType]) {
throw new Error(`不存在 ${actionType} 类型的消息处理器,因此取消注册失败`)
throw new Error(`不存在 ${actionType} 类型的消息处理器,因此取消注册失败`)
}
},

Expand Down
4 changes: 2 additions & 2 deletions src/background/environment/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function mergeSettings(map) {

async function migrateSettings() {
// 下面被注释掉的有两种情况:
// 1. 已经转换成 soldered feature(不提供设置项,强制开启),使用“*”标记
// 2. 不打算再实现了或者设置项被去掉了,使用“-”标记
// 1. 已经转换成 soldered feature(不提供设置项,强制开启),使用「*」标记
// 2. 不打算再实现了或者设置项被去掉了,使用「-」标记
const optionNameMap = {
// * 'advanced_sidebar': true,
'auto_pager': 'auto-pager',
Expand Down
2 changes: 1 addition & 1 deletion src/features/auto-pager/script(page).js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isPublicTimelinePage } from '@libs/pageDetect'
import every from '@libs/promiseEvery'
import neg from '@libs/neg'

// “更多”按钮与可视区域底部距离缩小到该值时即自动加载
// 「更多」按钮与可视区域底部距离缩小到该值时即自动加载
const BUFFER = 500
const SCROLL_DEBOUNCE_WAIT = 250

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default context => {
? extractStatusTime(latestStatusMatchingKeyword)
: 0 // 表示没有任何消息,但是也没有报错
} catch (error) {
log.info(`获取关键字${keyword}的搜索结果出错`, error)
log.info(`获取关键字${keyword}的搜索结果出错`, error)
// 返回 undefined,将无法通过 isValidTimestamp() 检查
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ export default context => {

notification.create({
id: `saved-searches/${userId}/${keyword}`,
message: `您关注的话题${keyword}有了新消息`,
message: `您关注的话题${keyword}有了新消息`,
onClick,
buttonDefs: [ {
title: '查看',
Expand Down
2 changes: 1 addition & 1 deletion src/features/enrich-statuses/style(page).less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 我们插入 timeline 的外站图片,点击缩略图查看大图时,其右上角的去相册查看链接地址是无效的
// 我们插入 timeline 的外站图片,点击缩略图查看大图时,其右上角的去相册查看链接地址是无效的
// 所以直接隐藏之
#ZoomToAlbum > a[href="null"] {
display: none;
Expand Down
6 changes: 3 additions & 3 deletions src/features/favorite-fanfouers/script(page)[home].js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const USER_GUIDE = [
'1. 在用户个人页面通过点击名字右方的星形图标添加饭友到列表',
'2. 拖拽头像重新排序',
'3. 按住 Shift 键点击头像删除',
'4. 右击有爱饭友清空列表',
'4. 右击有爱饭友清空列表',
].join('\n')
const CONFIRMING_MESSAGE = '确定要清空有爱饭友列表吗?请注意这个操作无法撤回。'
const CLASSNAME_ITEM = 'sf-favorite-fanfouer-item'
Expand Down Expand Up @@ -271,8 +271,8 @@ export default context => {
const { friends } = elementCollection.getAll()

unmount = preactRender(<FavoriteFanfouers />, root => {
// 插入到我关注的人之前
// 因为假定有爱饭友的使用频率更高,所以显示靠前一些这样更方便
// 插入到我关注的人之前
// 因为假定有爱饭友的使用频率更高,所以显示靠前一些这样更方便
friends.before(root)
})
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default context => {
if (scrollManager.getScrollTop()) return
// 如果是在发送消息输入框内滑动滚轮时触发了事件,忽略之
if (event.target.tagName === 'TEXTAREA') return
// 如果新增 X 条最新消息,点击查看通知条未显示,忽略之
// 如果新增 X 条最新消息,点击查看通知条未显示,忽略之
if (!hasNewStatuses()) return

timeout.cancel()
Expand Down
2 changes: 1 addition & 1 deletion src/features/remove-app-recommendations/metadata.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const options = {
_: {
defaultValue: false,
label: '屏蔽饭否应用广告区和随机应用推荐',
label: '屏蔽饭否应用广告区和随机应用推荐',
},
}
2 changes: 1 addition & 1 deletion src/features/remove-logo-beta/metadata.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const options = {
_: {
defaultValue: true,
label: '去除 logo 的测试版字样',
label: '去除 logo 的测试版字样',
},
}
2 changes: 1 addition & 1 deletion src/features/share-to-fanfou/metadata.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const options = {
_: {
defaultValue: false,
label: '添加分享到饭否到网页右键菜单',
label: '添加分享到饭否到网页右键菜单',
},
}
2 changes: 1 addition & 1 deletion src/features/show-contextual-statuses/script(page).js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export default context => {
// 饭否在加载下一页消息后,会直接使用 innerHTML 的方式覆写当前 HTML
// 这就导致原本存在的 DOM 结构被替换掉
// MutationObserver 的 mutationRecord.addedNodes 中会包含旧消息
// 而这些旧消息中已经展开了的部分所绑定的监听事件会丢失,也就是dead instance
// 而这些旧消息中已经展开了的部分所绑定的监听事件会丢失,也就是dead instance
// 我们用原来可以交互的实例(alive instance)替换掉新的实例
if (cacheMap.has(cacheId)) {
const aliveInstance = cacheMap.get(cacheId)
Expand Down
2 changes: 1 addition & 1 deletion src/features/show-contextual-statuses/style(page).less
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
}
}

// “展开”按钮可能会遮挡住原消息的图片,额外添加 margin 以避免重合
// 「展开」按钮可能会遮挡住原消息的图片,额外添加 margin 以避免重合
li[sf-contextual-statuses] .content .photo.zoom {
margin-bottom: 18px;
}
2 changes: 1 addition & 1 deletion src/features/sidebar-statistics/script(page).js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class SidebarStatistics extends Component {

// 背景图片
const backgroundImageUrl = userProfile.profile_background_image_url
// 需要检测用户是否在“设置→模板”中选择了不要背景图片
// 需要检测用户是否在「设置 → 模板」中选择了不要背景图片
const isBackgroundImageDisabled = getComputedStyle(document.body).backgroundImage === 'none'

this.setState({
Expand Down
4 changes: 2 additions & 2 deletions src/features/user-switcher/manual-tests.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- 点击右上角的“退出”应该把当前登录用户从切换列表中去除
- 点击右上角的「退出」应该把当前登录用户从切换列表中去除
- 用户更换用户名或头像等,列表中数据应该及时更新
- 不勾选保存到切换列表,则不应该保存到列表中
- 不勾选保存到切换列表,则不应该保存到列表中
2 changes: 1 addition & 1 deletion src/features/user-switcher/script(page)[login-form].js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default context => {
onLoad() {
elementCollection.get('al').checked = true
originalAutoLoginLabel = elementCollection.get('al').nextSibling.textContent
elementCollection.get('al').nextSibling.textContent = ' 保存到多账户切换列表'
elementCollection.get('al').nextSibling.textContent = ' 保存到多账户切换列表'
},

onUnload() {
Expand Down
6 changes: 3 additions & 3 deletions src/features/user-switcher/script(page)[user-switcher].js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export default context => {
nickname: select('#user_top h3').textContent,
avatarUrl: select('#user_top img').src,
cookies: omitBy(allCookies, (_, key) => (
key.startsWith('_') || // 跳过键名以“_”开头的 cookie
key === 'uuid' // 跳过键名为uuid的 cookie
key.startsWith('_') || // 跳过键名以「_」开头的 cookie
key === 'uuid' // 跳过键名为uuid的 cookie
)),
}

Expand Down Expand Up @@ -246,7 +246,7 @@ export default context => {
applyWhen: () => elementCollection.ready('usertop'),

async onLoad() {
// 登录时若勾选了保存到切换列表(即原本的自动登录),则存在这个 cookie
// 登录时若勾选了保存到切换列表(即原本的自动登录),则存在这个 cookie
if (Cookies.get('al')) {
await addOrUpdateCurrentUser()
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/libs/pageDetect.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const isLoggedInUserFollowersListPage = simpleMemoize(async () => {
// 是否为用户 timeline 页面
export const isUserProfilePage = simpleMemoize(() => {
return any([
// 只有用户个人页面中才存在“投诉”对话框
// 只有用户个人页面中才存在「投诉」对话框
safeElementReady('#overlay-report'),
// 但是当前登录用户的个人页面中没有“投诉”对话框,需要额外判断
// 但是当前登录用户的个人页面中没有「投诉」对话框,需要额外判断
isLoggedInUserProfilePage(),
])
})
Expand Down

0 comments on commit aacc410

Please sign in to comment.