hash
stringlengths
40
40
date
stringdate
2018-01-15 01:43:19
2024-04-02 15:49:23
author
stringclasses
18 values
commit_message
stringlengths
10
72
is_merge
bool
1 class
git_diff
stringlengths
132
6.87M
type
stringclasses
11 values
masked_commit_message
stringlengths
4
58
91ba054dae1d845893d7103cb1cefa411c0f8cad
2020-04-14 23:32:13
crimx
refactor(options): add entry DictPanel
false
diff --git a/src/_locales/en/options.ts b/src/_locales/en/options.ts index 193f5b0f9..b6a4e972c 100644 --- a/src/_locales/en/options.ts +++ b/src/_locales/en/options.ts @@ -22,6 +22,15 @@ export const locale: typeof _locale = { ctxTrans: 'Context Translate Engines', ctxTrans_help: 'Context sentence will be translated before being added to notebook.', + searchSuggests: 'Search suggests', + panelMaxHeightRatio: 'Panel max height ratio', + panelWidth: 'Panel width', + fontSize: 'Font size for search reasults', + bowlOffsetX: 'Saladict icon Offset X', + bowlOffsetY: 'Saladict icon Offset Y', + panelCSS: 'Custom Dict Panel Styles', + panelCSS_help: + 'Custom CSS. For Dict Panel use .dictPanel-Root as root. For dictionaries use .dictRoot or .d-{id} as root', opt: { export: 'Export Configs', @@ -45,8 +54,19 @@ export const locale: typeof _locale = { }, profile: { + mtaAutoUnfold: 'Auto unfold multiline search box', + waveform: 'Waveform Control', + waveform_help: + 'Display a button at the bottom of the Dict Panel for expanding the Waveform Control Panel. Audio files can still be played if turned off.', + opt: { - item_extra: 'This option may change base on "Profile".' + item_extra: 'This option may change base on "Profile".', + mtaAutoUnfold: { + always: 'Keep Unfolding', + never: 'Never Unfold', + once: 'Unfold Once', + popup: 'Only On Browser Action' + } } }, @@ -194,29 +214,15 @@ export const locale: typeof _locale = { bowl_hover: 'Icon Mouse Hover', bowl_hover_help: 'Hover on the bowl icon to trigger searching instead of clicking.', - bowl_offset: { - x: 'Saladict icon Offset X', - y: 'Saladict icon Offset Y' - }, + context_description: 'Each context menus item can also be customized. Youdao and Google page translate are deprecated in favor of the official extensions.', context_menus_title: 'Add Context Menus Items', context_menus_add_rules: 'URL with %s in place of query.', - dictPanel: { - custom_css: 'Custom Dict Panel Styles', - custom_css_help: - 'Custom CSS. For Dict Panel use .dictPanel-Root as root. For dictionaries use .dictRoot or .d-{id} as root', - font_size: 'Font size for search reasults', - height_ratio: 'Panel max height ratio', - width: 'Panel width' - }, + dict_selected: 'Selected Dicts', double_click_delay: 'Double Click Delay', - mta: 'Auto unfold multiline search box', - mta_always: 'Keep Unfolding', - mta_never: 'Never Unfold', - mta_once: 'Unfold Once', - mta_popup: 'Only On Browser Action', + no_type_field: 'No selection on editable regions', no_type_field_help: 'If selection making in editable regions is banned, the extension will identify Input Boxes, TextAreas and other common text editors like CodeMirror, ACE and Monaco.', @@ -231,7 +237,7 @@ export const locale: typeof _locale = { 'Cannot be turned off as it is the core functionality of Saladict.', profile_change: 'This option may change base on "Profile".', quick_search: 'Enable', - search_suggests: 'Search suggests', + sel_blackwhitelist: 'Selection Black/White List', sel_blackwhitelist_help: 'Saladict will not react to selection in blacklisted pages.', @@ -264,10 +270,7 @@ export const locale: typeof _locale = { touch_mode: 'Touch Mode', touch_mode_help: 'Enable touch related selection', update_check: 'Check Update', - update_check_help: 'Automatically check update from Github', - waveform: 'Waveform Control', - waveform_help: - 'Display a button at the bottom of the Dict Panel for expanding the Waveform Control Panel. Audio files can still be played if turned off.' + update_check_help: 'Automatically check update from Github' }, quickSearch: { diff --git a/src/_locales/zh-CN/options.ts b/src/_locales/zh-CN/options.ts index 9ba91bb5f..1a390f379 100644 --- a/src/_locales/zh-CN/options.ts +++ b/src/_locales/zh-CN/options.ts @@ -17,6 +17,15 @@ export const locale = { searchHistoryInco: '在私隐模式中记录', ctxTrans: '上下文翻译引擎', ctxTrans_help: '单词被添加进生词本前会自动翻译上下文。', + searchSuggests: '输入时显示候选', + panelMaxHeightRatio: '查词面板最高占屏幕比例', + panelWidth: '查词面板宽度', + fontSize: '词典内容字体大小', + bowlOffsetX: '沙拉图标水平偏移', + bowlOffsetY: '沙拉图标垂直偏移', + panelCSS: '自定义查词面板样式', + panelCSS_help: + '为查词面板添加自定义 CSS 。词典面板使用 .dictPanel-Root 作为根,词典使用 .dictRoot 或者 .d-词典ID 作为根。', opt: { export: '导出设定', @@ -40,8 +49,19 @@ export const locale = { }, profile: { + mtaAutoUnfold: '自动展开多行搜索框', + waveform: '波形控制按钮', + waveform_help: + '在词典面板下方显示音频控制面板展开按钮。关闭依然可以播放音频。', + opt: { - item_extra: '此选项会因「情景模式」而改变。' + item_extra: '此选项会因「情景模式」而改变。', + mtaAutoUnfold: { + always: '保持展开', + never: '从不展开', + once: '展开一次', + popup: '只在右上弹框展开' + } } }, @@ -181,29 +201,12 @@ export const locale = { }, bowl_hover: '图标悬停查词', bowl_hover_help: '鼠标悬停在沙拉图标上触发查词,否则需要点击。', - bowl_offset: { - x: '沙拉图标水平偏移', - y: '沙拉图标垂直偏移' - }, context_description: '设置右键菜单,可添加可自定义链接。网页翻译其实不需要沙拉查词,故已有的有道和谷歌网页翻译目前处于维护状态,没有计划添加新功能,请用其它官方扩展如彩云小译和谷歌翻译。', context_menus_title: '添加右键菜单项目', context_menus_add_rules: '链接中的 %s 会被替换为选词。', - dictPanel: { - custom_css: '自定义查词面板样式', - custom_css_help: - '为查词面板添加自定义 CSS 。词典面板使用 .dictPanel-Root 作为根,词典使用 .dictRoot 或者 .d-词典ID 作为根。', - font_size: '词典内容字体大小', - height_ratio: '查词面板最高占屏幕比例', - width: '查词面板宽度' - }, dict_selected: '已选词典', double_click_delay: '双击间隔', - mta: '自动展开多行搜索框', - mta_always: '保持展开', - mta_never: '从不展开', - mta_once: '展开一次', - mta_popup: '只在右上弹框展开', no_type_field: '不在输入框划词', no_type_field_help: '开启后,本扩展会自动识别输入框以及常见编辑器,如 CodeMirror、ACE 和 Monaco。', @@ -218,7 +221,7 @@ export const locale = { third_party_privacy_extra: '本特性为沙拉查词核心功能,无法关闭。', profile_change: '此选项会因「情景模式」而改变。', quick_search: '启用快捷键', - search_suggests: '输入时显示候选', + sel_blackwhitelist: '划词黑白名单', sel_blackwhitelist_help: '黑名单匹配的页面 Saladict 将不会响应鼠标划词。', sel_lang: '划词语言', @@ -250,10 +253,7 @@ export const locale = { touch_mode: '触摸模式', touch_mode_help: '支持触摸相关选词', update_check: '检查更新', - update_check_help: '自动检查 Github 更新', - waveform: '波形控制按钮', - waveform_help: - '在词典面板下方显示音频控制面板展开按钮。关闭依然可以播放音频。' + update_check_help: '自动检查 Github 更新' }, quickSearch: { diff --git a/src/_locales/zh-TW/options.ts b/src/_locales/zh-TW/options.ts index c80028322..42dc950ec 100644 --- a/src/_locales/zh-TW/options.ts +++ b/src/_locales/zh-TW/options.ts @@ -19,6 +19,15 @@ export const locale: typeof _locale = { searchHistoryInco: '在無痕模式中記錄', ctxTrans: '上下文翻譯引擎', ctxTrans_help: '單字加入生字本前會自動翻譯上下文。', + searchSuggests: '輸入時顯示候選', + panelMaxHeightRatio: '字典介面最高占螢幕高度比例', + panelWidth: '查字典介面寬度', + fontSize: '字典內容字型大小', + bowlOffsetX: '沙拉圖示水平偏移', + bowlOffsetY: '沙拉圖示垂直偏移', + panelCSS: '自訂查字介面樣式', + panelCSS_help: + '為查詞面板新增自定義 CSS 。詞典面板使用 .dictPanel-Root 作為根,詞典使用 .dictRoot 或者 .d-詞典ID 作為根。', opt: { export: '匯出設定', @@ -42,8 +51,19 @@ export const locale: typeof _locale = { }, profile: { + mtaAutoUnfold: '自動展開多行搜尋框', + waveform: '波形控制', + waveform_help: + '在字典介面下方顯示音訊控制面板展開按鈕。關閉依然可以播放音訊。', + opt: { - item_extra: '此選項會因「情景模式」而改變。' + item_extra: '此選項會因「情景模式」而改變。', + mtaAutoUnfold: { + always: '保持展開', + never: '永遠不展開', + once: '展開一次', + popup: '只在右上彈框展開' + } } }, @@ -184,31 +204,15 @@ export const locale: typeof _locale = { }, bowl_hover: '圖示暫留查字', bowl_hover_help: '滑鼠暫留在沙拉圖示上開啟字典介面,否則需要點選。', - bowl_offset: { - x: '沙拉圖示水平偏移', - y: '沙拉圖示垂直偏移' - }, + context_description: '設定右鍵選單,可新增可自定義連結。網頁翻譯其實不需要沙拉查詞,故已有的有道和谷歌網頁翻譯目前處於維護狀態,沒有計劃新增新功能,請用其它官方擴充套件如彩雲小譯和谷歌翻譯。', context_menus_title: '新增右鍵選單項目', context_menus_add_rules: '連結中的 %s 會被取代為選詞。', - dictPanel: { - custom_css: '自訂查字介面樣式', - custom_css_help: - '為查詞面板新增自定義 CSS 。詞典面板使用 .dictPanel-Root 作為根,詞典使用 .dictRoot 或者 .d-詞典ID 作為根。', - font_size: '字典內容字型大小', - height_ratio: '字典介面最高占螢幕高度比例', - width: '查字典介面寬度' - }, dict_selected: '已選字典', double_click_delay: '滑鼠按兩下間隔', - mta: '自動展開多行搜尋框', - mta_always: '保持展開', - mta_never: '永遠不展開', - mta_once: '展開一次', - mta_popup: '只在右上彈框展開', no_type_field: '不在輸入框滑鼠滑字', no_type_field_help: '開啟後,本程式會自動識別輸入框以及常見編輯器,如 CodeMirror、ACE 和 Monaco。', @@ -222,7 +226,7 @@ export const locale: typeof _locale = { third_party_privacy_extra: '本特性為沙拉查詞核心功能,無法關閉。', profile_change: '此選項會因「情景模式」而改變。', quick_search: '啟用快速鍵', - search_suggests: '輸入時顯示候選', + sel_blackwhitelist: '選詞黑白名單', sel_blackwhitelist_help: '黑名單相符的頁面 Saladict 將不會響應滑鼠劃詞。', sel_lang: '選詞語言', @@ -254,10 +258,7 @@ export const locale: typeof _locale = { touch_mode: '觸控模式', touch_mode_help: '支援觸控相關選字', update_check: '檢查更新', - update_check_help: '自動檢查 Github 更新', - waveform: '波形控制', - waveform_help: - '在字典介面下方顯示音訊控制面板展開按鈕。關閉依然可以播放音訊。' + update_check_help: '自動檢查 Github 更新' }, quickSearch: { diff --git a/src/options/components/Entries/DictPanel.tsx b/src/options/components/Entries/DictPanel.tsx new file mode 100644 index 000000000..32be56745 --- /dev/null +++ b/src/options/components/Entries/DictPanel.tsx @@ -0,0 +1,135 @@ +import React, { FC, useMemo } from 'react' +import { Select, Switch, Input, Slider } from 'antd' +import { useTranslate } from '@/_helpers/i18n' +import { getProfilePath, getConfigPath } from '@/options/helpers/path-joiner' +import { + SaladictForm, + percentageSlideFormatter, + pixelSlideFormatter +} from '@/options/components/SaladictForm' + +export const DictPanel: FC = () => { + const { t, i18n, ready } = useTranslate('options') + const { availWidth } = window.screen + return ( + <SaladictForm + items={useMemo( + () => [ + { + name: getProfilePath('mtaAutoUnfold'), + children: ( + <Select> + <Select.Option value=""> + {t('profile.opt.mtaAutoUnfold.never')} + </Select.Option> + <Select.Option value="once"> + {t('profile.opt.mtaAutoUnfold.once')} + </Select.Option> + <Select.Option value="always"> + {t('profile.opt.mtaAutoUnfold.always')} + </Select.Option> + <Select.Option value="popup"> + {t('profile.opt.mtaAutoUnfold.popup')} + </Select.Option> + </Select> + ) + }, + { + name: getProfilePath('waveform'), + valuePropName: 'checked', + children: <Switch /> + }, + { + name: getConfigPath('searchSuggests'), + valuePropName: 'checked', + children: <Switch /> + }, + { + name: getConfigPath('animation'), + valuePropName: 'checked', + children: <Switch /> + }, + { + name: getConfigPath('darkMode'), + valuePropName: 'checked', + children: <Switch /> + }, + { + name: getConfigPath('panelMaxHeightRatio'), + children: ( + <Slider + tipFormatter={percentageSlideFormatter} + min={30} + max={95} + marks={{ 30: '30%', 95: '95%' }} + /> + ) + }, + { + name: getConfigPath('panelWidth'), + children: ( + <Slider + tipFormatter={pixelSlideFormatter} + min={250} + max={availWidth} + marks={{ 250: '250px', [availWidth]: `${availWidth}px` }} + /> + ) + }, + { + name: getConfigPath('fontSize'), + children: ( + <Slider + tipFormatter={pixelSlideFormatter} + min={8} + max={30} + marks={{ 8: '8px', 30: '30px' }} + /> + ) + }, + { + name: getConfigPath('bowlOffsetX'), + children: ( + <Slider + tipFormatter={pixelSlideFormatter} + min={-100} + max={100} + marks={{ '-100': '-100px', 0: '0px', 100: '100px' }} + /> + ) + }, + { + name: getConfigPath('bowlOffsetY'), + children: ( + <Slider + tipFormatter={pixelSlideFormatter} + min={-100} + max={100} + marks={{ '-100': '-100px', 0: '0px', 100: '100px' }} + /> + ) + }, + { + name: getConfigPath('panelCSS'), + extra: ( + <a + href="https://github.com/crimx/ext-saladict/wiki/PanelCSS#wiki-content" + target="_blank" + rel="nofollow noopener noreferrer" + > + Examples + </a> + ), + children: ( + <Input.TextArea + placeholder=".dictPanel-Root { }" + autoSize={{ minRows: 4, maxRows: 15 }} + /> + ) + } + ], + [ready, i18n.language] + )} + /> + ) +} diff --git a/src/options/components/InputNumberGroup/index.tsx b/src/options/components/InputNumberGroup/index.tsx index a9beeeb04..b137a5d3a 100644 --- a/src/options/components/InputNumberGroup/index.tsx +++ b/src/options/components/InputNumberGroup/index.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { FC } from 'react' import { InputNumber } from 'antd' import { InputNumberProps } from 'antd/lib/input-number' @@ -8,19 +8,14 @@ export interface InputNumberGroupProps extends InputNumberProps { suffix?: React.ReactNode } -export class InputNumberGroup extends React.Component<InputNumberGroupProps> { - render() { - return ( - <span className="input-number-group-wrapper"> - <span className="input-number-group"> - <InputNumber {...this.props} /> - {!!this.props.suffix && ( - <span className="input-number-group-addon"> - {this.props.suffix} - </span> - )} - </span> +export const InputNumberGroup: FC<InputNumberGroupProps> = props => { + const { suffix, ...restProps } = props + return ( + <span className="input-number-group-wrapper"> + <span className="input-number-group"> + <InputNumber {...restProps} /> + {suffix && <span className="input-number-group-addon">{suffix}</span>} </span> - ) - } + </span> + ) } diff --git a/src/options/components/SaladictForm/_style.scss b/src/options/components/SaladictForm/_style.scss index 9c8a56fbd..40935e313 100644 --- a/src/options/components/SaladictForm/_style.scss +++ b/src/options/components/SaladictForm/_style.scss @@ -7,6 +7,15 @@ } } +.saladict-form-profile-title { + cursor: help; + + .anticon { + color: #f5222d; + margin-right: 0.5em; + } +} + .saladict-hide { display: none !important; } diff --git a/src/options/components/SaladictForm/index.tsx b/src/options/components/SaladictForm/index.tsx index 21b32dc8a..6d3c1ed39 100644 --- a/src/options/components/SaladictForm/index.tsx +++ b/src/options/components/SaladictForm/index.tsx @@ -1,6 +1,6 @@ import React, { FC, useContext, ReactNode, useMemo } from 'react' -import { Form, Button, Modal } from 'antd' -import { FormItemProps } from 'antd/lib/form' +import { Form, Button, Modal, Tooltip } from 'antd' +import { FormItemProps, Rule } from 'antd/lib/form' import { ExclamationCircleOutlined, BlockOutlined } from '@ant-design/icons' import get from 'lodash/get' import mapValues from 'lodash/mapValues' @@ -103,26 +103,31 @@ export const SaladictForm: FC<SaladictFormProps> = props => { if (ready && i18n.exists(`options:${name}`)) { item.label = isProfile ? ( - <> - <BlockOutlined style={{ color: '#f5222d', marginRight: '0.5em' }} /> - {t(name)} - </> + <Tooltip + title={t('profile.opt.item_extra')} + className="saladict-form-profile-title" + > + <span> + <BlockOutlined /> + {t(name)} + </span> + </Tooltip> ) : ( t(name) ) } - const help = `options:${name}_help` - if (ready && i18n.exists(help)) { - item.help = t(help) + if (!item.help) { + const help = `options:${name}_help` + if (ready && i18n.exists(help)) { + item.help = t(help) + } } - const extra = `options:${name}_extra` - if (ready) { - if (i18n.exists(extra)) { + if (!item.extra) { + const extra = `options:${name}_extra` + if (ready && i18n.exists(extra)) { item.extra = t(extra) - } else if (isProfile) { - item.extra = t('profile.opt.item_extra') } } @@ -184,6 +189,14 @@ export const SaladictForm: FC<SaladictFormProps> = props => { ) } +export const NUMBER_RULES: Rule[] = [ + { type: 'number', whitespace: true, required: true } +] + +export const percentageSlideFormatter = (v: number) => `${v}%` + +export const pixelSlideFormatter = (v: number) => `${v}px` + function openShortcuts() { if (isFirefox) { openURL('about:addons')
refactor
add entry DictPanel
d6fb2f3b7d87f7b1d59c51d65ebb9b6ee49813fb
2019-09-02 21:46:44
crimx
refactor(content): integrate word editor
false
diff --git a/src/content/components/DictPanel/DictPanel.container.tsx b/src/content/components/DictPanel/DictPanel.container.tsx index 1fff00be5..f7eba81ee 100644 --- a/src/content/components/DictPanel/DictPanel.container.tsx +++ b/src/content/components/DictPanel/DictPanel.container.tsx @@ -18,7 +18,7 @@ type Dispatchers = 'onDragEnd' const mapStateToProps = ( state: StoreState ): Omit<DictPanelPortalProps, Dispatchers> => { - const { mouseX, mouseY } = state.dictPanelCord + const { mouseX, mouseY } = state.dictPanelCoord return { show: state.isShowDictPanel, // icon position 10px panel position diff --git a/src/content/components/WordEditor/WordEditor.container.tsx b/src/content/components/WordEditor/WordEditor.container.tsx new file mode 100644 index 000000000..19abe73a7 --- /dev/null +++ b/src/content/components/WordEditor/WordEditor.container.tsx @@ -0,0 +1,31 @@ +import { connect } from 'react-redux' +import { WordEditorPortal, WordEditorPortalProps } from './WordEditor.portal' +import { StoreState, StoreAction } from '@/content/redux/modules' +import { Dispatch } from 'redux' + +type Dispatchers = 'onClose' + +const mapStateToProps = ( + state: StoreState +): Omit<WordEditorPortalProps, Dispatchers> => ({ + show: state.isShowWordEditor, + withAnimation: state.config.animation, + width: window.innerWidth - state.config.panelWidth - 100, + ctxTrans: state.config.ctxTrans, + word: state.selection.word +}) + +const mapDispatchToProps = ( + dispatch: Dispatch<StoreAction> +): Pick<WordEditorPortalProps, Dispatchers> => ({ + onClose: () => { + dispatch({ type: 'WORD_EDITOR_STATUS', payload: false }) + } +}) + +export const WordEditorContainer = connect( + mapStateToProps, + mapDispatchToProps +)(WordEditorPortal) + +export default WordEditorContainer diff --git a/src/content/components/WordEditor/WordEditor.tsx b/src/content/components/WordEditor/WordEditor.tsx index 0d26cc2b5..9b3047812 100644 --- a/src/content/components/WordEditor/WordEditor.tsx +++ b/src/content/components/WordEditor/WordEditor.tsx @@ -3,17 +3,14 @@ import { WordEditorPanel, WordEditorPanelProps } from './WordEditorPanel' import { SALADICT_EXTERNAL } from '@/_helpers/saladict' export interface WordEditorProps extends WordEditorPanelProps { - dictPanelWidth: number + width: number } export const WordEditor: FC<WordEditorProps> = props => { - const { dictPanelWidth, ...restProps } = props + const { width, ...restProps } = props return ( <div className={`wordEditor-Container ${SALADICT_EXTERNAL}`}> - <div - className="wordEditor-PanelContainer" - style={{ width: window.innerWidth - dictPanelWidth - 40 }} - > + <div className="wordEditor-PanelContainer" style={{ width }}> <WordEditorPanel {...restProps} /> </div> </div> diff --git a/src/content/components/WordEditor/WordEditorPanel.scss b/src/content/components/WordEditor/WordEditorPanel.scss index 6529fa352..9cc2bb7d5 100644 --- a/src/content/components/WordEditor/WordEditorPanel.scss +++ b/src/content/components/WordEditor/WordEditorPanel.scss @@ -51,6 +51,7 @@ textarea { .wordEditor-Panel { display: flex; flex-direction: column; + width: 80%; max-width: 800px; min-width: 400px; max-height: 90vh; diff --git a/src/content/components/WordEditor/WordEditorPanel.tsx b/src/content/components/WordEditor/WordEditorPanel.tsx index ce9671a4c..4b691919d 100644 --- a/src/content/components/WordEditor/WordEditorPanel.tsx +++ b/src/content/components/WordEditor/WordEditorPanel.tsx @@ -1,31 +1,79 @@ -import React, { FC, useState, useEffect } from 'react' +import React, { FC, useState } from 'react' import { Word, getWordsByText, deleteWords, - saveWord + saveWord, + newWord } from '@/_helpers/record-manager' import { AppConfig } from '@/app-config' import { translateCtx } from '@/_helpers/translateCtx' import { useTranslate } from '@/_helpers/i18n' import WordCards from './WordCards' import { message } from '@/_helpers/browser-api' +import { + useObservable, + useObservableState, + useObservableCallback +} from 'observable-hooks' +import { merge, of } from 'rxjs' +import { + filter, + pluck, + startWith, + withLatestFrom, + share, + switchMap, + debounceTime +} from 'rxjs/operators' export interface WordEditorPanelProps { - word: Word + word: Word | null /** dicts to translate context */ ctxTrans: AppConfig['ctxTrans'] - onWordChanged: (newWord: Word) => void + // onWordChanged: (newWord: Word) => void onClose: () => void } export const WordEditorPanel: FC<WordEditorPanelProps> = props => { const { t } = useTranslate(['common', 'content']) const [isDirty, setDirty] = useState(false) - const [relatedWords, setRelatedWords] = useState<Word[]>([]) - useEffect(getRelatedWords, [props.word.text]) + const propsWord$$ = useObservable( + inputs$ => + inputs$.pipe( + pluck(0), + filter((word): word is Word => !!word), + startWith(newWord()), + share() + ), + [props.word] as const + ) + + const [setWord, word$] = useObservableCallback<Word>(word$ => + merge(propsWord$$, word$) + ) + + const word = useObservableState(word$)! + + const [relatedWords, getRelatedWords] = useObservableState<Word[], void>( + event$ => + event$.pipe( + debounceTime(200), + withLatestFrom(propsWord$$), + switchMap(([, word]) => { + if (!word.text) { + return of([]) + } + + return getWordsByText('notebook', word.text) + .then(words => words.filter(({ date }) => date !== word.date)) + .catch(() => []) + }) + ), + [] + ) return ( <div className="wordEditor-Panel"> @@ -46,7 +94,7 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { type="text" name="text" id="wordEditor-Note_Word" - value={props.word.text} + value={word.text} onChange={formChanged} /> <label htmlFor="wordEditor-Note_Trans"> @@ -64,7 +112,7 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { rows={5} name="trans" id="wordEditor-Note_Trans" - value={props.word.trans} + value={word.trans} onChange={formChanged} /> <label htmlFor="wordEditor-Note_Note">{t('note.note')}</label> @@ -72,7 +120,7 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { rows={5} name="note" id="wordEditor-Note_Note" - value={props.word.note} + value={word.note} onChange={formChanged} /> <label htmlFor="wordEditor-Note_Context">{t('note.context')}</label> @@ -80,7 +128,7 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { rows={5} name="context" id="wordEditor-Note_Context" - value={props.word.context} + value={word.context} onChange={formChanged} /> <label htmlFor="wordEditor-Note_SrcTitle">{t('note.srcTitle')}</label> @@ -88,7 +136,7 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { type="text" name="title" id="wordEditor-Note_SrcTitle" - value={props.word.title} + value={word.title} onChange={formChanged} /> <label htmlFor="wordEditor-Note_SrcLink">{t('note.srcLink')}</label> @@ -96,15 +144,15 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { type="text" name="url" id="wordEditor-Note_SrcLink" - value={props.word.url} + value={word.url} onChange={formChanged} /> <label htmlFor="wordEditor-Note_SrcFavicon"> {t('note.srcFavicon')} - {props.word.favicon ? ( + {word.favicon ? ( <img className="wordEditor-Note_SrcFavicon" - src={props.word.favicon} + src={word.favicon} alt={t('note.srcTitle')} /> ) : null} @@ -113,7 +161,7 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { type="text" name="favicon" id="wordEditor-Note_SrcFavicon" - value={props.word.favicon} + value={word.favicon} onChange={formChanged} /> </form> @@ -133,13 +181,11 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { type="button" className="wordEditor-Note_Btn" onClick={() => { - translateCtx(props.word.context || props.word.text, props.ctxTrans) + translateCtx(word.context || word.text, props.ctxTrans) .then(trans => { - props.onWordChanged({ - ...props.word, - trans: props.word.trans - ? props.word.trans + '\n\n' + trans - : trans + setWord({ + ...word, + trans: word.trans ? word.trans + '\n\n' + trans : trans }) }) .catch(console.error) @@ -175,7 +221,7 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { type="button" className="wordEditor-Note_BtnSave" onClick={() => - saveWord('notebook', props.word) + saveWord('notebook', word) .then(closeEditor) .catch(console.error) } @@ -197,22 +243,11 @@ export const WordEditorPanel: FC<WordEditorPanelProps> = props => { }: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) { setDirty(true) - props.onWordChanged({ - ...props.word, + setWord({ + ...word, [currentTarget.name]: currentTarget.value }) } - - function getRelatedWords() { - if (!props.word.text) { - setRelatedWords([]) - } - getWordsByText('notebook', props.word.text) - .then(words => { - setRelatedWords(words.filter(({ date }) => date !== props.word.date)) - }) - .catch(() => {}) - } } export default WordEditorPanel diff --git a/src/content/index.tsx b/src/content/index.tsx index b9c2dcaa7..0ab0fa567 100644 --- a/src/content/index.tsx +++ b/src/content/index.tsx @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom' import { Provider as ProviderRedux } from 'react-redux' import SaladBowlContainer from './components/SaladBowl/SaladBowl.container' import DictPanelContainer from './components/DictPanel/DictPanel.container' +import WordEditorContainer from './components/WordEditor/WordEditor.container' import createStore from './redux/create' import { I18nextProvider as ProviderI18next } from 'react-i18next' @@ -20,6 +21,7 @@ if (window.parent === window && !window.__SALADICT_PANEL_LOADED__) { <ProviderI18next i18n={i18n}> <SaladBowlContainer /> <DictPanelContainer /> + <WordEditorContainer /> </ProviderI18next> </ProviderRedux> ) diff --git a/src/content/redux/modules/action-catalog.ts b/src/content/redux/modules/action-catalog.ts index e2d24e8e4..321eb16e9 100644 --- a/src/content/redux/modules/action-catalog.ts +++ b/src/content/redux/modules/action-catalog.ts @@ -100,4 +100,12 @@ export type ActionCatalog = { } OPEN_QS_PANEL: {} + + /* ------------------------------------------------ *\ + Word Editor Panel + \* ------------------------------------------------ */ + + WORD_EDITOR_STATUS: { + payload: boolean + } } diff --git a/src/content/redux/modules/epics/index.ts b/src/content/redux/modules/epics/index.ts index 43cd56224..160573ef1 100644 --- a/src/content/redux/modules/epics/index.ts +++ b/src/content/redux/modules/epics/index.ts @@ -1,4 +1,5 @@ import { combineEpics } from 'redux-observable' +import { from, of } from 'rxjs' import { map, mapTo, mergeMap, filter } from 'rxjs/operators' import { saveWord } from '@/_helpers/record-manager' @@ -27,22 +28,32 @@ export const epics = combineEpics<StoreAction, StoreAction, StoreState>( (action$, state$) => action$.pipe( ofType('ADD_TO_NOTEBOOK'), - mergeMap(async () => { - const word = - state$.value.searchHistory[state$.value.searchHistory.length - 1] - if (word) { - try { - await saveWord('notebook', word) - return true - } catch (e) { - return false - } + mergeMap(() => { + if (state$.value.config.editOnFav) { + return of({ + type: 'WORD_EDITOR_STATUS', + payload: true + } as const) } - return false - }), - // dim icon if failed - filter(isSuccess => !isSuccess), - mapTo({ type: 'WORD_IN_NOTEBOOK', payload: false }) + + return from(async () => { + const word = + state$.value.searchHistory[state$.value.searchHistory.length - 1] + if (word) { + try { + await saveWord('notebook', word) + return true + } catch (e) { + return false + } + } + return false + }).pipe( + // dim icon if failed + filter(isSuccess => !isSuccess), + mapTo({ type: 'WORD_IN_NOTEBOOK', payload: false } as const) + ) + }) ), newSelectionEpic, searchStartEpic diff --git a/src/content/redux/modules/reducer/index.ts b/src/content/redux/modules/reducer/index.ts index d6c9fcf98..0898f89e6 100644 --- a/src/content/redux/modules/reducer/index.ts +++ b/src/content/redux/modules/reducer/index.ts @@ -104,11 +104,14 @@ export const reducer = createReducer< isFav: payload }), - ADD_TO_NOTEBOOK: state => ({ - ...state, - // epic will set this back to false if transation failed - isFav: true - }), + ADD_TO_NOTEBOOK: state => + state.config.editOnFav + ? state + : { + ...state, + // epic will set this back to false if transation failed + isFav: true + }, SEARCH_START: searchStart, @@ -177,7 +180,23 @@ export const reducer = createReducer< } }, - OPEN_QS_PANEL: openQSPanel + OPEN_QS_PANEL: openQSPanel, + + WORD_EDITOR_STATUS: (state, { payload }) => + payload + ? { + ...state, + isShowWordEditor: true, + dictPanelCoord: { + // negative value to force position + mouseX: -50, + mouseY: -(window.innerHeight * 0.2) + } + } + : { + ...state, + isShowWordEditor: false + } }) export default reducer diff --git a/src/content/redux/modules/reducer/new-selection.handler.ts b/src/content/redux/modules/reducer/new-selection.handler.ts index 00e6121e5..8fd190443 100644 --- a/src/content/redux/modules/reducer/new-selection.handler.ts +++ b/src/content/redux/modules/reducer/new-selection.handler.ts @@ -27,7 +27,7 @@ export const newSelection: StoreActionHandler<'NEW_SELECTION'> = ( if (selection.word) { newState.text = selection.word.text - newState.dictPanelCord = { + newState.dictPanelCoord = { mouseX: selection.mouseX, mouseY: selection.mouseY } diff --git a/src/content/redux/modules/reducer/open-qs-panel.handler.ts b/src/content/redux/modules/reducer/open-qs-panel.handler.ts index 948036cf5..79018deea 100644 --- a/src/content/redux/modules/reducer/open-qs-panel.handler.ts +++ b/src/content/redux/modules/reducer/open-qs-panel.handler.ts @@ -54,7 +54,7 @@ export const openQSPanel: StoreActionHandler<'OPEN_QS_PANEL'> = state => { isQSPanel: true, isShowDictPanel: true, // skip reconciliation with negative values - dictPanelCord: { + dictPanelCoord: { mouseX: -x, mouseY: -y } diff --git a/src/content/redux/modules/state.ts b/src/content/redux/modules/state.ts index 26c65c94d..eff7daef7 100644 --- a/src/content/redux/modules/state.ts +++ b/src/content/redux/modules/state.ts @@ -37,7 +37,7 @@ export const initState = () => ({ /** Is current word in Notebook */ isFav: false, /** Pass negative value to skip the reconciliation */ - dictPanelCord: { + dictPanelCoord: { mouseX: 0, mouseY: 0 },
refactor
integrate word editor
b4a13ebc1b3a135651ae9d43235a78454bcad3d8
2019-01-27 17:46:20
CRIMX
fix(panel): correct init selection
false
diff --git a/src/content/components/DictPanel/index.tsx b/src/content/components/DictPanel/index.tsx index db6b0cd96..4ae6db377 100644 --- a/src/content/components/DictPanel/index.tsx +++ b/src/content/components/DictPanel/index.tsx @@ -95,7 +95,7 @@ export class DictPanel extends React.Component<DictPanelProps & { t: Translation handleMtaBoxInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => { this.props.searchBoxUpdate({ - index: this.props.searchBoxIndex, + index: this.props.searchBox.index, text: e.currentTarget.value }) } @@ -103,10 +103,10 @@ export class DictPanel extends React.Component<DictPanelProps & { t: Translation handleMtaBoxKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => { if (e.key === 'Enter' && e.ctrlKey) { e.preventDefault() - if (this.props.searchBoxText) { + if (this.props.searchBox.text) { return this.searchText({ info: getDefaultSelectionInfo({ - text: this.props.searchBoxText, + text: this.props.searchBox.text, title: this.props.t('fromSaladict'), favicon: 'https://raw.githubusercontent.com/crimx/ext-saladict/dev/public/static/icon-16.png' }), @@ -157,7 +157,7 @@ export class DictPanel extends React.Component<DictPanelProps & { t: Translation renderMtaBox = () => ( <textarea ref={this.MtaBoxRef} - value={this.props.searchBoxText} + value={this.props.searchBox.text} onChange={this.handleMtaBoxInput} onKeyDown={this.handleMtaBoxKeyDown} style={{ fontSize: this.props.fontSize }} @@ -176,8 +176,7 @@ export class DictPanel extends React.Component<DictPanelProps & { t: Translation handleDragAreaMouseDown, handleDragAreaTouchStart, searchBoxUpdate, - searchBoxText, - searchBoxIndex, + searchBox, requestFavWord, shareImg, panelPinSwitch, @@ -220,8 +219,7 @@ export class DictPanel extends React.Component<DictPanelProps & { t: Translation handleDragAreaTouchStart, searchText: this.searchText, searchBoxUpdate, - searchBoxText, - searchBoxIndex, + searchBox, requestFavWord, shareImg, panelPinSwitch, diff --git a/src/content/components/MenuBar/index.tsx b/src/content/components/MenuBar/index.tsx index c71b988d2..46fbc020d 100644 --- a/src/content/components/MenuBar/index.tsx +++ b/src/content/components/MenuBar/index.tsx @@ -39,8 +39,10 @@ export interface MenuBarProps extends MenuBarDispatchers { readonly activeDicts: string[] readonly activeConfigID: string readonly profiles: Array<{ id: string, name: string }> - readonly searchBoxText: string - readonly searchBoxIndex: number + readonly searchBox: { + readonly index: number + readonly text: string + } readonly isShowMtaBox: boolean readonly searchSuggests: boolean } @@ -101,10 +103,10 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt } searchText = (text?: string) => { - if (this.props.searchBoxText) { + if (this.props.searchBox.text) { return this.props.searchText({ info: getDefaultSelectionInfo({ - text: text || this.props.searchBoxText, + text: text || this.props.searchBox.text, title: this.props.t('fromSaladict'), favicon: 'https://raw.githubusercontent.com/crimx/ext-saladict/dev/public/static/icon-16.png' }), @@ -116,7 +118,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt handleIconBackClick = (e: React.MouseEvent<HTMLButtonElement>) => { e.currentTarget.blur() // button will be disabled when it's on the boundary - const index = this.props.searchBoxIndex + 1 + const index = this.props.searchBox.index + 1 this.props.searchBoxUpdate({ index, text: this.props.searchHistory[index].text @@ -128,7 +130,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt handleIconNextClick = (e: React.MouseEvent<HTMLButtonElement>) => { e.currentTarget.blur() // button will be disabled when it's on the boundary - const index = this.props.searchBoxIndex - 1 + const index = this.props.searchBox.index - 1 this.props.searchBoxUpdate({ index, text: this.props.searchHistory[index].text @@ -139,7 +141,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt handleSearchBoxInput = (e: React.ChangeEvent<HTMLInputElement>) => { const text = e.currentTarget.value this.props.searchBoxUpdate({ - index: this.props.searchBoxIndex, + index: this.props.searchBox.index, text, }) if (this.props.searchSuggests) { @@ -313,7 +315,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt } componentDidUpdate (prevProps: MenuBarProps) { - if (prevProps.searchBoxText === this.props.searchBoxText && + if (prevProps.searchBox.text === this.props.searchBox.text && !this.props.isShowMtaBox && !this.state.isShowSuggestPanel && (isStandalonePage || this.props.isTripleCtrl || this.props.activeDicts.length <= 0) && @@ -394,8 +396,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt handleDragAreaMouseDown, handleDragAreaTouchStart, searchHistory, - searchBoxIndex, - searchBoxText, + searchBox, searchSuggests, } = this.props @@ -409,7 +410,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt <button className='panel-MenuBar_Btn-dir' onClick={this.handleIconBackClick} - disabled={searchBoxIndex >= searchHistory.length - 1} + disabled={searchBox.index >= searchHistory.length - 1} > <svg className='panel-MenuBar_Icon' @@ -423,7 +424,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt <button className='panel-MenuBar_Btn-dir' onClick={this.handleIconNextClick} - disabled={searchBoxIndex <= 0} + disabled={searchBox.index <= 0} > <svg className='panel-MenuBar_Icon' @@ -441,7 +442,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt onChange={this.handleSearchBoxInput} onKeyUp={this.handleSearchBoxKeyUp} onBlur={this.hideSuggests} - value={searchBoxText.replace(/\s+/g, ' ')} + value={searchBox.text.replace(/\s+/g, ' ')} /> <div> diff --git a/src/content/containers/DictPanelContainer.tsx b/src/content/containers/DictPanelContainer.tsx index 0bd859e60..8c6ca7012 100644 --- a/src/content/containers/DictPanelContainer.tsx +++ b/src/content/containers/DictPanelContainer.tsx @@ -36,8 +36,7 @@ export const mapStateToProps = ({ shouldPanelShow: widget.shouldPanelShow, panelRect: widget.panelRect, - searchBoxText: widget.searchBoxText, - searchBoxIndex: widget.searchBoxIndex, + searchBox: widget.searchBox, dictionaries, } diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index a2fcc4950..34685de46 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -152,8 +152,8 @@ export const reducer: DictsReducer = { }, [ActionType.SEARCH_START] (state, { toStart, toOnhold, toActive, info }) { const { dictionaries, widget } = state - const history = widget.searchBoxIndex > 0 - ? dictionaries.searchHistory.slice(widget.searchBoxIndex) + const history = widget.searchBox.index > 0 + ? dictionaries.searchHistory.slice(widget.searchBox.index) : dictionaries.searchHistory const dicts = { ...dictionaries.dicts } @@ -287,7 +287,7 @@ export function searchText ( ): DispatcherThunk { return (dispatch, getState) => { const state = getState() - const searchBoxIndex = state.widget.searchBoxIndex || 0 + const searchBoxIndex = state.widget.searchBox.index || 0 const info = arg ? arg.info || state.dictionaries.searchHistory[searchBoxIndex] : state.dictionaries.searchHistory[searchBoxIndex] @@ -445,6 +445,8 @@ export function summonedPanelInit ( } else { dispatch(restoreDicts()) dispatch(searchBoxUpdate({ text: info.text, index: 0 })) + // extra same text update which lets search input box select text + dispatch(searchBoxUpdate({ text: info.text, index: 0 })) } } } diff --git a/src/content/redux/modules/widget.ts b/src/content/redux/modules/widget.ts index a9c38be5e..865595152 100644 --- a/src/content/redux/modules/widget.ts +++ b/src/content/redux/modules/widget.ts @@ -104,8 +104,10 @@ export type WidgetState = { } readonly profiles: Array<{ id: string, name: string }> /** index in search history */ - readonly searchBoxIndex: number - readonly searchBoxText: string + readonly searchBox: { + index: number + text: string + } } } @@ -142,8 +144,10 @@ export const initState: WidgetState = { shouldPanelShow: false, }, profiles: [], - searchBoxIndex: 0, - searchBoxText: '', + searchBox: { + index: 0, + text: '', + }, } } @@ -394,13 +398,12 @@ export const reducer: WidgetReducer = { } } }, - [ActionType.SEARCH_BOX_UPDATE] (state, { text, index }) { + [ActionType.SEARCH_BOX_UPDATE] (state, searchBox) { return { ...state, widget: { ...state.widget, - searchBoxText: text, - searchBoxIndex: index, + searchBox, } } }, diff --git a/test/specs/components/content/MenuBar.spec.tsx b/test/specs/components/content/MenuBar.spec.tsx index 211acb6ec..bed14a7e0 100644 --- a/test/specs/components/content/MenuBar.spec.tsx +++ b/test/specs/components/content/MenuBar.spec.tsx @@ -22,8 +22,10 @@ describe('Component/content/MenuBar', () => { activeDicts: [config.id], activeConfigID: config.id, profiles: [getDefaultProfileID()], - searchBoxText: '', - searchBoxIndex: 0, + searchBox: { + index: 0, + text: '', + }, isShowMtaBox: false, searchText: noop, @@ -53,8 +55,10 @@ describe('Component/content/MenuBar', () => { activeDicts: [config.id], activeConfigID: config.id, profiles: [getDefaultProfileID()], - searchBoxText: '', - searchBoxIndex: 0, + searchBox: { + index: 0, + text: '', + }, isShowMtaBox: true, searchText: noop,
fix
correct init selection
de7ad77bd2c79b10ce4d6ff3ebcf0d9a650b2894
2021-10-17 12:13:00
crimx
refactor(config): update google search url
false
diff --git a/src/app-config/context-menus.ts b/src/app-config/context-menus.ts index 917ed8c0..c5d62f4b 100644 --- a/src/app-config/context-menus.ts +++ b/src/app-config/context-menus.ts @@ -19,7 +19,7 @@ export function getAllContextMenus(): { [id: string]: ContextItem } { etymonline: 'http://www.etymonline.com/index.php?search=%s', google_cn_page_translate: 'x', google_page_translate: 'x', - google_search: 'https://www.google.com/#newwindow=1&q=%s', + google_search: 'https://www.google.com/search?safe=off&newwindow=1&q=%s', google_translate: 'https://translate.google.com/#auto/zh-CN/%s', google_cn_translate: 'https://translate.google.cn/#auto/zh-CN/%s', guoyu: 'https://www.moedict.tw/%s',
refactor
update google search url
2bb22d2e99d10c7a2a6f8cabc434d8709934c29c
2019-08-16 21:13:33
crimx
fix: union hack
false
diff --git a/src/typings/message.ts b/src/typings/message.ts index b014c4dbb..5cbbb8737 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -233,17 +233,17 @@ export type MsgType = keyof MessageConfig // 'extends' hack to generate union // https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types -export type Message< - T extends MsgType = MsgType -> = MessageConfig[T]['payload'] extends undefined - ? Readonly<{ - type: T - payload?: MessageConfig[T]['payload'] - }> - : Readonly<{ - type: T - payload: MessageConfig[T]['payload'] - }> +export type Message<T extends MsgType = MsgType> = T extends any + ? MessageConfig[T]['payload'] extends undefined + ? Readonly<{ + type: T + payload?: MessageConfig[T]['payload'] + }> + : Readonly<{ + type: T + payload: MessageConfig[T]['payload'] + }> + : never export type MessageResponse<T extends MsgType> = Readonly< MessageConfig[T]['response']
fix
union hack
bd93b6b98f77c6bc2cd24f3713bf4183b6e5d8fc
2018-03-01 14:14:48
greenkeeper[bot]
chore(package): update html-webpack-plugin to version 3.0.3
false
diff --git a/package.json b/package.json index 1b9f01461..037d761b8 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "fork-ts-checker-webpack-plugin": "^0.4.0", "fs-extra": "^5.0.0", "generate-json-webpack-plugin": "^0.2.2", - "html-webpack-plugin": "3.0.1", + "html-webpack-plugin": "3.0.3", "husky": "^0.14.3", "jest": "^22.0.6", "jest-fetch-mock": "^1.4.0",
chore
update html-webpack-plugin to version 3.0.3
00a035373398b465221426bafd64bf7d764e5741
2018-03-06 15:40:14
greenkeeper[bot]
chore(package): update babel-loader to version 7.1.4
false
diff --git a/package.json b/package.json index 7e85b72fe..dac2bc1cb 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "autoprefixer": "8.1.0", "babel-core": "6.26.0", "babel-jest": "22.4.1", - "babel-loader": "7.1.3", + "babel-loader": "7.1.4", "babel-plugin-lodash": "^3.3.2", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.6.1",
chore
update babel-loader to version 7.1.4
7e75ca1f816d0ba7b5e7220cc1f15e64552edeae
2021-10-17 00:13:26
crimx
refactor: support xhtml tag name
false
diff --git a/src/_helpers/dom.ts b/src/_helpers/dom.ts new file mode 100644 index 00000000..c8d92f76 --- /dev/null +++ b/src/_helpers/dom.ts @@ -0,0 +1,9 @@ +/** + * xhtml returns small case + */ +export function isTagName(node: Node, tagName: string): boolean { + return ( + ((node as HTMLElement).tagName || '').toLowerCase() === + tagName.toLowerCase() + ) +} diff --git a/src/components/Speaker/index.tsx b/src/components/Speaker/index.tsx index ece0c5a2..58bef441 100644 --- a/src/components/Speaker/index.tsx +++ b/src/components/Speaker/index.tsx @@ -7,6 +7,7 @@ import React, { } from 'react' import { useUpdateEffect } from 'react-use' import { timer, reflect } from '@/_helpers/promise-more' +import { isTagName } from '@/_helpers/dom' /** onPlayStart */ const StaticSpeakerContext = React.createContext< @@ -78,7 +79,7 @@ export const StaticSpeakerContainer: FC<StaticSpeakerContainerProps> = props => (e: React.MouseEvent<HTMLDivElement>) => { if ( e.target && - e.target['tagName'] === 'A' && + isTagName(e.target, 'a') && e.target['href'] && e.target['href'] !== '#' && e.target['classList'] && diff --git a/src/components/dictionaries/helpers.ts b/src/components/dictionaries/helpers.ts index 5f4dd805..35c5a8b1 100644 --- a/src/components/dictionaries/helpers.ts +++ b/src/components/dictionaries/helpers.ts @@ -7,6 +7,7 @@ import AxiosMockAdapter from 'axios-mock-adapter' import { DictID, AppConfig } from '@/app-config' import { Profile } from '@/app-config/profiles' import { Word } from '@/_helpers/record-manager' +import { isTagName } from '@/_helpers/dom' /** Fetch and parse dictionary search result */ export interface SearchFunction<Result, Payload = {}> { @@ -188,7 +189,7 @@ export function getHTML( el.setAttribute('src', getFullLink(host!, el, 'src')) } - if (node.tagName === 'A' || node.tagName === 'IMG') { + if (isTagName(node, 'a') || isTagName(node, 'img')) { fillLink(node) } node.querySelectorAll('a').forEach(fillLink) diff --git a/src/content/components/DictItem/DictItem.tsx b/src/content/components/DictItem/DictItem.tsx index d937e3ba..ee97bcf8 100644 --- a/src/content/components/DictItem/DictItem.tsx +++ b/src/content/components/DictItem/DictItem.tsx @@ -17,6 +17,7 @@ import { timer } from '@/_helpers/promise-more' import { ViewPorps } from '@/components/dictionaries/helpers' import { DictItemHead, DictItemHeadProps } from './DictItemHead' import { DictItemBody, DictItemBodyProps } from './DictItemBody' +import { isTagName } from '@/_helpers/dom' const DICT_ITEM_HEAD_HEIGHT = 20 @@ -205,7 +206,7 @@ export const DictItem: FC<DictItemProps> = props => { el && el !== $dictItemRoot; el = el.parentElement ) { - if (el.tagName === 'A' || el.getAttribute('role') === 'link') { + if (isTagName(el, 'a') || el.getAttribute('role') === 'link') { e.preventDefault() e.stopPropagation() diff --git a/src/content/redux/init.ts b/src/content/redux/init.ts index 56849593..ebfccd77 100644 --- a/src/content/redux/init.ts +++ b/src/content/redux/init.ts @@ -14,6 +14,7 @@ import { Word, newWord } from '@/_helpers/record-manager' import { timer } from '@/_helpers/promise-more' import { MessageResponse } from '@/typings/message' import { StoreDispatch, StoreState } from './modules' +import { isTagName } from '@/_helpers/dom' export const init = (dispatch: StoreDispatch, getState: () => StoreState) => { window.addEventListener('resize', () => { @@ -29,7 +30,7 @@ export const init = (dispatch: StoreDispatch, getState: () => StoreState) => { tempDisable: getState().isTempDisabled, unsupported: isStandalonePage() ? false - : document.body.tagName !== 'BODY' + : !isTagName(document.body, 'body') } }) } @@ -59,7 +60,7 @@ export const init = (dispatch: StoreDispatch, getState: () => StoreState) => { tempDisable: state.isTempDisabled, unsupported: isStandalonePage() ? false - : document.body.tagName !== 'BODY' + : !isTagName(document.body, 'body') } }) }, 0) @@ -155,7 +156,7 @@ export const init = (dispatch: StoreDispatch, getState: () => StoreState) => { tempDisable: state.isTempDisabled, unsupported: isStandalonePage() ? false - : document.body.tagName !== 'BODY' + : !isTagName(document.body, 'body') }) } } diff --git a/src/selection/helper.ts b/src/selection/helper.ts index eaba157d..8d1fd578 100644 --- a/src/selection/helper.ts +++ b/src/selection/helper.ts @@ -3,6 +3,7 @@ import { Observable, fromEvent, merge, of } from 'rxjs' import { map, mapTo, filter, distinctUntilChanged } from 'rxjs/operators' import { newWord, Word } from '@/_helpers/record-manager' import { message } from '@/_helpers/browser-api' +import { isTagName } from '@/_helpers/dom' const isMac = /mac/i.test(navigator.platform) @@ -50,8 +51,8 @@ export function isTypeField(element: Node | EventTarget | null): boolean { el = el.parentElement ) { if ( - el.tagName === 'INPUT' || - el.tagName === 'TEXTAREA' || + isTagName(el, 'input') || + isTagName(el, 'textarea') || el.isContentEditable ) { return true diff --git a/src/selection/select-text.ts b/src/selection/select-text.ts index 3613b977..73f938ca 100644 --- a/src/selection/select-text.ts +++ b/src/selection/select-text.ts @@ -31,6 +31,7 @@ import { import { checkSupportedLangs } from '@/_helpers/lang-check' import { Message } from '@/typings/message' import { isTypeField, newSelectionWord } from './helper' +import { isTagName } from '@/_helpers/dom' export function createSelectTextStream(config: AppConfig | null) { if (!config) { @@ -269,7 +270,7 @@ export function useInPanelSelect( el; el = el.parentElement ) { - if (el.tagName === 'A' || el.tagName === 'BUTTON') { + if (isTagName(el, 'a') || isTagName(el, 'button')) { return false } }
refactor
support xhtml tag name
f10353b052de47681f1c92757efb808f7db26551
2019-03-02 19:34:18
CRIMX
refactor(options): add acknowledgement
false
diff --git a/src/_locales/options/messages.json b/src/_locales/options/messages.json index 559ec0a22..55af2dabb 100644 --- a/src/_locales/options/messages.json +++ b/src/_locales/options/messages.json @@ -94,6 +94,11 @@ "zh_CN": "特别鸣谢", "zh_TW": "特別鳴謝" }, + "head_info_acknowledgement_naver": { + "en": "for helping add Naver dict", + "zh_CN": "协助添加 Naver 韩国语词典", + "zh_TW": "協助新增 Naver 韩国语词典" + }, "head_info_acknowledgement_trans_tw": { "en": "for traditional Chinese translation", "zh_CN": "提供部分繁体中文翻译", diff --git a/src/options/components/HeadInfo/index.tsx b/src/options/components/HeadInfo/index.tsx index f7900ebc9..6d9e06b88 100644 --- a/src/options/components/HeadInfo/index.tsx +++ b/src/options/components/HeadInfo/index.tsx @@ -102,6 +102,13 @@ export class OptMenu extends React.PureComponent<{ t: TranslationFunction }, Opt target='_blank' >caerlie</a> {t('opt:head_info_acknowledgement_weblio')} </li> + <li> + <a + href='https://weibo.com/925515171?is_hot=1' + rel='nofollow' + target='_blank' + >Wekey</a> {t('opt:head_info_acknowledgement_naver')} + </li> </ol> </div> )}</CSSTransition>
refactor
add acknowledgement
6e6164eeb9ec1f5eeff80bad3f3b9715a3627447
2020-08-06 20:48:29
crimx
fix(panel): support Super Dark Mode
false
diff --git a/src/content/components/SaladBowl/SaladBowl.shadow.scss b/src/content/components/SaladBowl/SaladBowl.shadow.scss index ce73413cf..7822f6e43 100644 --- a/src/content/components/SaladBowl/SaladBowl.shadow.scss +++ b/src/content/components/SaladBowl/SaladBowl.shadow.scss @@ -28,6 +28,12 @@ $bowl-width: 30px; } } } + + &, + & > svg { + // #947 fix Super Dark Mode + background-color: transparent !important; + } } .saladbowl {
fix
support Super Dark Mode
d0a356f886f33c22f903c1a054fc6bf4bc79250e
2018-06-16 23:43:08
CRIMX
feat(content): broadcast store state
false
diff --git a/src/content/redux/create.ts b/src/content/redux/create.ts index 1f90c76f5..03ff1e41a 100644 --- a/src/content/redux/create.ts +++ b/src/content/redux/create.ts @@ -1,16 +1,19 @@ import { createStore, applyMiddleware, compose } from 'redux' import thunk from 'redux-thunk' -import rootReducer from './modules' +import rootReducer, { StoreState } from './modules' import { startUpAction as configStartUp } from './modules/config' import { startUpAction as selectionStartUp } from './modules/selection' import { startUpAction as widgetStartUp } from './modules/widget' import { startUpAction as dictionariesStartUp } from './modules/dictionaries' +import { message } from '@/_helpers/browser-api' +import { MsgType, MsgIsPinned } from '@/typings/message' + export default () => { const composeEnhancers = window['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'] || compose - const store = createStore( + const store = createStore<StoreState>( rootReducer as any, composeEnhancers(applyMiddleware(thunk)) ) @@ -20,5 +23,15 @@ export default () => { store.dispatch<any>(widgetStartUp()) store.dispatch<any>(dictionariesStartUp()) + // sync state + store.subscribe(() => { + const state = store.getState() + + message.self.send<MsgIsPinned>({ + type: MsgType.IsPinned, + isPinned: state.widget.isPinned, + }) + }) + return store } diff --git a/src/typings/message.ts b/src/typings/message.ts index 7b282f316..21d04f9d3 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -1,5 +1,5 @@ import { SelectionInfo } from '@/_helpers/selection' -import { DictID } from '@/app-config' +import { DictID, AppConfig } from '@/app-config' import { Word, Area as DBArea } from '@/background/database' export const enum MsgType { @@ -8,6 +8,9 @@ export const enum MsgType { /** Default */ Default, + /** is dict panel pinned? */ + IsPinned, + /** Mouse down, selection maybe empty */ Selection, @@ -162,3 +165,8 @@ export interface MsgEditWord { type: MsgType.EditWord word: Word } + +export interface MsgIsPinned { + type: MsgType.IsPinned + isPinned: boolean +}
feat
broadcast store state
aa15eac339a7c880a78095502986f46a7c38f869
2019-01-23 15:57:50
CRIMX
refactor(content): update new options page url
false
diff --git a/src/content/components/WordEditor/index.tsx b/src/content/components/WordEditor/index.tsx index 0bc22e3e3..48ce7ccc9 100644 --- a/src/content/components/WordEditor/index.tsx +++ b/src/content/components/WordEditor/index.tsx @@ -71,7 +71,7 @@ export class WordEditor extends React.PureComponent<WordEditorProps & { t: Trans openOptions = () => { message.send<MsgOpenUrl>({ type: MsgType.OpenURL, - url: 'options.html#opt-notebook', + url: 'options.html?menuselected=Notebook', self: true, }) }
refactor
update new options page url
8948f3ce40596723b01e4da8a0c4afe37f03009c
2018-07-26 13:14:54
CRIMX
feat(selection): minor lang selection
false
diff --git a/src/_helpers/lang-check.ts b/src/_helpers/lang-check.ts index c32fc4b79..8f4a664d3 100644 --- a/src/_helpers/lang-check.ts +++ b/src/_helpers/lang-check.ts @@ -1,5 +1,6 @@ -const testerChinese = /[\u4e00-\u9fa5]/ -const testerEnglish = /[a-zA-Z]/ +export const testerChinese = /[\u4e00-\u9fa5]/ +export const testerEnglish = /[a-zA-Z]/ +export const testerPunct = /^[\s\/\[\]\{\}\$\^\*\+\|\?\.\-~!@#%&()_='";:><,。?!,、;:“ ”﹃﹄「」﹁﹂‘’『』()—[]〔〕【】…-~·‧《》〈〉﹏_]+$/ export function isContainChinese (text: string): boolean { return testerChinese.test(text) @@ -9,7 +10,12 @@ export function isContainEnglish (text: string): boolean { return testerEnglish.test(text) } +export function isAllPunctuation (text: string): boolean { + return testerPunct.test(text) +} + export default { isContainChinese, - isContainEnglish + isContainEnglish, + isAllPunctuation, } diff --git a/src/app-config/dicts.ts b/src/app-config/dicts.ts index 88031bd60..7cdbedf72 100644 --- a/src/app-config/dicts.ts +++ b/src/app-config/dicts.ts @@ -35,6 +35,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: true, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -84,6 +85,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, }, cobuild: { @@ -121,6 +123,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -162,6 +165,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -203,6 +207,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: true, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -244,6 +249,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: true, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -285,6 +291,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: true, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -326,6 +333,7 @@ export function getALlDicts () { selectionLang: { eng: false, chs: true, + minor: true, } }, liangan: { @@ -363,6 +371,7 @@ export function getALlDicts () { selectionLang: { eng: false, chs: true, + minor: true, } }, longman: { @@ -400,6 +409,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -447,6 +457,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -488,6 +499,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -529,6 +541,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -570,6 +583,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, } }, websterlearner: { @@ -607,6 +621,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: false, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -652,6 +667,7 @@ export function getALlDicts () { selectionLang: { eng: true, chs: true, + minor: true, }, /** Optional dict custom options. Can only be boolean or number. */ options: { @@ -698,6 +714,7 @@ export function getALlDicts () { selectionLang: { eng: false, chs: true, + minor: true, } }, } @@ -720,6 +737,7 @@ export function getALlDicts () { selectionLang: { eng: boolean chs: boolean + minor: boolean } options?: { [option: string]: number | boolean diff --git a/src/app-config/index.ts b/src/app-config/index.ts index ec78b0a46..3333ef57a 100644 --- a/src/app-config/index.ts +++ b/src/app-config/index.ts @@ -148,6 +148,7 @@ export interface AppConfigMutable { language: { chinese: boolean english: boolean + minor: boolean } /** auto pronunciation */ @@ -262,7 +263,8 @@ export function appConfigFactory (): AppConfig { language: { chinese: true, - english: true + english: true, + minor: true, }, autopron: { diff --git a/src/app-config/merge-config.ts b/src/app-config/merge-config.ts index e1b6634d2..242b010ab 100644 --- a/src/app-config/merge-config.ts +++ b/src/app-config/merge-config.ts @@ -70,6 +70,7 @@ function mergeHistorical (config: AppConfig, baseConfig?: AppConfig): AppConfig mergeBoolean('language.chinese') mergeBoolean('language.english') + mergeBoolean('language.minor') merge('autopron.cn.dict', id => base.dicts.all[id]) merge('autopron.en.dict', id => base.dicts.all[id]) @@ -89,6 +90,7 @@ function mergeHistorical (config: AppConfig, baseConfig?: AppConfig): AppConfig mergeNumber(`dicts.all.${id}.selectionWC.max`) mergeBoolean(`dicts.all.${id}.selectionLang.eng`) mergeBoolean(`dicts.all.${id}.selectionLang.chs`) + mergeBoolean(`dicts.all.${id}.selectionLang.minor`) if (dict['options']) { forEach(dict['options'], (value, opt) => { if (isNumber(value)) { diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index 88a4c730f..617bd5194 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -4,7 +4,7 @@ import isEqual from 'lodash/isEqual' import { saveWord } from '@/_helpers/record-manager' import { getDefaultSelectionInfo, SelectionInfo, isSameSelection } from '@/_helpers/selection' import { createAppConfigStream } from '@/_helpers/config-manager' -import { isContainChinese, isContainEnglish } from '@/_helpers/lang-check' +import { isContainChinese, isContainEnglish, testerPunct } from '@/_helpers/lang-check' import { MsgType, MsgFetchDictResult } from '@/typings/message' import { StoreState, DispatcherThunk, Dispatcher } from './index' import { isInNotebook } from './widget' @@ -318,16 +318,18 @@ export function searchText (arg?: { id?: DictID, info?: SelectionInfo }): Dispat const toActive: DictID[] = [] selectedDicts.forEach(id => { - const isValidLang = !( - (!allDicts[id].selectionLang.chs && isContainChinese(info.text)) || - (!allDicts[id].selectionLang.eng && isContainEnglish(info.text)) + const { chs, eng, minor } = allDicts[id].selectionLang + let isValidSelection = ( + minor || + chs && isContainChinese(info.text) || + eng && isContainEnglish(info.text) ) - const wordCount = _countWords(info.text) - const { min, max } = allDicts[id].selectionWC - const isValidWordCount = wordCount >= min && wordCount <= max - - const isValidSelection = isValidLang && isValidWordCount + if (isValidSelection) { + const wordCount = info.text.replace(new RegExp(testerPunct, 'g'), '').length + const { min, max } = allDicts[id].selectionWC + isValidSelection = wordCount >= min && wordCount <= max + } if (isValidSelection) { toActive.push(id) @@ -440,13 +442,3 @@ function popupPageInit ( }) } } - -/** Count words in both Chinese and English. */ -function _countWords (text: string): number { - return ( - text - .replace(/\w+/g, '词') - .match(/[\u4e00-\u9fa5]/g) - || [] - ).length -} diff --git a/src/selection/index.ts b/src/selection/index.ts index 4d7870cca..54a268daf 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -1,6 +1,6 @@ import { appConfigFactory, AppConfig } from '@/app-config' import { message } from '@/_helpers/browser-api' -import { isContainChinese, isContainEnglish } from '@/_helpers/lang-check' +import { isContainChinese, isContainEnglish, isAllPunctuation } from '@/_helpers/lang-check' import { createAppConfigStream } from '@/_helpers/config-manager' import * as selection from '@/_helpers/selection' import { MsgType, PostMsgType, PostMsgSelection, MsgSelection, MsgIsPinned } from '@/typings/message' @@ -186,10 +186,12 @@ validMouseup$$.subscribe(event => { } const text = selection.getSelectionText() + const { english, chinese, minor } = config.language if ( text && ( - (config.language.english && isContainEnglish(text) && !isContainChinese(text)) || - (config.language.chinese && isContainChinese(text)) + (english && isContainEnglish(text) && !isContainChinese(text)) || + (chinese && isContainChinese(text)) || + (minor && !isAllPunctuation(text)) ) ) { const context = selection.getSelectionSentence()
feat
minor lang selection
48343cc0e3e5e8c9096e1c7bb4c683e36ce73715
2019-12-28 20:53:26
crimx
refactor: reduce speaker size
false
diff --git a/src/components/Speaker/Speaker.scss b/src/components/Speaker/Speaker.scss index 6b47a22d1..b308aabe0 100644 --- a/src/components/Speaker/Speaker.scss +++ b/src/components/Speaker/Speaker.scss @@ -2,8 +2,8 @@ $speaker-duration: 1s !default; .saladict-Speaker { display: inline-block; - width: 1.2em; - height: 1.2em; + width: 1.1em; + height: 1.1em; text-decoration: none; margin: 0 5px; padding: 0;
refactor
reduce speaker size
c5a4d6d10aab61aabcdd7580279fa2107b4d412e
2018-06-14 16:45:41
CRIMX
fix(panel): fix Firefox popup page delay bug
false
diff --git a/src/content/components/MenuBar/index.tsx b/src/content/components/MenuBar/index.tsx index e3fa1a97f..2b65d2ef8 100644 --- a/src/content/components/MenuBar/index.tsx +++ b/src/content/components/MenuBar/index.tsx @@ -176,7 +176,10 @@ export class MenuBar extends React.PureComponent<MenuBarProps & { t: Translation } componentDidMount () { - this.focusSearchBox() + // Fix Firefox popup page delay bug + setTimeout(() => { + this.focusSearchBox() + }, 10) } componentDidUpdate (prevProps: MenuBarProps) {
fix
fix Firefox popup page delay bug
e8f6ed74cd2d20e12c97f972d629a99bc38ec066
2020-02-11 20:03:07
crimx
docs: add dev guide
false
diff --git a/README.md b/README.md index 6fbe706d7..8546efc10 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,13 @@ Add a `.env` file following the `.env.example` format(leave empty if you don't u yarn build ``` -Artifacts can be found in `build/` +Artifacts can be found in `build/`. -If you want to add a dictionary, follow the [contribution guide](./CONTRIBUTING.md). +## Development -## How can I contribute / ? +See the [contributing guide](./CONTRIBUTING.md). + +## How can I contribute? [CONTRIBUTING.md](./CONTRIBUTING.md)
docs
add dev guide
1d92dacb68856b697a2b54ec7d6fb2f530ec7bb4
2018-04-15 17:19:05
CRIMX
refactor(content): split out dumb component and test container
false
diff --git a/src/content/components/SaladBowl/index.tsx b/src/content/components/SaladBowl/index.tsx index 8beeca123..14bd4e981 100644 --- a/src/content/components/SaladBowl/index.tsx +++ b/src/content/components/SaladBowl/index.tsx @@ -1,84 +1,27 @@ import React from 'react' -import ReactDOM from 'react-dom' -import { Motion, spring, presets, OpaqueConfig } from 'react-motion' +import { Motion, OpaqueConfig } from 'react-motion' -interface SaladBowlProps { - shouldShow: boolean - mouseX: number - mouseY: number +export type SaladBowlProps = { + x: number | OpaqueConfig + y: number | OpaqueConfig + scale: number | OpaqueConfig } -interface SaladBowlState { -} - -export default class SaladBowl extends React.Component<SaladBowlProps, SaladBowlState> { - root = document.body - el = document.createElement('div') - isMount = false - - /** reusable tuple */ - _calcPositionShell: [number, number] = [0, 0] - - calcPosition (mouseX: number, mouseY: number): [number, number] { - // icon position - // +-------+ - // | | - // | | 30px - // 60px +-------+ - // | 30px - // | - // 40px | - // +-------+ - // cursor - const tuple = this._calcPositionShell - tuple[0] = mouseX + 40 + 30 > window.innerWidth ? mouseX - 40 - 30 : mouseX + 40 - tuple[1] = mouseY > 60 ? mouseY - 60 : mouseY + 60 - 30 - return tuple - } - - componentWillUnmount () { - this.root.removeChild(this.el) +const Bowl = params => { + const style = { + transform: `translate3d(${params.x}px, ${params.y}px, 0) scale(${params.scale})` } - renderBowl (pos) { - const style = { - transform: `translate3d(${pos.x}px, ${pos.y}px, 0) scale(${pos.scale})` - } - return ( - <div className='saladict-SaladBowl' style={style}> - <img className='saladict-SaladBowl_Leaf' src={require('@/assets/leaf.svg')} /> - <img className='saladict-SaladBowl_Orange' src={require('@/assets/orange.svg')} /> - <img className='saladict-SaladBowl_Tomato' src={require('@/assets/tomato.svg')} /> - <img className='saladict-SaladBowl_Bowl' src={require('@/assets/bowl.svg')} /> - </div> - ) - } - - render () { - let [x, y]: (number | OpaqueConfig)[] = this.calcPosition(this.props.mouseX, this.props.mouseY) - let scale: number | OpaqueConfig = 0 - - if (this.props.shouldShow) { - if (!this.isMount) { - this.root.appendChild(this.el) - this.isMount = true - scale = spring(1, presets.wobbly) - } else { - // only animate position when the bowl is already visible - x = spring(x, presets.gentle) - y = spring(y, presets.gentle) - scale = 1 - } - } else { - if (this.isMount) { - this.root.removeChild(this.el) - this.isMount = false - } - } + return ( + <div className='saladict-SaladBowl' style={style}> + <img className='saladict-SaladBowl_Leaf' src={require('@/assets/leaf.svg')} /> + <img className='saladict-SaladBowl_Orange' src={require('@/assets/orange.svg')} /> + <img className='saladict-SaladBowl_Tomato' src={require('@/assets/tomato.svg')} /> + <img className='saladict-SaladBowl_Bowl' src={require('@/assets/bowl.svg')} /> + </div> + ) +} - return ReactDOM.createPortal( - <Motion style={{ x, y, scale }}>{this.renderBowl}</Motion>, - this.el, - ) - } +export default function SaladBowl (props) { + return <Motion style={props}>{Bowl}</Motion> } diff --git a/src/content/containers/SaladBowlContainer.tsx b/src/content/containers/SaladBowlContainer.tsx new file mode 100644 index 000000000..4aa9d4a0c --- /dev/null +++ b/src/content/containers/SaladBowlContainer.tsx @@ -0,0 +1,70 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import { spring, presets, OpaqueConfig } from 'react-motion' +import SaladBowl from '../components/SaladBowl' + +interface SaladBowlContainerProps { + shouldShow: boolean + mouseX: number + mouseY: number +} + +export default class SaladBowlContainer extends React.Component<SaladBowlContainerProps, any> { + root = document.body + el = document.createElement('div') + isMount = false + + /** reusable tuple */ + _calcPositionShell: [number, number] = [0, 0] + + calcPosition (mouseX: number, mouseY: number): [number, number] { + // icon position + // +-------+ + // | | + // | | 30px + // 60px +-------+ + // | 30px + // | + // 40px | + // +-------+ + // cursor + const tuple = this._calcPositionShell + tuple[0] = mouseX + 40 + 30 > window.innerWidth ? mouseX - 40 - 30 : mouseX + 40 + tuple[1] = mouseY > 60 ? mouseY - 60 : mouseY + 60 - 30 + return tuple + } + + componentWillUnmount () { + if (this.el) { + this.root.removeChild(this.el) + } + } + + render () { + let [x, y]: (number | OpaqueConfig)[] = this.calcPosition(this.props.mouseX, this.props.mouseY) + let scale: number | OpaqueConfig = 0 + + if (this.props.shouldShow) { + if (!this.isMount) { + this.root.appendChild(this.el) + this.isMount = true + scale = spring(1, presets.wobbly) + } else { + // only animate position when the bowl is already visible + x = spring(x, presets.gentle) + y = spring(y, presets.gentle) + scale = 1 + } + } else { + if (this.isMount) { + this.root.removeChild(this.el) + this.isMount = false + } + } + + return ReactDOM.createPortal( + React.createElement(SaladBowl, { x, y, scale }), + this.el, + ) + } +} diff --git a/test/specs/components/content/SaladBowlContainer.tsx b/test/specs/components/content/SaladBowlContainer.tsx new file mode 100644 index 000000000..4013c8d3f --- /dev/null +++ b/test/specs/components/content/SaladBowlContainer.tsx @@ -0,0 +1,55 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import { shallow, mount, render } from 'enzyme' +import SaladBowlContainer from '@/content/containers/SaladBowlContainer' +import Motion from 'react-motion' + +jest.mock('react-dom') +const createPortal = ReactDOM.createPortal as jest.Mock<typeof ReactDOM.createPortal> + +describe('Component/content/SaladBowl', () => { + beforeEach(() => { + browser.flush() + createPortal.mockClear() + }) + + it('should pop in', () => { + const props = { + shouldShow: true, + mouseX: 0, + mouseY: 0, + } + const portalBowl = shallow(<SaladBowlContainer {...props} />) + + expect(createPortal).toHaveBeenCalledTimes(1) + + const bowlProps = createPortal.mock.calls[0][0].props + expect(bowlProps.x).toBeGreaterThan(0) + expect(bowlProps.y).toBeGreaterThan(0) + expect(bowlProps.scale.val).toBe(1) + }) + + it('should always within viewport', () => { + const props = { + shouldShow: true, + mouseX: 0, + mouseY: 0, + } + const portalBowl = shallow(<SaladBowlContainer {...props} />) + + portalBowl.setProps({ shouldShow: true, mouseX: window.innerWidth, mouseY: 0 }) + portalBowl.setProps({ shouldShow: true, mouseX: window.innerWidth, mouseY: window.innerHeight }) + portalBowl.setProps({ shouldShow: true, mouseX: 0, mouseY: window.innerHeight }) + + expect(createPortal).toHaveBeenCalledTimes(4) + + for (let i = 1; i < 4; i++) { + const bowlProps = createPortal.mock.calls[i][0].props + expect(bowlProps.x.val).toBeGreaterThan(0) + expect(bowlProps.x.val).toBeLessThan(window.innerWidth) + expect(bowlProps.y.val).toBeGreaterThan(0) + expect(bowlProps.y.val).toBeLessThan(window.innerHeight) + expect(bowlProps.scale).toBe(1) + } + }) +})
refactor
split out dumb component and test container
c3a2ffcf5369f87f661e0c7fa41b98b21dcdc1bd
2019-05-11 20:57:53
CRIMX
refactor: add back daily profile locale
false
diff --git a/src/_locales/config-profiles/messages.json b/src/_locales/config-profiles/messages.json index 046a58512..6d74375b0 100644 --- a/src/_locales/config-profiles/messages.json +++ b/src/_locales/config-profiles/messages.json @@ -1,4 +1,9 @@ { + "daily": { + "en": "Daily Mode", + "zh_CN": "日常模式", + "zh_TW": "日常模式" + }, "sentence": { "en": "Sentence Mode", "zh_CN": "句库模式",
refactor
add back daily profile locale
72bd590eb5732b0b70b3b361e60bbadf237c05aa
2019-09-07 23:16:37
crimx
fix(manifest): new assets path
false
diff --git a/src/manifest/common.manifest.json b/src/manifest/common.manifest.json index 751ec0350..eefe3dc0e 100644 --- a/src/manifest/common.manifest.json +++ b/src/manifest/common.manifest.json @@ -12,9 +12,9 @@ "default_locale": "zh_CN", "icons": { - "16": "static/icon-16.png", - "48": "static/icon-48.png", - "128": "static/icon-128.png" + "16": "assets/icon-16.png", + "48": "assets/icon-48.png", + "128": "assets/icon-128.png" }, "commands": { @@ -38,9 +38,7 @@ } }, - "web_accessible_resources": [ - "assets/*" - ], + "web_accessible_resources": ["assets/*"], "permissions": [ "<all_urls>", @@ -56,10 +54,7 @@ "webRequestBlocking" ], - "optional_permissions": [ - "clipboardWrite" - ], + "optional_permissions": ["clipboardWrite"], "content_security_policy": "script-src 'self' 'unsafe-eval' https://www.google-analytics.com; object-src 'self'" - }
fix
new assets path
63108c78a2e0aeaf1b6ad662f3234b8a79663f5e
2019-09-28 17:12:45
crimx
refactor(options): update description
false
diff --git a/src/_locales/en/options.ts b/src/_locales/en/options.ts index 19176db87..d3b85b7ef 100644 --- a/src/_locales/en/options.ts +++ b/src/_locales/en/options.ts @@ -104,9 +104,8 @@ export const locale: typeof _locale = { reset: 'Reset Configs', reset_confirm: 'Reset to default settings. Confirm?' }, - context_description: - 'Integration efforts are mostly made to 有道网页翻译, which has been deserted for years, to let it support https web pages. Other page translation extensions such as Google Translate and Lingocloud Interpreter are available in Web Store.', - context_menus_title: 'Add Context Menus Item', + context_description: 'Each context menus item can also be customized.', + context_menus_title: 'Add Context Menus Items', context_menus_add_rules: 'URL with %s in place of query.', ctx_trans: 'Context Translate Engines', ctx_trans_help: @@ -115,7 +114,7 @@ export const locale: typeof _locale = { dictPanel: { custom_css: 'Custom Dict Panel Styles', custom_css_help: - 'Add Custom CSS for Dict Panel. Should use `.saladict-DictPanel` as root', + 'Custom CSS. For Dict Panel use .dictPanel-Root as root. For dictionaries use .dictRoot or .d-{id} as root', font_size: 'Font size for search reasults', height_ratio: 'Panel max height ratio', width: 'Panel width' @@ -178,7 +177,7 @@ export const locale: typeof _locale = { syncWebdav: 'WebDAV Sync Service', waveform: 'Waveform Control', waveform_help: - 'Display Waveform Control Panel which may have impact on performance. Audio files can still be played if turned off.' + 'Display a button at the bottom of the Dict Panel for expanding the Waveform Control Panel. Audio files can still be played if turned off.' }, quickSearch: { diff --git a/src/_locales/zh-CN/options.ts b/src/_locales/zh-CN/options.ts index dd051ab68..34ea0101a 100644 --- a/src/_locales/zh-CN/options.ts +++ b/src/_locales/zh-CN/options.ts @@ -97,8 +97,7 @@ export const locale = { reset: '重置设定', reset_confirm: '所有设定将还原到默认值,确定?' }, - context_description: - '有道网页翻译已经多年没有更新,我做了些维护,将其内置到 Saladict 并支持 https 网页,其它网页翻译扩展可以安装 Google 翻译和彩云小译。', + context_description: '设置右键菜单,可添加可自定义链接。', context_menus_title: '添加右键菜单项目', context_menus_add_rules: '链接中的 %s 会被替换为选词。', ctx_trans: '上下文翻译引擎', @@ -107,7 +106,7 @@ export const locale = { dictPanel: { custom_css: '自定义查词面板样式', custom_css_help: - '为查词面板添加自定义 CSS 。请使用 .saladict-DictPanel 作为根。', + '为查词面板添加自定义 CSS 。词典面板使用 .dictPanel-Root 作为根,词典使用 .dictRoot 或者 .d-词典ID 作为根。', font_size: '词典内容字体大小', height_ratio: '查词面板最高占屏幕比例', width: '查词面板宽度' @@ -167,9 +166,9 @@ export const locale = { }, syncShanbay: '添加扇贝生词本同步', syncWebdav: '添加 WebDAV 同步', - waveform: '波形控制', + waveform: '波形控制按钮', waveform_help: - '显示音频波形控制面板。关闭依然可以播放音频,并减少性能消耗。' + '在词典面板下方显示音频控制面板展开按钮。关闭依然可以播放音频。' }, quickSearch: { diff --git a/src/_locales/zh-TW/options.ts b/src/_locales/zh-TW/options.ts index 38b39838d..7dd649170 100644 --- a/src/_locales/zh-TW/options.ts +++ b/src/_locales/zh-TW/options.ts @@ -99,8 +99,7 @@ export const locale: typeof _locale = { reset: '重設設定', reset_confirm: '所有設定將還原至預設值,確定?' }, - context_description: - '有道網頁翻譯已經多年沒有更新,我做了些維護,將其內建到 Saladict 並支援 https 網頁,其它網頁翻譯擴充套件可以安裝 Google 翻譯和彩雲小譯。', + context_description: '設定右鍵選單,可新增可自定義連結。', context_menus_title: '新增右鍵選單項目', context_menus_add_rules: '連結中的 %s 會被取代為選詞。', ctx_trans: '上下文翻譯引擎', @@ -109,7 +108,7 @@ export const locale: typeof _locale = { dictPanel: { custom_css: '自訂查字介面樣式', custom_css_help: - '為查字介面自訂 CSS 。請使用 .saladict-DictPanel 作為根。', + '為查詞面板新增自定義 CSS 。詞典面板使用 .dictPanel-Root 作為根,詞典使用 .dictRoot 或者 .d-詞典ID 作為根。', font_size: '字典內容字型大小', height_ratio: '字典介面最高占螢幕高度比例', width: '查字典介面寬度' @@ -171,7 +170,7 @@ export const locale: typeof _locale = { syncWebdav: '新增 WebDAV 同步', waveform: '波形控制', waveform_help: - '顯示音訊波形控制面板。關閉依然可以播放音訊,并減少效能消耗。' + '在字典介面下方顯示音訊控制面板展開按鈕。關閉依然可以播放音訊。' }, quickSearch: { diff --git a/src/options/components/options/DictPanel/index.tsx b/src/options/components/options/DictPanel/index.tsx index 7a16754f8..dc3abdeaa 100644 --- a/src/options/components/options/DictPanel/index.tsx +++ b/src/options/components/options/DictPanel/index.tsx @@ -114,7 +114,7 @@ export class DictPanel extends React.Component<DictPanelProps> { initialValue: config.panelCSS })( <Input.TextArea - placeholder=".saladict-DictPanel .panel-DictContainer { }" + placeholder=".dictPanel-Root { }" autosize={{ minRows: 4, maxRows: 15 }} /> )}
refactor
update description
bbbe0a10a6def4608ff850e849005997abb37ad6
2020-08-30 13:51:23
crimx
fix(dicts): add google tts
false
diff --git a/src/components/dictionaries/googledict/_style.shadow.scss b/src/components/dictionaries/googledict/_style.shadow.scss index b64f1f947..9621d780a 100644 --- a/src/components/dictionaries/googledict/_style.shadow.scss +++ b/src/components/dictionaries/googledict/_style.shadow.scss @@ -71,3 +71,7 @@ img { .pgRvse { padding-top: 0 !important; } + +.SDZsVb { + color: #f9690e !important; +} diff --git a/src/components/dictionaries/googledict/engine.ts b/src/components/dictionaries/googledict/engine.ts index e0b200dfb..170c6ae88 100644 --- a/src/components/dictionaries/googledict/engine.ts +++ b/src/components/dictionaries/googledict/engine.ts @@ -55,92 +55,97 @@ export const search: SearchFunction<GoogleDictResult> = async ( .catch(handleNetWorkError) .then(handleDOM) } -} -function handleDOM( - bodyText: string -): GoogleDictSearchResult | Promise<GoogleDictSearchResult> { - const doc = new DOMParser().parseFromString(bodyText, 'text/html') + function handleDOM( + bodyText: string + ): GoogleDictSearchResult | Promise<GoogleDictSearchResult> { + const doc = new DOMParser().parseFromString(bodyText, 'text/html') - // mend fragments - extFragements(bodyText).forEach(({ id, innerHTML }) => { - const el = doc.querySelector(`#${id}`) - if (el) { - el.innerHTML = innerHTML - } - }) - - const $obcontainer = doc.querySelector('.lr_container') - if ($obcontainer) { - $obcontainer.querySelectorAll<HTMLDivElement>('.vkc_np').forEach($block => { - if ( - $block.querySelector('.zbA8Me') || // Dictionary title - $block.querySelector('#dw-siw') || // Search box - $block.querySelector('#tl_select') // Translate to - ) { - $block.remove() + // mend fragments + extFragements(bodyText).forEach(({ id, innerHTML }) => { + const el = doc.querySelector(`#${id}`) + if (el) { + el.innerHTML = innerHTML } }) - removeChildren($obcontainer, '.lr_dct_trns_h') // other Translate to blocks - removeChildren($obcontainer, '.S5TwIf') // Learn to pronounce - removeChildren($obcontainer, '.VZVCid') // From Oxford - removeChildren($obcontainer, '.u7XA4b') // footer - removeChild($obcontainer, '[jsname=L4Nn5e]') // remove translate to - - // tts - $obcontainer.querySelectorAll('audio').forEach($audio => { - const $source = $audio.querySelector('source') - if ($source) { - const src = getFullLink('https://ssl.gstatic.com', $source, 'src') - if (src) { - $audio.replaceWith(getStaticSpeaker(src)) - return + const $obcontainer = doc.querySelector('.lr_container') + if ($obcontainer) { + $obcontainer + .querySelectorAll<HTMLDivElement>('.vkc_np') + .forEach($block => { + if ( + $block.querySelector('.zbA8Me') || // Dictionary title + $block.querySelector('#dw-siw') || // Search box + $block.querySelector('#tl_select') // Translate to + ) { + $block.remove() + } + }) + + removeChildren($obcontainer, '.lr_dct_trns_h') // other Translate to blocks + removeChildren($obcontainer, '.S5TwIf') // Learn to pronounce + removeChildren($obcontainer, '.VZVCid') // From Oxford + removeChildren($obcontainer, '.u7XA4b') // footer + removeChild($obcontainer, '[jsname=L4Nn5e]') // remove translate to + + // tts + $obcontainer.querySelectorAll('audio').forEach($audio => { + const $source = $audio.querySelector('source') + + let src = + $source && getFullLink('https://ssl.gstatic.com', $source, 'src') + + if (!src) { + src = + 'https://www.google.com/speech-api/v1/synthesize?enc=mpeg&lang=zh-cn&speed=0.4&client=lr-language-tts&use_google_only_voices=1&text=' + + encodeURIComponent(text) } - } - $audio.remove() - }) - $obcontainer - .querySelectorAll('[role=listitem] > [jsname=F457ec]') - .forEach($word => { - // let saladict jump into the words - $word.innerHTML = `<a>${getText($word)}</a>` - // always appeared available - $word.removeAttribute('style') - $word.classList.add('MR2UAc') - $word.classList.add('I6a0ee') - $word.classList.remove('cO53qb') + $audio.replaceWith(getStaticSpeaker(src)) }) - $obcontainer.querySelectorAll('g-img > img').forEach($img => { - const src = $img.getAttribute('title') - if (src) { - $img.setAttribute('src', src) - } - }) + $obcontainer + .querySelectorAll('[role=listitem] > [jsname=F457ec]') + .forEach($word => { + // let saladict jump into the words + $word.innerHTML = `<a>${getText($word)}</a>` + // always appeared available + $word.removeAttribute('style') + $word.classList.add('MR2UAc') + $word.classList.add('I6a0ee') + $word.classList.remove('cO53qb') + }) + + $obcontainer.querySelectorAll('g-img > img').forEach($img => { + const src = $img.getAttribute('title') + if (src) { + $img.setAttribute('src', src) + } + }) - const cleanText = getInnerHTML('https://www.google.com', $obcontainer, { - config: { - ADD_TAGS: ['g-img'], - ADD_ATTR: ['jsname', 'jsaction'] - } - }) - .replace(/synonyms:/g, 'syn:') - .replace(/antonyms:/g, 'ant:') - - const styles: string[] = [] - doc.querySelectorAll('style').forEach($style => { - const textContent = getText($style) - if (textContent && /\.xpdxpnd|\.lr_container/.test(textContent)) { - styles.push(textContent) - } - }) + const cleanText = getInnerHTML('https://www.google.com', $obcontainer, { + config: { + ADD_TAGS: ['g-img'], + ADD_ATTR: ['jsname', 'jsaction'] + } + }) + .replace(/synonyms:/g, 'syn:') + .replace(/antonyms:/g, 'ant:') + + const styles: string[] = [] + doc.querySelectorAll('style').forEach($style => { + const textContent = getText($style) + if (textContent && /\.xpdxpnd|\.lr_container/.test(textContent)) { + styles.push(textContent) + } + }) - return { result: { entry: cleanText, styles } } - } + return { result: { entry: cleanText, styles } } + } - return handleNoResult<GoogleDictSearchResult>() + return handleNoResult<GoogleDictSearchResult>() + } } function extFragements(text: string): Array<{ id: string; innerHTML: string }> {
fix
add google tts
49ccc81a68a87217573a2ed6110de637493543f7
2019-06-15 18:05:00
CRIMX
refactor: disable waveform by default
false
diff --git a/src/app-config/profiles.ts b/src/app-config/profiles.ts index 49691cf6d..62d71f6fb 100644 --- a/src/app-config/profiles.ts +++ b/src/app-config/profiles.ts @@ -26,7 +26,7 @@ export function _getDefaultProfile (id?: string) { mtaAutoUnfold: '' as MtaAutoUnfold, /** show waveform control panel */ - waveform: true, + waveform: false, dicts: { /** default selected dictionaries */
refactor
disable waveform by default
0d0de6602dd38809f921d260bf6251b0a71c33e9
2019-01-23 23:00:19
CRIMX
refactor: mv svg icons
false
diff --git a/public/static/symbol-defs.svg b/src/assets/symbol-defs.svg similarity index 100% rename from public/static/symbol-defs.svg rename to src/assets/symbol-defs.svg diff --git a/src/options/components/SocialMedia/index.tsx b/src/options/components/SocialMedia/index.tsx index f9f72e095..c7aecb599 100644 --- a/src/options/components/SocialMedia/index.tsx +++ b/src/options/components/SocialMedia/index.tsx @@ -34,7 +34,10 @@ export const SocialMedia = () => ( <li key={media.title} className='social-media__icon'> <a href={media.url} title={media.title} target='_blank' rel='noopener'></a> <svg> - <use xlinkHref={'./static/symbol-defs.svg%23' + media.icon} xmlnsXlink='http://www.w3.org/1999/xlink'></use> + <use + xlinkHref={require('@/assets/symbol-defs.svg') + '#' + media.icon} + xmlnsXlink='http://www.w3.org/1999/xlink' + ></use> </svg> </li> ))}
refactor
mv svg icons
8c3fe405829797757da99d062f694e7e566b6ca4
2021-08-21 14:21:54
dependabot[bot]
build(deps): bump path-parse from 1.0.6 to 1.0.7 (#1433)
false
diff --git a/yarn.lock b/yarn.lock index c9bdfd85..e59322b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11281,9 +11281,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== [email protected]: version "0.1.7"
build
bump path-parse from 1.0.6 to 1.0.7 (#1433)
16150f3c077242ee0f0ecec9deec35f9f2aa20b9
2019-09-13 13:34:59
crimx
refactor(background): inject panel on install
false
diff --git a/src/background/initialization.ts b/src/background/initialization.ts index ddc2af0df..6e6aaa68d 100644 --- a/src/background/initialization.ts +++ b/src/background/initialization.ts @@ -113,13 +113,6 @@ async function onInstalled({ ) storage.sync.set({ hasInstructionsShown: true }) } - ;(await browser.tabs.query({})).forEach(async tab => { - try { - await injectDictPanel(tab) - } catch (e) { - console.warn(e) - } - }) } else if (reason === 'update') { let data: UpdateData | undefined if (!process.env.DEV_BUILD) { @@ -149,6 +142,14 @@ async function onInstalled({ } } } + + ;(await browser.tabs.query({})).forEach(async tab => { + try { + await injectDictPanel(tab) + } catch (e) { + console.warn(e) + } + }) } function onStartup(): void {
refactor
inject panel on install
0c30af39ff4f92bc791183e4d3c1352e16e6fff4
2018-10-07 14:57:37
CRIMX
refactor(panel): search when history changes
false
diff --git a/src/content/components/MenuBar/index.tsx b/src/content/components/MenuBar/index.tsx index dd7a83af6..f9c4c8aaf 100644 --- a/src/content/components/MenuBar/index.tsx +++ b/src/content/components/MenuBar/index.tsx @@ -12,7 +12,7 @@ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ export interface MenuBarDispatchers { readonly handleDragAreaMouseDown: (e: React.MouseEvent<HTMLDivElement>) => any readonly handleDragAreaTouchStart: (e: React.TouchEvent<HTMLDivElement>) => any - readonly searchText: (arg: { info: SelectionInfo }) => any + readonly searchText: (arg?: { info: SelectionInfo }) => any readonly requestFavWord: () => any readonly shareImg: () => any readonly panelPinSwitch: () => any @@ -67,6 +67,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt index, text: this.props.searchHistory[index].text }) + this.props.searchText() } /** next search history */ @@ -78,6 +79,7 @@ export default class MenuBar extends React.PureComponent<MenuBarProps, MenuBarSt index, text: this.props.searchHistory[index].text }) + this.props.searchText() } handleSearchBoxInput = (e: React.ChangeEvent<HTMLInputElement>) => { diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index 6c904dbb5..46c861f1c 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -69,6 +69,7 @@ export type DictionariesState = { readonly dicts: { readonly [k in DictID]?: DictState } + // 0 is the latest readonly searchHistory: SelectionInfo[] } } @@ -145,8 +146,10 @@ export const reducer: DictsReducer = { } }, [ActionType.SEARCH_START] (state, { toStart, toOnhold, toActive, info }) { - const { dictionaries } = state - const history = dictionaries.searchHistory + const { dictionaries, widget } = state + const history = widget.searchBoxIndex > 0 + ? dictionaries.searchHistory.slice(widget.searchBoxIndex) + : dictionaries.searchHistory const dicts = { ...dictionaries.dicts } toOnhold.forEach(id => { @@ -275,9 +278,10 @@ export function searchText ( ): DispatcherThunk { return (dispatch, getState) => { const state = getState() + const searchBoxIndex = state.widget.searchBoxIndex || 0 const info = arg - ? arg.info || state.dictionaries.searchHistory[0] - : state.dictionaries.searchHistory[0] + ? arg.info || state.dictionaries.searchHistory[searchBoxIndex] + : state.dictionaries.searchHistory[searchBoxIndex] // try to unfold a dict when the panel first popup if (!info || !info.text) { return } @@ -297,8 +301,6 @@ export function searchText ( return } - dispatch(searchBoxUpdate({ text: info.text, index: 0 })) - // and those who don't match the selection language const { selected: selectedDicts, all: allDicts } = state.config.dicts const toStart: DictID[] = [] @@ -343,6 +345,8 @@ export function searchText ( } dispatch(searchStart({ toStart, toOnhold, toActive, info })) + // After search start. Index is useful. + dispatch(searchBoxUpdate({ text: info.text, index: 0 })) toStart.forEach(doSearch)
refactor
search when history changes
d65ffb8e7cb4b5238641b14afcffc04f3a302392
2018-02-10 20:31:26
greenkeeperio-bot
chore(package): update lockfile
false
diff --git a/yarn.lock b/yarn.lock index 429bd20f6..804d06681 100644 --- a/yarn.lock +++ b/yarn.lock @@ -222,10 +222,14 @@ [email protected], address@^1.0.1: version "1.0.3" resolved "https://registry.npmjs.org/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9" -ajv-keywords@^2.0.0, ajv-keywords@^2.1.0: +ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" +ajv-keywords@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be" + ajv@^4.9.1: version "4.11.8" resolved "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" @@ -233,7 +237,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5: +ajv@^5.0.0, ajv@^5.1.0: version "5.5.2" resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -242,6 +246,14 @@ ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" +ajv@^6.1.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.1.1.tgz#978d597fbc2b7d0e5a5c3ddeb149a682f2abfa0e" + dependencies: + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -8340,14 +8352,14 @@ webpack-sources@^1.0.1, webpack-sources@^1.1.0: source-list-map "^2.0.0" source-map "~0.6.1" [email protected]: - version "3.10.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-3.10.0.tgz#5291b875078cf2abf42bdd23afe3f8f96c17d725" [email protected]: + version "3.11.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.11.0.tgz#77da451b1d7b4b117adaf41a1a93b5742f24d894" dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" - ajv "^5.1.5" - ajv-keywords "^2.0.0" + ajv "^6.1.0" + ajv-keywords "^3.1.0" async "^2.1.2" enhanced-resolve "^3.4.0" escope "^3.6.0"
chore
update lockfile
6080d3705af8772afdef0eb765cfe4f95f0ab919
2019-08-04 10:32:32
crimx
refactor(dicts): eudic
false
diff --git a/src/components/dictionaries/eudic/View.tsx b/src/components/dictionaries/eudic/View.tsx index 954f2544b..50e582a61 100644 --- a/src/components/dictionaries/eudic/View.tsx +++ b/src/components/dictionaries/eudic/View.tsx @@ -1,24 +1,22 @@ -import React from 'react' +import React, { FC } from 'react' import { EudicResult } from './engine' import Speaker from '@/components/Speaker' import { ViewPorps } from '@/components/dictionaries/helpers' -export default class DictEudic extends React.PureComponent<ViewPorps<EudicResult>> { - render () { - return ( - <ul className='dictEudic-List'> - {this.props.result.map(item => ( - <li key={item.chs} className='dictEudic-Item'> - <p>{item.eng} <Speaker src={item.mp3} /></p> - <p>{item.chs}</p> - <footer> - {item.channel && - <p className='dictEudic-Channel'>{item.channel}</p> - } - </footer> - </li> - ))} - </ul> - ) - } -} +export const DictEudic: FC<ViewPorps<EudicResult>> = ({ result }) => ( + <ul className="dictEudic-List"> + {result.map(item => ( + <li key={item.chs} className="dictEudic-Item"> + <p> + {item.eng} <Speaker src={item.mp3} /> + </p> + <p>{item.chs}</p> + <footer> + {item.channel && <p className="dictEudic-Channel">{item.channel}</p>} + </footer> + </li> + ))} + </ul> +) + +export default DictEudic diff --git a/src/components/dictionaries/eudic/_style.scss b/src/components/dictionaries/eudic/_style.shadow.scss similarity index 53% rename from src/components/dictionaries/eudic/_style.scss rename to src/components/dictionaries/eudic/_style.shadow.scss index 1c39695bc..932edbbd4 100644 --- a/src/components/dictionaries/eudic/_style.scss +++ b/src/components/dictionaries/eudic/_style.shadow.scss @@ -1,3 +1,6 @@ +@import '@/_sass_global/_reset.scss'; +@import '@/components/Speaker/Speaker.scss'; + .dictEudic-Item { margin-bottom: 10px; @@ -10,10 +13,10 @@ color: #999; &::before { - content: '《' + content: '《'; } &::after { - content: '》' + content: '》'; } } diff --git a/src/components/dictionaries/eudic/engine.ts b/src/components/dictionaries/eudic/engine.ts index 2abbdc903..fd723a092 100644 --- a/src/components/dictionaries/eudic/engine.ts +++ b/src/components/dictionaries/eudic/engine.ts @@ -5,10 +5,10 @@ import { handleNetWorkError, SearchFunction, GetSrcPageFunction, + DictSearchResult } from '../helpers' -import { DictSearchResult } from '@/typings/server' -export const getSrcPage: GetSrcPageFunction = (text) => { +export const getSrcPage: GetSrcPageFunction = text => { return `https://dict.eudic.net/dicts/en/${text}` } @@ -23,27 +23,34 @@ export type EudicResult = EudicResultItem[] type EudicSearchResult = DictSearchResult<EudicResult> -export const search: SearchFunction<EudicSearchResult> = ( - text, config, profile, payload +export const search: SearchFunction<EudicResult> = ( + text, + config, + profile, + payload ) => { - text = encodeURIComponent(text.split(/\s+/).slice(0, 2).join(' ')) + text = encodeURIComponent( + text + .split(/\s+/) + .slice(0, 2) + .join(' ') + ) const options = profile.dicts.all.eudic.options - return fetchDirtyDOM( - 'https://dict.eudic.net/dicts/en/' + text, - { credentials: 'omit' }, - ) + return fetchDirtyDOM('https://dict.eudic.net/dicts/en/' + text, { + withCredentials: false + }) .catch(handleNetWorkError) .then(validator) .then(doc => handleDOM(doc, options)) } -function handleDOM ( +function handleDOM( doc: Document, - { resultnum }: { resultnum: number }, + { resultnum }: { resultnum: number } ): EudicSearchResult | Promise<EudicSearchResult> { const result: EudicResult = [] - const audio: { uk?: string, us?: string } = {} + const audio: { uk?: string; us?: string } = {} const $items = Array.from(doc.querySelectorAll('#lj_ting .lj_item')) for (let i = 0; i < $items.length && result.length < resultnum; i++) { @@ -51,16 +58,23 @@ function handleDOM ( const item: EudicResultItem = { chs: '', eng: '' } item.chs = getText($item, '.exp') - if (!item.chs) { continue } + if (!item.chs) { + continue + } item.eng = getText($item, '.line') - if (!item.eng) { continue } + if (!item.eng) { + continue + } item.channel = getText($item, '.channel_title') const audioID = $item.getAttribute('source') if (audioID) { - const mp3 = 'https://fs-gateway.eudic.net/store_main/sentencemp3/' + audioID + '.mp3' + const mp3 = + 'https://fs-gateway.eudic.net/store_main/sentencemp3/' + + audioID + + '.mp3' item.mp3 = mp3 if (!audio.us) { audio.us = mp3 @@ -78,23 +92,22 @@ function handleDOM ( return handleNoResult() } -function validator (doc: Document): Document | Promise<Document> { +function validator(doc: Document): Document | Promise<Document> { if (doc.querySelector('#TingLiju')) { return doc } const status = doc.querySelector('#page-status') as HTMLInputElement - if (!status || !status.value) { return handleNoResult() } + if (!status || !status.value) { + return handleNoResult() + } const formData = new FormData() formData.append('status', status.value) - return fetchDirtyDOM( - 'https://dict.eudic.net/Dicts/en/tab-detail/-12', - { - method: 'POST', - body: formData, - credentials: 'omit', - } - ) + return fetchDirtyDOM('https://dict.eudic.net/Dicts/en/tab-detail/-12', { + method: 'POST', + data: formData, + withCredentials: false + }) } diff --git a/test/specs/components/dictionaries/eudic/requests.mock.ts b/test/specs/components/dictionaries/eudic/requests.mock.ts new file mode 100644 index 000000000..57578e8b5 --- /dev/null +++ b/test/specs/components/dictionaries/eudic/requests.mock.ts @@ -0,0 +1,16 @@ +import { MockRequest } from '@/components/dictionaries/helpers' + +export const mockSearchTexts = ['love'] + +export const mockRequest: MockRequest = mock => { + mock.onAny(/eudic/).reply(info => { + const file = /tab-detail/.test(info.url || '') ? 'sentences' : 'love' + return [ + 200, + new DOMParser().parseFromString( + require(`raw-loader!./response/${file}.html`).default, + 'text/html' + ) + ] + }) +}
refactor
eudic
3202c22afd76d41e46d49f24a7e6b1a62cf93cd5
2018-06-05 14:18:42
CRIMX
refactor(content): panel back to position before word editor #116
false
diff --git a/src/content/components/WordEditor/index.tsx b/src/content/components/WordEditor/index.tsx index 771285173..da10ab96b 100644 --- a/src/content/components/WordEditor/index.tsx +++ b/src/content/components/WordEditor/index.tsx @@ -29,12 +29,12 @@ export class WordEditor extends React.PureComponent<WordEditorProps & { t: Trans super(props) const winWidth = window.innerWidth - const width = Math.min(800, Math.max(600, winWidth - props.dictPanelWidth - 100)) + const width = Math.min(800, Math.max(400, winWidth - props.dictPanelWidth - 100)) const preferredLeft = props.dictPanelWidth + 60 const currentLeft = (winWidth - width) / 2 let leftOffset = preferredLeft - currentLeft if (preferredLeft + width / 2 >= winWidth) { - // not enough space, close dict panel and mvoe to the left + // not enough space, close dict panel and move to the left leftOffset = 10 - currentLeft this.props.closeDictPanel() } diff --git a/src/content/redux/modules/widget.ts b/src/content/redux/modules/widget.ts index bcfe3bba9..f94ddd96a 100644 --- a/src/content/redux/modules/widget.ts +++ b/src/content/redux/modules/widget.ts @@ -69,6 +69,12 @@ export type WidgetState = { y: number }, readonly shouldWordEditorShow: boolean + readonly panelStateBeforeWordEditor: { + x: number + y: number + isPinned: boolean + shouldPanelShow: boolean + } } } @@ -100,6 +106,12 @@ export const initState: WidgetState = { y: 0, }, shouldWordEditorShow: false, + panelStateBeforeWordEditor: { + x: 0, + y: 0, + isPinned: false, + shouldPanelShow: false, + }, } } @@ -255,19 +267,42 @@ export const reducer: WidgetReducer = { widget: { ...state.widget, shouldWordEditorShow: shouldWordEditorShow, - isPinned: shouldWordEditorShow, - shouldPanelShow: shouldWordEditorShow, } } if (shouldWordEditorShow) { - const { width, height } = state.widget.panelRect + const { panelRect, isPinned, shouldPanelShow } = state.widget + const { x, y, width, height } = panelRect + newState.widget.panelStateBeforeWordEditor = { + x, y, + isPinned, + shouldPanelShow, + } + + newState.widget.isPinned = true + newState.widget.shouldPanelShow = true newState.widget.panelRect = _reconcilePanelRect( 40, (1 - state.config.panelMaxHeightRatio) * window.innerHeight / 2, width, height, ) + } else { + // Resume cords + const { width, height } = state.widget.panelRect + const { x, y, isPinned, shouldPanelShow } = state.widget.panelStateBeforeWordEditor + + // User might close the panel during word editor page. Keep it closed. + newState.widget.shouldPanelShow = shouldPanelShow && state.widget.shouldPanelShow + if (newState.widget.shouldPanelShow) { + newState.widget.isPinned = isPinned + newState.widget.panelRect = _reconcilePanelRect( + x, + y, + width, + height, + ) + } } return newState @@ -635,7 +670,6 @@ function _restoreWidget (widget: WidgetState['widget']): Mutable<WidgetState['wi isPinned: isSaladictOptionsPage, shouldPanelShow: isSaladictPopupPage || isSaladictOptionsPage, shouldBowlShow: false, - shouldWordEditorShow: false, } }
refactor
panel back to position before word editor #116
4073f41a4d321730f556c7e7b7d62bc51464e0b3
2019-01-21 23:40:10
CRIMX
refactor: update legacy config
false
diff --git a/src/components/WordPage/index.tsx b/src/components/WordPage/index.tsx index f958ee24b..e2bb44cd4 100644 --- a/src/components/WordPage/index.tsx +++ b/src/components/WordPage/index.tsx @@ -12,7 +12,7 @@ import zh_TW from 'antd/lib/locale-provider/zh_TW' import en_US from 'antd/lib/locale-provider/en_US' import { Area } from '@/_helpers/record-manager' -import { createActiveConfigStream } from '@/_helpers/config-manager' +import { createConfigStream } from '@/_helpers/config-manager' const i18n = i18nLoader({ wordpage: worPageLocales, content: contentLocales }, 'wordpage') const antdLocales = { @@ -35,7 +35,7 @@ export default class WordPage extends React.Component<WordPageProps, WordPageSta this.state = { locale: 'zh-CN' } - createActiveConfigStream().subscribe(config => { + createConfigStream().subscribe(config => { if (this.state.locale !== config.langCode && antdLocales[config.langCode]) { this.setState({ locale: config.langCode }) }
refactor
update legacy config
e42ab5a0deb9e9b0bc06bb990e70b6643b214f86
2018-05-09 14:41:02
CRIMX
test(dicts): update tests
false
diff --git a/test/specs/components/dictionaries/bing/engine.spec.ts b/test/specs/components/dictionaries/bing/engine.spec.ts index 5bee03e63..8653ae4a3 100644 --- a/test/specs/components/dictionaries/bing/engine.spec.ts +++ b/test/specs/components/dictionaries/bing/engine.spec.ts @@ -1,5 +1,5 @@ import search, { BingResultLex, BingResultMachine, BingResultRelated } from '@/components/dictionaries/bing/engine' -import { appConfigFactory, DictConfigs, AppConfigMutable } from '@/app-config' +import { appConfigFactory, AppConfigMutable } from '@/app-config' jest.mock('@/_helpers/fetch-dom', () => { return jest.fn((url: string) => new Promise((resolve, reject) => { @@ -8,9 +8,9 @@ jest.mock('@/_helpers/fetch-dom', () => { const { JSDOM } = require('jsdom') const { URL } = require('url') const response = { - lex: fs.readFileSync('test/specs/components/dictionaries/bing/response/lex.html'), - machine: fs.readFileSync('test/specs/components/dictionaries/bing/response/machine.html'), - related: fs.readFileSync('test/specs/components/dictionaries/bing/response/related.html'), + lex: fs.readFileSync('test/specs/components/dictionaries/bing/response/lex.html', 'utf8'), + machine: fs.readFileSync('test/specs/components/dictionaries/bing/response/machine.html', 'utf8'), + related: fs.readFileSync('test/specs/components/dictionaries/bing/response/related.html', 'utf8'), } const searchURL = new URL(url) const searchText = searchURL.searchParams.get('q') @@ -68,10 +68,3 @@ describe('Dict/Bing/engine', () => { }) }) }) - -function genBingConfig (source: Partial<DictConfigs['bing']> = {}): DictConfigs['bing'] { - return { - ...appConfigFactory().dicts.all['bing'], - ...source, - } -} diff --git a/test/specs/components/dictionaries/google/engine.spec.ts b/test/specs/components/dictionaries/google/engine.spec.ts new file mode 100644 index 000000000..9f70a0746 --- /dev/null +++ b/test/specs/components/dictionaries/google/engine.spec.ts @@ -0,0 +1,26 @@ +import search, { GoogleResult } from '@/components/dictionaries/google/engine' +import { appConfigFactory } from '@/app-config' + +const fetchbak = window.fetch + +describe('Dict/Google/engine', () => { + beforeAll(() => { + const fs = require('fs') + const response = fs.readFileSync('test/specs/components/dictionaries/google/response/f.txt', 'utf8') + window.fetch = jest.fn((url: string) => Promise.resolve({ + text: () => response + })) + }) + + afterAll(() => { + window.fetch = fetchbak + }) + + it('should parse result correctly', () => { + return search('any', appConfigFactory()) + .then(searchResult => { + expect(searchResult.audio).toBeUndefined() + expect(searchResult.result).toBe('不要温柔地进入那个晚安。 愤怒,对光明的消逝愤怒。') + }) + }) +}) diff --git a/test/specs/components/dictionaries/google/response/f.txt b/test/specs/components/dictionaries/google/response/f.txt new file mode 100644 index 000000000..dfc7031ce --- /dev/null +++ b/test/specs/components/dictionaries/google/response/f.txt @@ -0,0 +1 @@ +[[["不要温柔地进入那个晚安。","Do not go gentle into that good night.",null,null,3],["愤怒,对光明的消逝愤怒。","Rage, rage against the dying of the light.",null,null,1]],null,"en",null,null,null,1,null,[["en"],null,[1],["en"]]] \ No newline at end of file
test
update tests
a81180f93d3fab9cc00ebe3878901929935e3bd0
2019-08-02 12:59:00
crimx
refactor(storybook): remove padding
false
diff --git a/.storybook/style.css b/.storybook/style.css index 216649dcf..fcdd183e8 100644 --- a/.storybook/style.css +++ b/.storybook/style.css @@ -3,6 +3,6 @@ body { height: unset; overflow-y: scroll; margin: 0; - padding: 8px; + padding: 0; box-sizing: border-box; } diff --git a/src/_helpers/storybook.tsx b/src/_helpers/storybook.tsx index 96d09c3ba..5f1b30aab 100644 --- a/src/_helpers/storybook.tsx +++ b/src/_helpers/storybook.tsx @@ -69,7 +69,7 @@ export function withSaladictPanel(children: React.ReactNode) { return function SaladcitPanel(story: Function) { const width = number('Panel Width', 450) return ( - <root.div style={{ width, margin: '0 auto' }}> + <root.div style={{ width, margin: '10px auto' }}> <style>{require('@/_sass_global/_reset.scss').toString()}</style> <div className={boolean('Enable Animation', true) ? 'isAnimate' : ''} diff --git a/src/content/components/SaladBowl/SaladBowl.stories.tsx b/src/content/components/SaladBowl/SaladBowl.stories.tsx index 527bb3892..1cef65abc 100644 --- a/src/content/components/SaladBowl/SaladBowl.stories.tsx +++ b/src/content/components/SaladBowl/SaladBowl.stories.tsx @@ -56,40 +56,34 @@ storiesOf('Content Scripts|SaladBowl', module) onChange={action('onChange')} /> )) - .add( - 'Bowl Playground', - () => - React.createElement(() => { - const [{ mouseX, mouseY }, setCoord] = useState({ - mouseX: 0, - mouseY: 0 - }) - return ( - <div - style={{ height: '100vh', background: '#c5d3e2' }} - onClick={e => - setCoord({ - mouseX: e.clientX, - mouseY: e.clientY - }) - } - > - <p style={{ textAlign: 'center', color: '#5C6A79' }}> - CLICK AROUND AND SEE THE BOWL FOLLOWS - </p> - <SaladBowlPortal - show={boolean('Show', true)} - mouseX={mouseX} - mouseY={mouseY} - withAnimation={boolean('Animation', true)} - enableHover={boolean('Enable hover', true)} - onChange={action('onChange')} - /> - </div> - ) - }), - { - info: { disable: true } - // backgrounds: [{ name: 'Background', value: '#c5d3e2', default: true }] - } + .add('Bowl Playground', () => + React.createElement(() => { + const [{ mouseX, mouseY }, setCoord] = useState({ + mouseX: 0, + mouseY: 0 + }) + return ( + <div + style={{ height: '100vh', background: '#5caf9e', overflow: 'hidden' }} + onClick={e => + setCoord({ + mouseX: e.clientX, + mouseY: e.clientY + }) + } + > + <p style={{ textAlign: 'center', color: '#fff', userSelect: 'none' }}> + CLICK AROUND AND SEE THE BOWL FOLLOWS + </p> + <SaladBowlPortal + show={boolean('Show', true)} + mouseX={mouseX} + mouseY={mouseY} + withAnimation={boolean('Animation', true)} + enableHover={boolean('Enable hover', true)} + onChange={action('onChange')} + /> + </div> + ) + }) )
refactor
remove padding
ae2467beedad69fa9895f8d217cd45b1e217b49e
2021-10-06 21:38:49
crimx
refactor(dictpanel): add darkmode support
false
diff --git a/src/_helpers/storybook.tsx b/src/_helpers/storybook.tsx index 26cc947e..ce9cebe1 100644 --- a/src/_helpers/storybook.tsx +++ b/src/_helpers/storybook.tsx @@ -148,6 +148,7 @@ export function withSaladictPanel(options: WithSaladictPanelOptions) { width, height, fontSize, + darkMode, withAnimation })} </div> diff --git a/src/components/dictionaries/dictionaries.stories.tsx b/src/components/dictionaries/dictionaries.stories.tsx index f0ca77e1..88d10632 100644 --- a/src/components/dictionaries/dictionaries.stories.tsx +++ b/src/components/dictionaries/dictionaries.stories.tsx @@ -70,11 +70,12 @@ Object.keys(getAllDicts()) ) .forEach(id => { // @ts-ignore: wrong storybook typing - stories.add(id, ({ fontSize, withAnimation }) => ( + stories.add(id, ({ fontSize, withAnimation, darkMode }) => ( <Dict key={id} dictID={id as DictID} fontSize={fontSize} + darkMode={darkMode} withAnimation={withAnimation} /> )) @@ -83,6 +84,7 @@ Object.keys(getAllDicts()) function Dict(props: { dictID: DictID fontSize: number + darkMode: boolean withAnimation: boolean }) { const { i18n } = useTranslate() @@ -186,6 +188,7 @@ function Dict(props: { <DictItem dictID={props.dictID} catalog={catalog} + darkMode={props.darkMode} withAnimation={props.withAnimation} panelCSS={''} preferredHeight={number('Preferred Height', 256)} diff --git a/src/content/components/DictItem/DictItem.stories.tsx b/src/content/components/DictItem/DictItem.stories.tsx index 83968a27..08eb2c4f 100644 --- a/src/content/components/DictItem/DictItem.stories.tsx +++ b/src/content/components/DictItem/DictItem.stories.tsx @@ -26,10 +26,11 @@ storiesOf('Content Scripts|Dict Panel', module) }) ) // @ts-ignore: wrong storybook typing - .add('DictItem', ({ withAnimation }) => { + .add('DictItem', ({ withAnimation, darkMode }) => { return ( <DictItem dictID="baidu" + darkMode={darkMode} withAnimation={withAnimation} panelCSS={''} preferredHeight={number('Preferred Height', 256)} diff --git a/src/content/components/DictItem/DictItemBody.tsx b/src/content/components/DictItem/DictItemBody.tsx index e90dc3d2..c33416c2 100644 --- a/src/content/components/DictItem/DictItemBody.tsx +++ b/src/content/components/DictItem/DictItemBody.tsx @@ -14,6 +14,7 @@ const dictContentStyles = require('./DictItemContent.shadow.scss').toString() export interface DictItemBodyProps { dictID: DictID + darkMode: boolean withAnimation: boolean panelCSS: string @@ -71,7 +72,10 @@ export const DictItemBody: FC<DictItemBodyProps> = props => { <Suspense fallback={null}> {props.searchStatus === 'FINISH' && props.searchResult && ( <root.div> - <div ref={props.dictRootRef}> + <div + ref={props.dictRootRef} + className={classNames({ darkMode: props.darkMode })} + > <style>{dictContentStyles}</style> <DictStyle /> {props.panelCSS ? <style>{props.panelCSS}</style> : null} diff --git a/src/content/components/DictList/DictList.container.tsx b/src/content/components/DictList/DictList.container.tsx index 92d59c2e..0d6008e9 100644 --- a/src/content/components/DictList/DictList.container.tsx +++ b/src/content/components/DictList/DictList.container.tsx @@ -40,6 +40,7 @@ const mapStateToProps: MapStateToProps< > = state => { const { config } = state return { + darkMode: config.darkMode, withAnimation: config.animation, panelCSS: config.panelCSS, touchMode: config.touchMode, diff --git a/src/content/components/DictList/DictList.stories.tsx b/src/content/components/DictList/DictList.stories.tsx index 606f1fae..fcb13709 100644 --- a/src/content/components/DictList/DictList.stories.tsx +++ b/src/content/components/DictList/DictList.stories.tsx @@ -53,8 +53,10 @@ storiesOf('Content Scripts|Dict Panel', module) }) ) .addDecorator(withi18nNS(['content', 'dicts'])) - .add('DictList', () => ( + // @ts-ignore: wrong storybook typing + .add('DictList', ({ darkMode }) => ( <DictList + darkMode={darkMode} touchMode={boolean('Touch Mode', false)} language={object('Language', defaultLanguage)} doubleClickDelay={number('Double Click Delay', 200)} diff --git a/src/content/components/DictPanel/DictPanel.stories.tsx b/src/content/components/DictPanel/DictPanel.stories.tsx index 97fd86e3..6bedecee 100644 --- a/src/content/components/DictPanel/DictPanel.stories.tsx +++ b/src/content/components/DictPanel/DictPanel.stories.tsx @@ -199,6 +199,7 @@ function useDictPanelProps(): DictPanelPortalProps { ), dictList: ( <DictList + darkMode={config.darkMode} touchMode={config.touchMode} language={config.language} doubleClickDelay={config.doubleClickDelay}
refactor
add darkmode support
c36d15d65880e156aa76b462e13ea6036e65685c
2018-10-07 14:02:45
CRIMX
fix(dicts): update google tk
false
diff --git a/src/components/dictionaries/google/engine.ts b/src/components/dictionaries/google/engine.ts index 044c2780b..fedaae901 100644 --- a/src/components/dictionaries/google/engine.ts +++ b/src/components/dictionaries/google/engine.ts @@ -59,20 +59,37 @@ function fetchWithToken (base: string, sl: string, tl: string, text: string): Pr return fetch(base) .then(r => r.ok ? r.text() : handleNetWorkError()) .then<GoogleRawResult>(body => { - const tkk = (body.match(/TKK=(.*?)\(\)\)'\);/) || [''])[0] + let tk = '' + let tk1 = 0 + let tk2 = 0 + + // eval version + let tkk = (body.match(/TKK=(.*?)\(\)\)'\);/i) || [''])[0] .replace(/\\x([0-9A-Fa-f]{2})/g, '') // remove hex chars .match(/[+-]?\d+/g) if (tkk) { - const tk1 = Number(tkk[2]) - const tk2 = Number(tkk[0]) + Number(tkk[1]) - const tk = getTK(text, tk1, tk2) - if (tk) { - const encodedText = encodeURIComponent(text) - return fetch(`${base}/translate_a/single?client=t&sl=${sl}&tl=${tl}&q=${encodedText}&tk=${tk}&hl=en&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=5`) - .then(r => r.text()) - .then(json => ({ json, base, sl, tl, tk1, tk2, text })) + tk1 = Number(tkk[2]) + tk2 = Number(tkk[0]) + Number(tkk[1]) + tk = getTK(text, tk1, tk2) + } + + // direct number + if (!tk) { + tkk = body.match(/TKK[=:]['"](\d+?)\.(\d+?)['"]/i) + if (tkk) { + tk1 = Number(tkk[1]) + tk2 = Number(tkk[2]) + tk = getTK(text, tk1, tk2) } } + + if (tk) { + const encodedText = encodeURIComponent(text) + return fetch(`${base}/translate_a/single?client=t&sl=${sl}&tl=${tl}&q=${encodedText}&tk=${tk}&hl=en&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=5`) + .then(r => r.text()) + .then(json => ({ json, base, sl, tl, tk1, tk2, text })) + } + return handleNoResult() }) }
fix
update google tk
050ecebca236ca67e0e32901d1015c1d336facf5
2020-04-03 18:26:59
crimx
refactor: upgrade to antd4
false
diff --git a/.neutrinorc.js b/.neutrinorc.js index d03d7b572..ed58604bf 100644 --- a/.neutrinorc.js +++ b/.neutrinorc.js @@ -160,7 +160,18 @@ module.exports = { 'import', { libraryName: 'antd' - } + }, + 'antd' + ], + [ + 'import', + { + libraryName: '@ant-design/icons', + libraryDirectory: '', + camel2DashComponentName: false, + style: false + }, + '@ant-design/icons' ] ] } diff --git a/package.json b/package.json index 125d558ad..047fa4ea5 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ } }, "dependencies": { + "@ant-design/icons": "^4.0.5", "@opentranslate/baidu": "^1.1.2", "@opentranslate/caiyun": "^1.1.2", "@opentranslate/google": "^1.1.0", @@ -58,13 +59,14 @@ "@types/lodash": "^4.14.136", "@types/react": "^16.8.23", "@types/react-dom": "^16.8.4", + "@types/react-helmet": "^5.0.15", "@types/react-redux": "^7.1.2", "@types/react-resize-detector": "^4.0.2", "@types/react-textarea-autosize": "^4.3.4", "@types/react-transition-group": "^4.2.0", "@types/uuid": "^3.4.6", "@types/wavesurfer.js": "^2.0.2", - "antd": "^3.23.1", + "antd": "^4.1.0", "axios": "^0.19.0", "dexie": "^2.0.4", "dompurify": "^1.0.11", @@ -79,8 +81,8 @@ "qrcode.react": "^0.9.3", "react": "^16.10.0", "react-dom": "^16.10.0", + "react-helmet": "^6.0.0-beta.2", "react-hot-loader": "^4", - "react-i18next": "^10.11.4", "react-number-editor": "^4.0.3", "react-redux": "^7.1.0", "react-resize-reporter": "^1.0.0", diff --git a/src/_helpers/antd.tsx b/src/_helpers/antd.tsx new file mode 100644 index 000000000..d92ea6c24 --- /dev/null +++ b/src/_helpers/antd.tsx @@ -0,0 +1,82 @@ +import React, { FC, useState, useEffect } from 'react' +import { Helmet } from 'react-helmet' +import { Provider as ProviderRedux } from 'react-redux' +import createStore from '@/content/redux/create' + +import SaladBowlContainer from '@/content/components/SaladBowl/SaladBowl.container' +import DictPanelContainer from '@/content/components/DictPanel/DictPanel.container' +import WordEditorContainer from '@/content/components/WordEditor/WordEditor.container' + +import { i18nLoader, I18nContextProvider } from '@/_helpers/i18n' + +import { ConfigProvider as AntdConfigProvider } from 'antd' +import zh_CN from 'antd/lib/locale-provider/zh_CN' +import zh_TW from 'antd/lib/locale-provider/zh_TW' +import en_US from 'antd/lib/locale-provider/en_US' + +import { createConfigStream } from '@/_helpers/config-manager' +import { reportGA } from '@/_helpers/analytics' + +const antdLocales = { + 'zh-CN': zh_CN, + 'zh-TW': zh_TW, + en: en_US +} + +export interface LocaledRoot { + /** analytics path */ + path: string + title: string +} + +export async function getLocaledRoot() { + const reduxStore = createStore() + await i18nLoader() + + const LocaledRoot: FC<LocaledRoot> = props => { + const [locale, setLocale] = useState('zh-CN') + const [darkMode, setDarkMode] = useState(false) + + useEffect(() => { + createConfigStream().subscribe(config => { + if (locale !== config.langCode && antdLocales[config.langCode]) { + setLocale(config.langCode) + } + + if (darkMode !== config.darkMode) { + setDarkMode(config.darkMode) + } + + if (config.analytics) { + reportGA(props.path) + } + }) + }, []) + + const theme = + process.env.NODE_ENV === 'development' + ? `https://cdnjs.cloudflare.com/ajax/libs/antd/4.1.0/antd${ + darkMode ? '.dark' : '' + }.min.css` + : `/assets/antd${darkMode ? '.dark' : ''}.min.css` + + return ( + <I18nContextProvider> + <Helmet> + <title>{props.title}</title> + <link rel="stylesheet" href={theme} /> + </Helmet> + <AntdConfigProvider locale={antdLocales[locale]}> + {props.children} + </AntdConfigProvider> + <ProviderRedux store={reduxStore}> + <SaladBowlContainer /> + <DictPanelContainer /> + <WordEditorContainer /> + </ProviderRedux> + </I18nContextProvider> + ) + } + + return LocaledRoot +} diff --git a/yarn.lock b/yarn.lock index 87d7d53f1..e30ce62bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,26 +9,31 @@ dependencies: tinycolor2 "^1.4.1" -"@ant-design/create-react-context@^0.2.4": - version "0.2.5" - resolved "https://registry.yarnpkg.com/@ant-design/create-react-context/-/create-react-context-0.2.5.tgz#f5f5a9163b4772097712837397ad30e22e79f858" - integrity sha512-1rMAa4qgP2lfl/QBH9i78+Gjxtj9FTMpMyDGZsEBW5Kih72EuUo9958mV8PgpRkh4uwPSQ7vVZWXeyNZXVAFDg== - dependencies: - gud "^1.0.0" - warning "^4.0.3" +"@ant-design/icons-svg@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.0.0.tgz#6683db0df97c0c6900bb28a280faf391522ec734" + integrity sha512-Nai+cd3XUrv/z50gSk1FI08j6rENZ1e93rhKeLTBGwa5WrmHvhn2vowa5+voZW2qkXJn1btS6tdvTEDB90M0Pw== -"@ant-design/icons-react@~2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@ant-design/icons-react/-/icons-react-2.0.1.tgz#17a2513571ab317aca2927e58cea25dd31e536fb" - integrity sha512-r1QfoltMuruJZqdiKcbPim3d8LNsVPB733U0gZEUSxBLuqilwsW28K2rCTWSMTjmFX7Mfpf+v/wdiFe/XCqThw== +"@ant-design/icons@^4.0.0", "@ant-design/icons@^4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@ant-design/icons/-/icons-4.0.5.tgz#2433cad04abc7f48d61a487297b326c152a35935" + integrity sha512-qYme6WcHF5J+/dMLBpYTvWx4fSAk3rtWu3wxt8bHRjiB5BlKWMEi/vi1JfB4HnnbwNaym7UXoDvE2xyqW9gb1Q== dependencies: "@ant-design/colors" "^3.1.0" - babel-runtime "^6.26.0" + "@ant-design/icons-svg" "^4.0.0" + classnames "^2.2.6" + insert-css "^2.0.0" + rc-util "^4.9.0" -"@ant-design/icons@~2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@ant-design/icons/-/icons-2.1.1.tgz#7b9c08dffd4f5d41db667d9dbe5e0107d0bd9a4a" - integrity sha512-jCH+k2Vjlno4YWl6g535nHR09PwCEmTBKAG6VqF+rhkrSPRLfgpU2maagwbZPLjaHuU5Jd1DFQ2KJpQuI6uG8w== +"@ant-design/react-slick@~0.25.5": + version "0.25.5" + resolved "https://registry.yarnpkg.com/@ant-design/react-slick/-/react-slick-0.25.5.tgz#18f40abaa22c15dc26da9c473d24da38d4d8f334" + integrity sha512-fusHR9LkarCARvYTN6cG3yz2/Ogf+HTaJ2XEihIjsjgm6uE1aSXycRFEVDpOFP1Aib51Z2Iz3tgg/gL+WbK8rQ== + dependencies: + classnames "^2.2.5" + json2mq "^0.2.0" + lodash "^4.17.15" + resize-observer-polyfill "^1.5.0" "@babel/[email protected]": version "7.5.5" @@ -2401,7 +2406,7 @@ "@types/minimatch" "*" "@types/node" "*" -"@types/hoist-non-react-statics@^3.3.0": +"@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== @@ -2505,6 +2510,20 @@ dependencies: "@types/react" "*" +"@types/react-helmet@^5.0.15": + version "5.0.15" + resolved "https://registry.yarnpkg.com/@types/react-helmet/-/react-helmet-5.0.15.tgz#af0370617307e9f062c6aee0f1f5588224ce646e" + integrity sha512-CCjqvecDJTXRrHG8aTc2YECcQCl26za/q+NaBRvy/wtm0Uh38koM2dpv2bG1xJV4ckz3t1lm2/5KU6nt2s9BWg== + dependencies: + "@types/react" "*" + +"@types/react-lifecycles-compat@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/react-lifecycles-compat/-/react-lifecycles-compat-3.0.1.tgz#a0b1fe18cfb9435bd52737829a69cbe93faf32e2" + integrity sha512-4KiU5s1Go4xRbf7t6VxUUpBeN5PGjpjpBv9VvET4uiPHC500VNYBclU13f8ehHkHoZL39b2cfwHu6RzbV3b44A== + dependencies: + "@types/react" "*" + "@types/react-redux@^7.1.2": version "7.1.7" resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.7.tgz#12a0c529aba660696947384a059c5c6e08185c7a" @@ -2522,13 +2541,6 @@ dependencies: "@types/react" "*" -"@types/react-slick@^0.23.4": - version "0.23.4" - resolved "https://registry.yarnpkg.com/@types/react-slick/-/react-slick-0.23.4.tgz#c97e2a9e7e3d1933c68593b8e82752fab1e8ce53" - integrity sha512-vXoIy4GUfB7/YgqubR4H7RALo+pRdMYCeLgWwV3MPwl5pggTlEkFBTF19R7u+LJc85uMqC7RfsbkqPLMQ4ab+A== - dependencies: - "@types/react" "*" - "@types/[email protected]": version "11.0.2" resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-11.0.2.tgz#a2e3ff657d7c47813f80ca930f3d959c31ec51e3" @@ -2565,6 +2577,11 @@ "@types/prop-types" "*" csstype "^2.2.0" +"@types/shallowequal@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/shallowequal/-/shallowequal-1.1.1.tgz#aad262bb3f2b1257d94c71d545268d592575c9b1" + integrity sha512-Lhni3aX80zbpdxRuWhnuYPm8j8UQaa571lHP/xI4W+7BAFhSIhRReXnqjEgT/XzPoXZTJkCqstFMJ8CZTK6IlQ== + "@types/sinon-chrome@^2.2.6": version "2.2.6" resolved "https://registry.yarnpkg.com/@types/sinon-chrome/-/sinon-chrome-2.2.6.tgz#0ce2b8caea8d6ec0a2f9e20ca72c820b590bef81" @@ -3069,64 +3086,54 @@ ansi-styles@^4.1.0: "@types/color-name" "^1.1.1" color-convert "^2.0.1" -antd@^3.23.1: - version "3.26.13" - resolved "https://registry.yarnpkg.com/antd/-/antd-3.26.13.tgz#fd6b618a33d5dec0f649263f30eae691425f7e47" - integrity sha512-7DjaXAUig51kzVw9T9Mi4slmq0eFl6qGk7t3kjA5t3Sv/Yn2llwNWT0lJDbseooesRRWeFLNByfZV37cUCRJYQ== +antd@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/antd/-/antd-4.1.0.tgz#1e0b07a19d4887e09d47bdd50a3b483bb2c372c4" + integrity sha512-xj/GhuSlvWouZ6L3/qdZ6I9b4IWaDeNaGVlm5D18cNY0pNZTK2zh5ov130KDb6YERtAnA5BLU+5U+cvfbvJUcw== dependencies: - "@ant-design/create-react-context" "^0.2.4" - "@ant-design/icons" "~2.1.1" - "@ant-design/icons-react" "~2.0.1" - "@types/react-slick" "^0.23.4" + "@ant-design/icons" "^4.0.0" + "@ant-design/react-slick" "~0.25.5" array-tree-filter "^2.1.0" - babel-runtime "6.x" classnames "~2.2.6" copy-to-clipboard "^3.2.0" css-animation "^1.5.0" - dom-closest "^0.2.0" - enquire.js "^2.1.6" - is-mobile "^2.1.0" lodash "^4.17.13" moment "^2.24.0" omit.js "^1.0.2" prop-types "^15.7.2" raf "^3.4.1" - rc-animate "^2.10.2" - rc-calendar "~9.15.7" - rc-cascader "~0.17.4" + rc-animate "~2.10.2" + rc-cascader "~1.0.0" rc-checkbox "~2.1.6" rc-collapse "~1.11.3" rc-dialog "~7.6.0" rc-drawer "~3.1.1" - rc-dropdown "~2.4.1" - rc-editor-mention "^1.1.13" - rc-form "^2.4.10" - rc-input-number "~4.5.0" - rc-mentions "~0.4.0" - rc-menu "~7.5.1" - rc-notification "~3.3.1" - rc-pagination "~1.20.11" + rc-dropdown "~3.0.0" + rc-field-form "~1.1.0" + rc-input-number "~4.5.4" + rc-mentions "~1.0.0" + rc-menu "~8.0.1" + rc-notification "~4.0.0" + rc-pagination "~2.2.0" + rc-picker "~1.4.0" rc-progress "~2.5.0" - rc-rate "~2.5.0" - rc-resize-observer "^0.1.0" - rc-select "~9.2.0" - rc-slider "~8.7.1" + rc-rate "~2.5.1" + rc-resize-observer "^0.2.0" + rc-select "~10.1.0" + rc-slider "~9.2.3" rc-steps "~3.5.0" rc-switch "~1.9.0" - rc-table "~6.10.5" - rc-tabs "~9.7.0" - rc-time-picker "~3.7.1" - rc-tooltip "~3.7.3" - rc-tree "~2.1.0" - rc-tree-select "~2.9.1" - rc-trigger "^2.6.2" - rc-upload "~2.9.1" - rc-util "^4.16.1" - react-lazy-load "^3.0.13" - react-lifecycles-compat "^3.0.4" - react-slick "~0.25.2" + rc-table "~7.3.0" + rc-tabs "~10.1.1" + rc-tooltip "~4.0.2" + rc-tree "~3.1.0" + rc-tree-select "~3.1.0" + rc-trigger "~4.0.0" + rc-upload "~3.0.0" + rc-util "^4.20.0" + rc-virtual-list "^1.1.0" resize-observer-polyfill "^1.5.1" - shallowequal "^1.1.0" + scroll-into-view-if-needed "^2.2.20" warning "~4.0.3" anymatch@^2.0.0: @@ -3386,10 +3393,10 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async-validator@~1.11.3: - version "1.11.5" - resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-1.11.5.tgz#9d43cf49ef6bb76be5442388d19fb9a6e47597ea" - integrity sha512-XNtCsMAeAH1pdLMEg1z8/Bb3a8cdCbui9QbJATRFHHHW5kT6+NPI3zSVQUXgikTFITzsg+kYY5NTWhM2Orwt9w== +async-validator@^3.0.3: + version "3.2.4" + resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-3.2.4.tgz#4e773a1d0d741016b455b7995b469a47cce0dbe0" + integrity sha512-mTgzMJixkrh+5t2gbYoua8MLy11GHkQqFE6tbhY5Aqc4jEDGsR4BWP+sVQiYDHtzTMB8WIwI/ypObTVPcTZInw== async@^2.1.4, async@^2.6.2, async@^2.6.3: version "2.6.3" @@ -4734,7 +4741,7 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" [email protected], component-classes@^1.2.5, component-classes@^1.2.6: +component-classes@^1.2.5, component-classes@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/component-classes/-/component-classes-1.2.6.tgz#c642394c3618a4d8b0b8919efccbbd930e5cd691" integrity sha1-xkI5TDYYpNiwuJGe/Mu9kw5c1pE= @@ -4781,6 +4788,11 @@ compression@^1.7.4: safe-buffer "5.1.2" vary "~1.1.2" +compute-scroll-into-view@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.13.tgz#be1b1663b0e3f56cd5f7713082549f562a3477e2" + integrity sha512-o+w9w7A98aAFi/GjK8cxSV+CdASuPa2rR5UWs3+yHkJzWqaKoBEufFNWYaXInCSmUfDCVhesG+v9MTWqOjsxFg== + [email protected]: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -5216,15 +5228,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" -create-react-class@^15.5.3: - version "15.6.3" - resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" - integrity sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg== - dependencies: - fbjs "^0.8.9" - loose-envify "^1.3.1" - object-assign "^4.1.1" - [email protected], create-react-context@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.3.0.tgz#546dede9dc422def0d3fc2fe03afe0bc0f4f7d8c" @@ -5792,16 +5795,9 @@ doctrine@^3.0.0: esutils "^2.0.2" dom-align@^1.7.0: - version "1.10.4" - resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.10.4.tgz#862ae4de0d11d6495c1c8ee1b195427e7caa727d" - integrity sha512-wytDzaru67AmqFOY4B9GUb/hrwWagezoYYK97D/vpK+ezg+cnuZO0Q2gltUPa7KfNmIqfRIYVCF8UhRDEHAmgQ== - -dom-closest@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/dom-closest/-/dom-closest-0.2.0.tgz#ebd9f91d1bf22e8d6f477876bbcd3ec90216c0cf" - integrity sha1-69n5HRvyLo1vR3h2u80+yQIWwM8= - dependencies: - dom-matches ">=1.0.1" + version "1.11.1" + resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.11.1.tgz#7592be99a660a36cdedc1d6eeb22b8109d758cae" + integrity sha512-hN42DmUgtweBx0iBjDLO4WtKOMcK8yBmPx/fgdsgQadLuzPu/8co3oLdK5yMmeM/vnUd3yDyV6qV8/NzxBexQg== dom-converter@^0.2: version "0.2.0" @@ -5825,16 +5821,6 @@ dom-helpers@^5.0.1: "@babel/runtime" "^7.6.3" csstype "^2.6.7" -dom-matches@>=1.0.1: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dom-matches/-/dom-matches-2.0.0.tgz#d2728b416a87533980eb089b848d253cf23a758c" - integrity sha1-0nKLQWqHUzmA6wibhI0lPPI6dYw= - [email protected], dom-scroll-into-view@^1.2.0, dom-scroll-into-view@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/dom-scroll-into-view/-/dom-scroll-into-view-1.2.1.tgz#e8f36732dd089b0201a88d7815dc3f88e6d66c7e" - integrity sha1-6PNnMt0ImwIBqI14Fdw/iObWbH4= - dom-serializer@0: version "0.2.2" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" @@ -5950,15 +5936,6 @@ [email protected]: find-up "^3.0.0" minimatch "^3.0.4" -draft-js@^0.10.0, draft-js@~0.10.0: - version "0.10.5" - resolved "https://registry.yarnpkg.com/draft-js/-/draft-js-0.10.5.tgz#bfa9beb018fe0533dbb08d6675c371a6b08fa742" - integrity sha512-LE6jSCV9nkPhfVX2ggcRLA4FKs6zWq9ceuO/88BpXdNCS7mjRTgs0NsV6piUCJX9YxMsB9An33wnkMmU2sD2Zg== - dependencies: - fbjs "^0.8.15" - immutable "~3.7.4" - object-assign "^4.1.0" - duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -6094,11 +6071,6 @@ enhanced-resolve@^4.1.0: memory-fs "^0.5.0" tapable "^1.0.0" -enquire.js@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/enquire.js/-/enquire.js-2.1.6.tgz#3e8780c9b8b835084c3f60e166dbc3c2a3c89814" - integrity sha1-PoeAybi4NQhMP2DhZtvDwqPImBQ= - entities@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" @@ -6489,11 +6461,6 @@ eventemitter3@^4.0.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.0.tgz#d65176163887ee59f386d64c82610b696a4a74eb" integrity sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg== [email protected]: - version "0.0.1" - resolved "https://registry.yarnpkg.com/eventlistener/-/eventlistener-0.0.1.tgz#ed2baabb852227af2bcf889152c72c63ca532eb8" - integrity sha1-7Suqu4UiJ68rz4iRUscsY8pTLrg= - events@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/events/-/events-3.1.0.tgz#84279af1b34cb75aa88bf5ff291f6d0bd9b31a59" @@ -6777,7 +6744,7 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fbjs@^0.8.1, fbjs@^0.8.15, fbjs@^0.8.16, fbjs@^0.8.4, fbjs@^0.8.9: +fbjs@^0.8.1, fbjs@^0.8.4: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -7803,13 +7770,6 @@ html-minifier@^3.5.8: relateurl "0.2.x" uglify-js "3.4.x" [email protected]: - version "2.0.1" - resolved "https://registry.yarnpkg.com/html-parse-stringify2/-/html-parse-stringify2-2.0.1.tgz#dc5670b7292ca158b7bc916c9a6735ac8872834a" - integrity sha1-3FZwtyksoVi3vJFsmmc1rIhyg0o= - dependencies: - void-elements "^2.0.1" - [email protected], html-webpack-plugin@^4.0.0-beta.2: version "4.0.0-beta.11" resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.11.tgz#3059a69144b5aecef97708196ca32f9e68677715" @@ -7992,16 +7952,6 @@ [email protected]: resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" integrity sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg== -immutable@^3.7.4: - version "3.8.2" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3" - integrity sha1-wkOZUUVbs5kT2vKBN28VMOEErfM= - -immutable@~3.7.4: - version "3.7.6" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.7.6.tgz#13b4d3cb12befa15482a26fe1b2ebae640071e4b" - integrity sha1-E7TTyxK++hVIKib+Gy665kAHHks= - import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -8184,6 +8134,11 @@ inquirer@^7.0.0: strip-ansi "^6.0.0" through "^2.3.6" +insert-css@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/insert-css/-/insert-css-2.0.0.tgz#eb5d1097b7542f4c79ea3060d3aee07d053880f4" + integrity sha1-610Ql7dUL0x56jBg067gfQU4gPQ= + internal-ip@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907" @@ -8432,11 +8387,6 @@ is-map@^2.0.1: resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1" integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw== -is-mobile@^2.1.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-2.2.1.tgz#10f2320012c410cc285feecb13406bd586f1b2f8" - integrity sha512-6zELsfVFr326eq2CI53yvqq6YBanOxKBybwDT+MbMS2laBnK6Ez8m5XHSuTQQbnKRfpDzCod1CMWW5q3wZYMvA== - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -9507,7 +9457,7 @@ lodash.clonedeep@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= -lodash.debounce@^4.0.0, lodash.debounce@^4.0.8: +lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= @@ -9572,7 +9522,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash.throttle@^4.0.0, lodash.throttle@^4.1.1: +lodash.throttle@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= @@ -9587,7 +9537,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== [email protected], lodash@^4.0.0, lodash@^4.0.1, lodash@^4.16.3, lodash@^4.16.5, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@~4.17.12: [email protected], lodash@^4.0.0, lodash@^4.0.1, lodash@^4.16.3, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@^4.2.1, lodash@~4.17.12: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -10020,6 +9970,20 @@ mini-store@^2.0.0: react-lifecycles-compat "^3.0.4" shallowequal "^1.0.2" +mini-store@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mini-store/-/mini-store-3.0.1.tgz#08751c84c551d12c82ba3639c22c7e1d595d69b9" + integrity sha512-6cQjjfUoL53+E0oUd5gQs9/rMicXG7lbK3dgzAMv2qPOnA+cR3yIB/CcAN3YKsFVt01/hOO0lf0M+a+6/lQRdg== + dependencies: + "@types/hoist-non-react-statics" "^3.3.1" + "@types/react-lifecycles-compat" "^3.0.1" + "@types/shallowequal" "^1.1.1" + hoist-non-react-statics "^2.3.1" + prop-types "^15.6.0" + react-lifecycles-compat "^3.0.4" + shallowequal "^1.0.2" + typescript "^3.8.3" + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -10111,7 +10075,7 @@ moment-locales-webpack-plugin@^1.1.0: dependencies: lodash.difference "^4.5.0" [email protected], moment@^2.24.0: +moment@^2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== @@ -10156,11 +10120,6 @@ multicast-dns@^6.0.1: dns-packet "^1.3.1" thunky "^1.0.2" -mutationobserver-shim@^0.3.2: - version "0.3.3" - resolved "https://registry.yarnpkg.com/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz#65869630bc89d7bf8c9cd9cb82188cd955aacd2b" - integrity sha512-gciOLNN8Vsf7YzcqRjKzlAJ6y7e+B86u7i3KXes0xfxx/nfLmozlW1Vn+Sc9x3tPIePFgc1AeIFhtRgkqTjzDQ== - [email protected]: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -11414,7 +11373,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.4" [email protected], prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.5.9, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: [email protected], prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.5.9, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -11641,17 +11600,17 @@ raw-loader@^3.1.0: loader-utils "^1.1.0" schema-utils "^2.0.1" -rc-align@^2.4.0, rc-align@^2.4.1: - version "2.4.5" - resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-2.4.5.tgz#c941a586f59d1017f23a428f0b468663fb7102ab" - integrity sha512-nv9wYUYdfyfK+qskThf4BQUSIadeI/dCsfaMZfNEoxm9HwOIioQ+LyqmMK6jWHAZQgOzMLaqawhuBXlF63vgjw== +rc-align@^3.0.0-rc.0: + version "3.0.0-rc.1" + resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-3.0.0-rc.1.tgz#32d1fac860d12bb85e9b8cafbbdef79f3f537674" + integrity sha512-GbofumhCUb7SxP410j/fbtR2M9Zml+eoZSdaliZh6R3NhfEj5zP4jcO3HG3S9C9KIcXQQtd/cwVHkb9Y0KU7Hg== dependencies: - babel-runtime "^6.26.0" + classnames "2.x" dom-align "^1.7.0" - prop-types "^15.5.8" - rc-util "^4.0.4" + rc-util "^4.12.0" + resize-observer-polyfill "^1.5.1" [email protected], rc-animate@^2.10.1, rc-animate@^2.10.2, rc-animate@^2.3.0, rc-animate@^2.6.0, rc-animate@^2.8.2: [email protected], rc-animate@^2.10.0, rc-animate@^2.10.1, rc-animate@^2.10.2, rc-animate@^2.9.2, rc-animate@~2.10.2: version "2.10.3" resolved "https://registry.yarnpkg.com/rc-animate/-/rc-animate-2.10.3.tgz#163d5e29281a4ff82d53ee7918eeeac856b756f9" integrity sha512-A9qQ5Y8BLlM7EhuCO3fWb/dChndlbWtY/P5QvPqBU7h4r5Q2QsvsbpTGgdYZATRDZbTRnJXXfVk9UtlyS7MBLg== @@ -11664,44 +11623,14 @@ [email protected], rc-animate@^2.10.1, rc-animate@^2.10.2, rc-animate@^2.3.0, rc-an rc-util "^4.15.3" react-lifecycles-compat "^3.0.4" -rc-animate@^3.0.0-rc.1: - version "3.0.0-rc.6" - resolved "https://registry.yarnpkg.com/rc-animate/-/rc-animate-3.0.0-rc.6.tgz#04288eefa118e0cae214536c8a903ffaac1bc3fb" - integrity sha512-oBLPpiT6Q4t6YvD/pkLcmofBP1p01TX0Otse8Q4+Mxt8J+VSDflLZGIgf62EwkvRwsQUkLPjZVFBsldnPKLzjg== - dependencies: - babel-runtime "6.x" - classnames "^2.2.5" - component-classes "^1.2.6" - fbjs "^0.8.16" - prop-types "15.x" - raf "^3.4.0" - rc-util "^4.5.0" - react-lifecycles-compat "^3.0.4" - -rc-calendar@~9.15.7: - version "9.15.9" - resolved "https://registry.yarnpkg.com/rc-calendar/-/rc-calendar-9.15.9.tgz#7a3457ee10f27b9972a755fe6415ef352f01a97a" - integrity sha512-XOPzJlXYmLFIcwalXmzxKZrrAMD6dEPLRVoHG3wbBpErqjE8ugnXVjm9yXgtQh3Ho3Imhmt+KO0WGLv5T4WuAA== - dependencies: - babel-runtime "6.x" - classnames "2.x" - moment "2.x" - prop-types "^15.5.8" - rc-trigger "^2.2.0" - rc-util "^4.1.1" - react-lifecycles-compat "^3.0.4" - -rc-cascader@~0.17.4: - version "0.17.5" - resolved "https://registry.yarnpkg.com/rc-cascader/-/rc-cascader-0.17.5.tgz#4fde91d23b7608c420263c38eee9c0687f80f7dc" - integrity sha512-WYMVcxU0+Lj+xLr4YYH0+yXODumvNXDcVEs5i7L1mtpWwYkubPV/zbQpn+jGKFCIW/hOhjkU4J1db8/P/UKE7A== +rc-cascader@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/rc-cascader/-/rc-cascader-1.0.1.tgz#770de1e1fa7bd559aabd4d59e525819b8bc809b7" + integrity sha512-3mk33+YKJBP1XSrTYbdVLuCC73rUDq5STNALhvua5i8vyIgIxtb5fSl96JdWWq1Oj8tIBoHnCgoEoOYnIXkthQ== dependencies: array-tree-filter "^2.1.0" - prop-types "^15.5.8" - rc-trigger "^2.2.0" + rc-trigger "^4.0.0" rc-util "^4.0.4" - react-lifecycles-compat "^3.0.4" - shallow-equal "^1.0.0" warning "^4.0.1" rc-checkbox@~2.1.6: @@ -11728,9 +11657,9 @@ rc-collapse@~1.11.3: shallowequal "^1.1.0" rc-dialog@~7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/rc-dialog/-/rc-dialog-7.6.0.tgz#6467b75f5b60038129bf2e1b003b264281949c09" - integrity sha512-N48vBPW8I53WycFHI4KXhuTUkB4mx+hixq1a9tcFMLoE7EhkAjbHvs0vGg+Bh/uFg5V00jmZBgQOIEbhcNal/A== + version "7.6.1" + resolved "https://registry.yarnpkg.com/rc-dialog/-/rc-dialog-7.6.1.tgz#11545ccc0b945934fa76079726e0d853e52d705f" + integrity sha512-KUKf+2eZ4YL+lnXMG3hR4ZtIhC9glfH27NtTVz3gcoDIPAf3uUvaXVRNoDCiSi+OGKLyIb/b6EoidFh6nQC5Wg== dependencies: babel-runtime "6.x" rc-animate "2.x" @@ -11745,56 +11674,23 @@ rc-drawer@~3.1.1: rc-util "^4.16.1" react-lifecycles-compat "^3.0.4" -rc-dropdown@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/rc-dropdown/-/rc-dropdown-2.4.1.tgz#aaef6eb3a5152cdd9982895c2a78d9b5f046cdec" - integrity sha512-p0XYn0wrOpAZ2fUGE6YJ6U8JBNc5ASijznZ6dkojdaEfQJAeZtV9KMEewhxkVlxGSbbdXe10ptjBlTEW9vEwEg== +rc-dropdown@~3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rc-dropdown/-/rc-dropdown-3.0.2.tgz#e486b67f5e8e8b9e326426d5a80254621453d66a" + integrity sha512-T3XP4qL6xmkxn8z52YF2SEPoMHPpBiLf0Kty3mjNdRSyKnlu+0F+3bhDHf6gO1msmqrjURaz8sMNAFDcoFHHnw== dependencies: babel-runtime "^6.26.0" classnames "^2.2.6" - prop-types "^15.5.8" - rc-trigger "^2.5.1" - react-lifecycles-compat "^3.0.2" - -rc-editor-core@~0.8.3: - version "0.8.10" - resolved "https://registry.yarnpkg.com/rc-editor-core/-/rc-editor-core-0.8.10.tgz#6f215bc5df9c33ffa9f6c5b30ca73a7dabe8ab7c" - integrity sha512-T3aHpeMCIYA1sdAI7ynHHjXy5fqp83uPlD68ovZ0oClTSc3tbHmyCxXlA+Ti4YgmcpCYv7avF6a+TIbAka53kw== - dependencies: - babel-runtime "^6.26.0" - classnames "^2.2.5" - draft-js "^0.10.0" - immutable "^3.7.4" - lodash "^4.16.5" - prop-types "^15.5.8" - setimmediate "^1.0.5" - -rc-editor-mention@^1.1.13: - version "1.1.13" - resolved "https://registry.yarnpkg.com/rc-editor-mention/-/rc-editor-mention-1.1.13.tgz#9f1cab1065f86b01523840321790c2ab12ac5e8b" - integrity sha512-3AOmGir91Fi2ogfRRaXLtqlNuIwQpvla7oUnGHS1+3eo7b+fUp5IlKcagqtwUBB5oDNofoySXkLBxzWvSYNp/Q== - dependencies: - babel-runtime "^6.23.0" - classnames "^2.2.5" - dom-scroll-into-view "^1.2.0" - draft-js "~0.10.0" - immutable "~3.7.4" - prop-types "^15.5.8" - rc-animate "^2.3.0" - rc-editor-core "~0.8.3" + rc-trigger "^4.0.0" -rc-form@^2.4.10: - version "2.4.11" - resolved "https://registry.yarnpkg.com/rc-form/-/rc-form-2.4.11.tgz#61ee3ae579259684ae30f2c48f55f0f23a5d3d08" - integrity sha512-8BL+FNlFLTOY/A5X6tU35GQJLSIpsmqpwn/tFAYQTczXc4dMJ33ggtH248Cum8+LS0jLTsJKG2L4Qp+1CkY+sA== +rc-field-form@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/rc-field-form/-/rc-field-form-1.1.1.tgz#73f6a2d414005453bb70240abf39247a35b6ae18" + integrity sha512-nS/4BZ+Ikzk5/AYRZn3iGsJKJMBa/IQbe4bxYd/u1u5GMs630tHnKimxRJ5U/emdC1ZbVG3YahlSRin+1hKikA== dependencies: - async-validator "~1.11.3" - babel-runtime "6.x" - create-react-class "^15.5.3" - dom-scroll-into-view "1.x" - hoist-non-react-statics "^3.3.0" - lodash "^4.17.4" - rc-util "^4.15.3" + "@babel/runtime" "^7.8.4" + async-validator "^3.0.3" + rc-util "^4.17.0" warning "^4.0.3" rc-hammerjs@~0.6.0: @@ -11806,7 +11702,7 @@ rc-hammerjs@~0.6.0: hammerjs "^2.0.8" prop-types "^15.5.9" -rc-input-number@~4.5.0: +rc-input-number@~4.5.4: version "4.5.6" resolved "https://registry.yarnpkg.com/rc-input-number/-/rc-input-number-4.5.6.tgz#0d52762b0ac39432256e2c6c5c836102f9797c46" integrity sha512-AXbL4gtQ1mSQnu6v/JtMv3UbGRCzLvQznmf0a7U/SAtZ8+dCEAqD4JpJhkjv73Wog53eRYhw4l7ApdXflc9ymg== @@ -11817,53 +11713,56 @@ rc-input-number@~4.5.0: rc-util "^4.5.1" rmc-feedback "^2.0.0" -rc-mentions@~0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/rc-mentions/-/rc-mentions-0.4.2.tgz#c18ab701efb9e4b75b3851a0c0d2dd698640e246" - integrity sha512-DTZurQzacLXOfVuiHydGzqkq7cFMHXF18l2jZ9PhWUn2cqvOSY3W4osN0Pq29AOMOBpcxdZCzgc7Lb0r/bgkDw== +rc-mentions@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/rc-mentions/-/rc-mentions-1.0.1.tgz#4a82b5011ccd3f0008f69f3b2e29ab8c0d91b17f" + integrity sha512-EgXFYsNHk44ifwDcbtd3zX7rJc3lHplfVEVEf8oxZeeyyIzFD0GLs0Z0LWHNs6Gm4wTAHvcR0j4Pd5M7fLtBoA== dependencies: - "@ant-design/create-react-context" "^0.2.4" classnames "^2.2.6" - rc-menu "^7.4.22" - rc-trigger "^2.6.2" + rc-menu "^8.0.1" + rc-trigger "^4.0.0" rc-util "^4.6.0" - react-lifecycles-compat "^3.0.4" -rc-menu@^7.3.0, rc-menu@^7.4.22, rc-menu@~7.5.1: - version "7.5.5" - resolved "https://registry.yarnpkg.com/rc-menu/-/rc-menu-7.5.5.tgz#78cdc817d86fc353a1430b864d3d96c7489600ca" - integrity sha512-4YJXJgrpUGEA1rMftXN7bDhrV5rPB8oBJoHqT+GVXtIWCanfQxEnM3fmhHQhatL59JoAFMZhJaNzhJIk4FUWCQ== +rc-menu@^8.0.1, rc-menu@~8.0.1: + version "8.0.3" + resolved "https://registry.yarnpkg.com/rc-menu/-/rc-menu-8.0.3.tgz#d553eaa892da6c02c74c9b1d2e778f140ace4d99" + integrity sha512-a37l9MfzjXt8/q5en6ukjD2PoVsHCzWeRPdFK9eWi6hF5/9M3mfxgUt1LruQvaJKMQUxDyN5+4M8FsYULXJALw== dependencies: classnames "2.x" - dom-scroll-into-view "1.x" - mini-store "^2.0.0" - mutationobserver-shim "^0.3.2" + mini-store "^3.0.1" rc-animate "^2.10.1" - rc-trigger "^2.3.0" + rc-trigger "^4.0.0" rc-util "^4.13.0" resize-observer-polyfill "^1.5.0" + scroll-into-view-if-needed "^2.2.20" shallowequal "^1.1.0" -rc-notification@~3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/rc-notification/-/rc-notification-3.3.1.tgz#0baa3e70f8d40ab015ce8fa78c260c490fc7beb4" - integrity sha512-U5+f4BmBVfMSf3OHSLyRagsJ74yKwlrQAtbbL5ijoA0F2C60BufwnOcHG18tVprd7iaIjzZt1TKMmQSYSvgrig== +rc-notification@~4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/rc-notification/-/rc-notification-4.0.0.tgz#ffe59783d6738003972dde8b9658f1acd469cd2c" + integrity sha512-In9FimkJY+JSIq3/eopPfBpQQr2Zugq5i9Aw9vdiNCGCsAsSO9bGq2dPsn8bamOydNrhc3djljGfmxUUMbcZnA== dependencies: - babel-runtime "6.x" classnames "2.x" - prop-types "^15.5.8" rc-animate "2.x" rc-util "^4.0.4" -rc-pagination@~1.20.11: - version "1.20.14" - resolved "https://registry.yarnpkg.com/rc-pagination/-/rc-pagination-1.20.14.tgz#981c125ebedbe7fe6782bd311f8bb9c99eb0cded" - integrity sha512-sNKwbFrxiqATqcIIShfrFs8BT03n4UUwTAMYae+JhHTmILQmXdvimEnZbVuWcno6G02DAJcLrFpmkn1h2tmEJw== +rc-pagination@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/rc-pagination/-/rc-pagination-2.2.0.tgz#8daaab1b6ad664da2ddea842f86687b692eb775d" + integrity sha512-fXempMD/kvHu8tsiW70uPjn1pI4mdD62xFG9drcBh17gj5CbCjazrjpWS615RSauk3b2BBgIcAJzREAMvlAkFQ== dependencies: - babel-runtime "6.x" - classnames "^2.2.6" - prop-types "^15.5.7" - react-lifecycles-compat "^3.0.4" + classnames "^2.2.1" + +rc-picker@~1.4.0: + version "1.4.2" + resolved "https://registry.yarnpkg.com/rc-picker/-/rc-picker-1.4.2.tgz#b7955b7690d913177948ba0fc0640cc307d18874" + integrity sha512-e1XDwpAjvK34I/R/DmcaFgIg/lQBO+J266Pe0+ItbrEivDFmfVKcd1anaIGB4T2Mu9vOyjp+vT+i9ohb9uMEOg== + dependencies: + classnames "^2.2.1" + moment "^2.24.0" + rc-trigger "^4.0.0" + rc-util "^4.17.0" + shallowequal "^1.1.0" rc-progress@~2.5.0: version "2.5.2" @@ -11873,7 +11772,7 @@ rc-progress@~2.5.0: babel-runtime "6.x" prop-types "^15.5.8" -rc-rate@~2.5.0: +rc-rate@~2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/rc-rate/-/rc-rate-2.5.1.tgz#55fc5fd23ea9dcc72250b9a889803479f4842961" integrity sha512-3iJkNJT8xlHklPCdeZtUZmJmRVUbr6AHRlfSsztfYTXVlHrv2TcPn3XkHsH+12j812WVB7gvilS2j3+ffjUHXg== @@ -11883,44 +11782,36 @@ rc-rate@~2.5.0: rc-util "^4.3.0" react-lifecycles-compat "^3.0.4" -rc-resize-observer@^0.1.0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/rc-resize-observer/-/rc-resize-observer-0.1.3.tgz#097191f9c3ab186ed907b553ba6ef565df11c249" - integrity sha512-uzOQEwx83xdQSFOkOAM7x7GHIQKYnrDV4dWxtCxyG1BS1pkfJ4EvDeMfsvAJHSYkQXVBu+sgRHGbRtLG3qiuUg== +rc-resize-observer@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/rc-resize-observer/-/rc-resize-observer-0.2.1.tgz#4610acb8a0f2a84b5e8d45664964ac32b5d3df72" + integrity sha512-GENTRkL3lq05ilrjTxPpHUPrKTC9D7XqUGesSXgi/GyO4j/jKIjLPn7zuZOcJ5QmN5QGRe24IaVWPZHQPE6vLw== dependencies: classnames "^2.2.1" - rc-util "^4.13.0" + rc-util "^4.14.0" resize-observer-polyfill "^1.5.1" -rc-select@~9.2.0: - version "9.2.3" - resolved "https://registry.yarnpkg.com/rc-select/-/rc-select-9.2.3.tgz#64340e2d6ef64e8bc3cfc6f468ffd28625589ac2" - integrity sha512-WhswxOMWiNnkXRbxyrj0kiIvyCfo/BaRPaYbsDetSIAU2yEDwKHF798blCP5u86KLOBKBvtxWLFCkSsQw1so5w== +rc-select@^10.1.0, rc-select@~10.1.0: + version "10.1.7" + resolved "https://registry.yarnpkg.com/rc-select/-/rc-select-10.1.7.tgz#56b867bec059d904adf36576b7cb592386b19a57" + integrity sha512-ayFG4YtjJTrH5hv9ezqeyaUzDtzp/PcAberf/V6S5ocf6J4kdsIDjVDhTcJME1VTTtBA8XCJLhl/YriQFPY0Tw== dependencies: - babel-runtime "^6.23.0" classnames "2.x" - component-classes "1.x" - dom-scroll-into-view "1.x" - prop-types "^15.5.8" - raf "^3.4.0" - rc-animate "2.x" - rc-menu "^7.3.0" - rc-trigger "^2.5.4" - rc-util "^4.0.4" - react-lifecycles-compat "^3.0.2" - warning "^4.0.2" + rc-animate "^2.10.0" + rc-trigger "^4.0.0" + rc-util "^4.20.0" + rc-virtual-list "^1.1.0" + warning "^4.0.3" -rc-slider@~8.7.1: - version "8.7.1" - resolved "https://registry.yarnpkg.com/rc-slider/-/rc-slider-8.7.1.tgz#9ed07362dc93489a38e654b21b8122ad70fd3c42" - integrity sha512-WMT5mRFUEcrLWwTxsyS8jYmlaMsTVCZIGENLikHsNv+tE8ThU2lCoPfi/xFNUfJFNFSBFP3MwPez9ZsJmNp13g== +rc-slider@~9.2.3: + version "9.2.4" + resolved "https://registry.yarnpkg.com/rc-slider/-/rc-slider-9.2.4.tgz#92e2b58c53def9921ae0fc2822727ab5785b9ed0" + integrity sha512-wSr7vz+WtzzGqsGU2rTQ4mmLz9fkuIDMPYMYm8ygYFvxQ2Rh4uRhOWHYI0R8krNK5k1bGycckYxmQqUIvLAh3w== dependencies: babel-runtime "6.x" classnames "^2.2.5" - prop-types "^15.5.4" - rc-tooltip "^3.7.0" + rc-tooltip "^4.0.0" rc-util "^4.0.4" - react-lifecycles-compat "^3.0.4" shallowequal "^1.1.0" warning "^4.0.3" @@ -11943,136 +11834,101 @@ rc-switch@~1.9.0: prop-types "^15.5.6" react-lifecycles-compat "^3.0.4" -rc-table@~6.10.5: - version "6.10.13" - resolved "https://registry.yarnpkg.com/rc-table/-/rc-table-6.10.13.tgz#9ef31f199abdb52d5db49b17ccd5f7cb77f0e498" - integrity sha512-Pqb83gVWWdmfeE9tR+7vdi9dWO963Vq2n+nz5oE8LOpCkF/1UVLKcw7Som5FHpilOjd44c+wLPIL4H8Gx2i6qg== +rc-table@~7.3.0: + version "7.3.14" + resolved "https://registry.yarnpkg.com/rc-table/-/rc-table-7.3.14.tgz#d727bfcd8845ca5ff70599ee900d253792ac4a2e" + integrity sha512-ivfV+hiFU4IeLEERs1KVfEHysi0o9T4RGLwoPBpCa/vq/racaYcjSEQnocUeKVu7Rpbr98QSRdgYbZt0oD6baw== dependencies: classnames "^2.2.5" component-classes "^1.2.6" lodash "^4.17.5" mini-store "^2.0.0" prop-types "^15.5.8" - rc-util "^4.13.0" + raf "^3.4.1" + rc-resize-observer "^0.2.0" + rc-util "^4.20.1" react-lifecycles-compat "^3.0.2" - shallowequal "^1.0.2" + shallowequal "^1.1.0" -rc-tabs@~9.7.0: - version "9.7.0" - resolved "https://registry.yarnpkg.com/rc-tabs/-/rc-tabs-9.7.0.tgz#ae09695bef5963d6e64e7bc10521c76dfdd8448b" - integrity sha512-kvmgp8/MfLzFZ06hWHignqomFQ5nF7BqKr5O1FfhE4VKsGrep52YSF/1MvS5oe0NPcI9XGNS2p751C5v6cYDpQ== +rc-tabs@~10.1.1: + version "10.1.1" + resolved "https://registry.yarnpkg.com/rc-tabs/-/rc-tabs-10.1.1.tgz#847d8c2038842a3cb5f2e74935d0e38b85fce61e" + integrity sha512-dOFeaYil3d6zV3ZtGZWfRf7zwyqUQ48cl67/Y/03SsBWEdYgfZzlgjfHqmUT+V7L7CvhQ5lIQyYpj4EthkgKCg== dependencies: - "@ant-design/create-react-context" "^0.2.4" - babel-runtime "6.x" classnames "2.x" lodash "^4.17.5" - prop-types "15.x" - raf "^3.4.1" rc-hammerjs "~0.6.0" - rc-util "^4.0.4" - react-lifecycles-compat "^3.0.4" resize-observer-polyfill "^1.5.1" warning "^4.0.3" -rc-time-picker@~3.7.1: - version "3.7.3" - resolved "https://registry.yarnpkg.com/rc-time-picker/-/rc-time-picker-3.7.3.tgz#65a8de904093250ae9c82b02a4905e0f995e23e2" - integrity sha512-Lv1Mvzp9fRXhXEnRLO4nW6GLNxUkfAZ3RsiIBsWjGjXXvMNjdr4BX/ayElHAFK0DoJqOhm7c5tjmIYpEOwcUXg== - dependencies: - classnames "2.x" - moment "2.x" - prop-types "^15.5.8" - raf "^3.4.1" - rc-trigger "^2.2.0" - react-lifecycles-compat "^3.0.4" - -rc-tooltip@^3.7.0, rc-tooltip@~3.7.3: - version "3.7.3" - resolved "https://registry.yarnpkg.com/rc-tooltip/-/rc-tooltip-3.7.3.tgz#280aec6afcaa44e8dff0480fbaff9e87fc00aecc" - integrity sha512-dE2ibukxxkrde7wH9W8ozHKUO4aQnPZ6qBHtrTH9LoO836PjDdiaWO73fgPB05VfJs9FbZdmGPVEbXCeOP99Ww== +rc-tooltip@^4.0.0, rc-tooltip@~4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/rc-tooltip/-/rc-tooltip-4.0.3.tgz#728b760863643ec2e85827a2e7fb28d961b3b759" + integrity sha512-HNyBh9/fPdds0DXja8JQX0XTIHmZapB3lLzbdn74aNSxXG1KUkt+GK4X1aOTRY5X9mqm4uUKdeFrn7j273H8gw== dependencies: - babel-runtime "6.x" - prop-types "^15.5.8" - rc-trigger "^2.2.2" + rc-trigger "^4.0.0" -rc-tree-select@~2.9.1: - version "2.9.4" - resolved "https://registry.yarnpkg.com/rc-tree-select/-/rc-tree-select-2.9.4.tgz#6aa794e1f0e65c66c406aa0a2a0e74fd0a557b09" - integrity sha512-0HQkXAN4XbfBW20CZYh3G+V+VMrjX42XRtDCpyv6PDUm5vikC0Ob682ZBCVS97Ww2a5Hf6Ajmu0ahWEdIEpwhg== +rc-tree-select@~3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rc-tree-select/-/rc-tree-select-3.1.2.tgz#d71d505071df80be01abd0dfcafd4c2cbd9cde24" + integrity sha512-6i+uCD7FnO7GEuAtE73GW23WntseFvfjhm8nHQR8rbb3pdvpUs/mz0ESgjVavdr4fvjXozI/g0PkjcRa5bgtLg== dependencies: - classnames "^2.2.1" - dom-scroll-into-view "^1.2.1" - prop-types "^15.5.8" - raf "^3.4.0" - rc-animate "^2.8.2" - rc-tree "~2.1.0" - rc-trigger "^3.0.0" - rc-util "^4.5.0" - react-lifecycles-compat "^3.0.4" - shallowequal "^1.0.2" - warning "^4.0.1" + classnames "2.x" + rc-select "^10.1.0" + rc-tree "^3.1.0" + rc-util "^4.17.0" -rc-tree@~2.1.0: - version "2.1.3" - resolved "https://registry.yarnpkg.com/rc-tree/-/rc-tree-2.1.3.tgz#5214ab1b21a1848eb9a2ddcb919e3bc46d6d390b" - integrity sha512-COvV65spQ6omrHBUhHRKqKNL5+ddXjlS+qWZchaL9FFuQNvjM5pjp9RnmMWK4fJJ5kBhhpLneh6wh9Vh3kSMXQ== +rc-tree@^3.1.0, rc-tree@~3.1.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/rc-tree/-/rc-tree-3.1.3.tgz#f658ad1a2b5bbdc5900a9d4f79fc564a1718d213" + integrity sha512-ZMGXL6boVWyShmqguEbKcK8jeVPbfMuoKiwfIbYY3Nu6aNQNQMcfwoa+kNrGMEtwib01gQdkGuOipG0KQAX6Fg== dependencies: - "@ant-design/create-react-context" "^0.2.4" classnames "2.x" prop-types "^15.5.8" - rc-animate "^2.6.0" - rc-util "^4.5.1" + rc-animate "^2.9.2" + rc-util "^4.11.0" + rc-virtual-list "^1.1.0" react-lifecycles-compat "^3.0.4" - warning "^4.0.3" -rc-trigger@^2.2.0, rc-trigger@^2.2.2, rc-trigger@^2.3.0, rc-trigger@^2.5.1, rc-trigger@^2.5.4, rc-trigger@^2.6.2: - version "2.6.5" - resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-2.6.5.tgz#140a857cf28bd0fa01b9aecb1e26a50a700e9885" - integrity sha512-m6Cts9hLeZWsTvWnuMm7oElhf+03GOjOLfTuU0QmdB9ZrW7jR2IpI5rpNM7i9MvAAlMAmTx5Zr7g3uu/aMvZAw== +rc-trigger@^4.0.0, rc-trigger@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-4.0.2.tgz#42fe7bdb6a5b34035e20fa9ebfad69ec948b56be" + integrity sha512-to5S1NhK10rWHIgQpoQdwIhuDc2Ok4R4/dh5NLrDt6C+gqkohsdBCYiPk97Z+NwGhRU8N+dbf251bivX8DkzQg== dependencies: - babel-runtime "6.x" classnames "^2.2.6" prop-types "15.x" - rc-align "^2.4.0" - rc-animate "2.x" - rc-util "^4.4.0" - react-lifecycles-compat "^3.0.4" + raf "^3.4.1" + rc-align "^3.0.0-rc.0" + rc-animate "^2.10.2" + rc-util "^4.20.0" -rc-trigger@^3.0.0: +rc-upload@~3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-3.0.0.tgz#f6d9b1da8a26b2b2d1d912a06876c1a486f5980f" - integrity sha512-hQxbbJpo23E2QnYczfq3Ec5J5tVl2mUDhkqxrEsQAqk16HfADQg+iKNWzEYXyERSncdxfnzYuaBgy764mNRzTA== - dependencies: - babel-runtime "6.x" - classnames "^2.2.6" - prop-types "15.x" - raf "^3.4.0" - rc-align "^2.4.1" - rc-animate "^3.0.0-rc.1" - rc-util "^4.15.7" - -rc-upload@~2.9.1: - version "2.9.4" - resolved "https://registry.yarnpkg.com/rc-upload/-/rc-upload-2.9.4.tgz#8e34a73a468d7907fe31982c38100e4593857d32" - integrity sha512-WXt0HGxXyzLrPV6iec/96Rbl/6dyrAW8pKuY6wwD7yFYwfU5bjgKjv7vC8KNMJ6wzitFrZjnoiogNL3dF9dj3Q== + resolved "https://registry.yarnpkg.com/rc-upload/-/rc-upload-3.0.0.tgz#1365a77405b2df82749e55bcc475ee0de9424370" + integrity sha512-GTmLJ2Habrgon26xwtF8nx1FBxu8KUjRC6QW/7a+NVZ6qXIo+s7HnjqwseuG42kz6xGCoSLNpHgIoHW55EwpxA== dependencies: babel-runtime "6.x" classnames "^2.2.5" - prop-types "^15.5.7" - warning "4.x" -rc-util@^4.0.4, rc-util@^4.1.1, rc-util@^4.13.0, rc-util@^4.15.3, rc-util@^4.15.7, rc-util@^4.16.1, rc-util@^4.3.0, rc-util@^4.4.0, rc-util@^4.5.0, rc-util@^4.5.1, rc-util@^4.6.0: - version "4.20.1" - resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-4.20.1.tgz#a5976eabfc3198ed9b8e79ffb8c53c231db36e77" - integrity sha512-EGlDg9KPN0POzmAR2hk9ZyFc3DmJIrXwlC8NoDxJguX2LTINnVqwadLIVauLfYgYISMiFYFrSHiFW+cqUhZ5dA== +rc-util@^4.0.4, rc-util@^4.11.0, rc-util@^4.12.0, rc-util@^4.13.0, rc-util@^4.14.0, rc-util@^4.15.3, rc-util@^4.16.1, rc-util@^4.17.0, rc-util@^4.20.0, rc-util@^4.20.1, rc-util@^4.3.0, rc-util@^4.5.1, rc-util@^4.6.0, rc-util@^4.8.0, rc-util@^4.9.0: + version "4.20.3" + resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-4.20.3.tgz#c4d4ee6171cf685dc75572752a764310325888d3" + integrity sha512-NBBc9Ad5yGAVTp4jV+pD7tXQGqHxGM2onPSZFyVoJ5fuvRF+ZgzSjZ6RXLPE0pVVISRJ07h+APgLJPBcAeZQlg== dependencies: add-dom-event-listener "^1.1.0" - babel-runtime "6.x" prop-types "^15.5.10" react-is "^16.12.0" react-lifecycles-compat "^3.0.4" shallowequal "^1.1.0" +rc-virtual-list@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/rc-virtual-list/-/rc-virtual-list-1.1.1.tgz#824a2c210729ca738e041b8da9e3347cc6650e40" + integrity sha512-1l2DFqvGMnCm6N5+zKaRnF294r3GKGvejdLIivdqbgMKwX+c1H+SftymdSKY92i6mDe7F0xg/JS6Q6Anu5/1pw== + dependencies: + classnames "^2.2.6" + rc-util "^4.8.0" + react-addons-create-fragment@^15.6.2: version "15.6.2" resolved "https://registry.yarnpkg.com/react-addons-create-fragment/-/react-addons-create-fragment-15.6.2.tgz#a394de7c2c7becd6b5475ba1b97ac472ce7c74f8" @@ -12233,6 +12089,16 @@ react-helmet-async@^1.0.2: react-fast-compare "^2.0.4" shallowequal "^1.1.0" +react-helmet@^6.0.0-beta.2: + version "6.0.0-beta.2" + resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.0.0-beta.2.tgz#8f2d464472e405e5f04efe10883c384d826258b7" + integrity sha512-rRAeil8HsddijqG2+1jeR5qY9wGQvK1zPMf+8MkiTCyhpEP/2qhAAPolEsveeAlz0xSv5C5xYypHtgCtFn0euw== + dependencies: + object-assign "^4.1.1" + prop-types "^15.7.2" + react-fast-compare "^2.0.4" + react-side-effect "^2.1.0" + react-hot-loader@^4: version "4.12.19" resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.19.tgz#99a1c763352828f404fa51cd887c5e16bb5b74d1" @@ -12254,14 +12120,6 @@ [email protected]: dependencies: prop-types "^15.6.1" -react-i18next@^10.11.4: - version "10.13.2" - resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-10.13.2.tgz#2943705fa751d366fc95b3755520ebe6eeed2408" - integrity sha512-DGoauWUdPEv/+PLa03nN+wlW31XrGmQJz+zIyOA+tRTIwlRaNgeM62nGP1WG3g7fJrphMZUwPcAQqNv6XBYM4w== - dependencies: - "@babel/runtime" "^7.3.1" - html-parse-stringify2 "2.0.1" - react-input-autosize@^2.2.1: version "2.2.2" resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-2.2.2.tgz#fcaa7020568ec206bc04be36f4eb68e647c4d8c2" @@ -12278,21 +12136,16 @@ react-inspector@^3.0.2: is-dom "^1.0.9" prop-types "^15.6.1" -react-is@^16.12.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0: +react-is@^16.12.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0: version "16.13.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.0.tgz#0f37c3613c34fe6b37cd7f763a0d6293ab15c527" integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA== -react-lazy-load@^3.0.13: - version "3.0.13" - resolved "https://registry.yarnpkg.com/react-lazy-load/-/react-lazy-load-3.0.13.tgz#3b0a92d336d43d3f0d73cbe6f35b17050b08b824" - integrity sha1-OwqS0zbUPT8Nc8vm81sXBQsIuCQ= - dependencies: - eventlistener "0.0.1" - lodash.debounce "^4.0.0" - lodash.throttle "^4.0.0" - prop-types "^15.5.8" - react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" @@ -12380,16 +12233,10 @@ [email protected]: dependencies: humps "^2.0.1" -react-slick@~0.25.2: - version "0.25.2" - resolved "https://registry.yarnpkg.com/react-slick/-/react-slick-0.25.2.tgz#56331b67d47d8bcfe2dceb6acab1c8fd5bd1f6bc" - integrity sha512-8MNH/NFX/R7zF6W/w+FS5VXNyDusF+XDW1OU0SzODEU7wqYB+ZTGAiNJ++zVNAVqCAHdyCybScaUB+FCZOmBBw== - dependencies: - classnames "^2.2.5" - enquire.js "^2.1.6" - json2mq "^0.2.0" - lodash.debounce "^4.0.8" - resize-observer-polyfill "^1.5.0" +react-side-effect@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.0.tgz#1ce4a8b4445168c487ed24dab886421f74d380d3" + integrity sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg== react-sortable-hoc@^1.10.1: version "1.11.0" @@ -13158,6 +13005,13 @@ screenfull@^4.1.0: resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-4.2.1.tgz#3245b7bc73d2b7c9a15bd8caaf6965db7cbc7f04" integrity sha512-PLSp6f5XdhvjCCCO8OjavRfzkSGL3Qmdm7P82bxyU8HDDDBhDV3UckRaYcRa/NDNTYt8YBpzjoLWHUAejmOjLg== +scroll-into-view-if-needed@^2.2.20: + version "2.2.24" + resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.24.tgz#12bca532990769bd509115a49edcfa755e92a0ea" + integrity sha512-vsC6SzyIZUyJG8o4nbUDCiIwsPdH6W/FVmjT2avR2hp/yzS53JjGmg/bKD20TkoNajbu5dAQN4xR7yes4qhwtQ== + dependencies: + compute-scroll-into-view "^1.0.13" + scss-tokenizer@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" @@ -13336,7 +13190,7 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" -shallow-equal@^1.0.0, shallow-equal@^1.1.0: +shallow-equal@^1.1.0: version "1.2.1" resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== @@ -14555,7 +14409,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.8.2: +typescript@^3.8.2, typescript@^3.8.3: version "3.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== @@ -14839,11 +14693,6 @@ vm-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== -void-elements@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= - w3c-hr-time@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" @@ -14858,7 +14707,7 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" [email protected], warning@^4.0.1, warning@^4.0.2, warning@^4.0.3, warning@~4.0.3: +warning@^4.0.1, warning@^4.0.2, warning@^4.0.3, warning@~4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==
refactor
upgrade to antd4
bbc55311cf79ec6d6a450d3f0e129c2d6b22043e
2019-10-01 14:03:12
crimx
refactor(manifest): update min browser version
false
diff --git a/src/manifest/chrome.manifest.json b/src/manifest/chrome.manifest.json index 5af2dc0ad..e8cb1b81c 100644 --- a/src/manifest/chrome.manifest.json +++ b/src/manifest/chrome.manifest.json @@ -8,5 +8,5 @@ "incognito": "split", "homepage_url": "https://chrome.google.com/webstore/detail/cdonnmffkdaoajfknoeeecmchibpmkmg?hl=en", "update_url": "https://clients2.google.com/service/update2/crx", - "minimum_chrome_version": "55" + "minimum_chrome_version": "60" } diff --git a/src/manifest/firefox.manifest.json b/src/manifest/firefox.manifest.json index cadaa434c..be67bb51f 100644 --- a/src/manifest/firefox.manifest.json +++ b/src/manifest/firefox.manifest.json @@ -5,7 +5,7 @@ "applications": { "gecko": { "id": "[email protected]", - "strict_min_version": "56.0" + "strict_min_version": "65.0" } } }
refactor
update min browser version
80442c93fdeabde946d3165b6d2e8dbe67e23db3
2019-01-18 04:22:01
CRIMX
refactor(options): add page notebook
false
diff --git a/src/_locales/common/messages.json b/src/_locales/common/messages.json index c0fe069ab..14544a2a5 100644 --- a/src/_locales/common/messages.json +++ b/src/_locales/common/messages.json @@ -1,37 +1,52 @@ { - "save": { - "zh_CN": "保存", - "zh_TW": "保存", - "en": "Save" + "add": { + "en": "Add", + "zh_CN": "添加", + "zh_TW": "添加" }, "cancel": { + "en": "Cancel", "zh_CN": "取消", - "zh_TW": "取消", - "en": "Cancel" + "zh_TW": "取消" }, "confirm": { + "en": "Confirm", "zh_CN": "确认", - "zh_TW": "確認", - "en": "Confirm" + "zh_TW": "確認" + }, + "delete": { + "en": "Delete", + "zh_CN": "删除", + "zh_TW": "删除" }, "rename": { + "en": "Rename", "zh_CN": "重命名", - "zh_TW": "重新命名", - "en": "Rename" + "zh_TW": "重新命名" + }, + "save": { + "en": "Save", + "zh_CN": "保存", + "zh_TW": "保存" }, "sort": { + "en": "Sort", "zh_CN": "排序", - "zh_TW": "排序", - "en": "Sort" + "zh_TW": "排序" }, - "add": { - "zh_CN": "添加", - "zh_TW": "添加", - "en": "Add" + "unit_mins": { + "en": "minutes", + "zh_CN": "分钟", + "zh_TW": "分鐘" }, - "delete": { - "zh_CN": "删除", - "zh_TW": "删除", - "en": "Delete" + "unit_ms": { + "en": "ms", + "zh_CN": "毫秒", + "zh_TW": "毫秒" + }, + "unit_word": { + "en": "words", + "zh_CN": "个", + "zh_TW": "个" } } diff --git a/src/_locales/options/messages.json b/src/_locales/options/messages.json index 599542a7a..67e540ca0 100644 --- a/src/_locales/options/messages.json +++ b/src/_locales/options/messages.json @@ -29,56 +29,221 @@ "zh_CN": "反馈问题", "zh_TW": "軟體使用疑問和建言" }, - "nav_black_white_list": { + "msg_updated": { + "en": "Successfully updated", + "zh_CN": "设置已更新", + "zh_TW": "設定已更新" + }, + "nav_BlackWhiteList": { "en": "Black/White List", "zh_CN": "黑白名单", "zh_TW": "黑白名單" }, - "nav_context_menus": { + "nav_ContextMenus": { "en": "Context Menus", "zh_CN": "右键菜单", "zh_TW": "右鍵菜單" }, - "nav_dict_panel": { + "nav_DictPanel": { "en": "Dict Panel", "zh_CN": "查词面板", "zh_TW": "字典介面" }, - "nav_dictioneries": { + "nav_Dictioneries": { "en": "Dictioneries", "zh_CN": "词典设置", "zh_TW": "字典設定" }, - "nav_general": { + "nav_General": { "en": "General", "zh_CN": "基本选项", "zh_TW": "基本選項" }, - "nav_inport_export": { - "en": "Inport/Export", + "nav_ImportExport": { + "en": "Import/Export", "zh_CN": "导入导出", "zh_TW": "匯入匯出" }, - "nav_popup": { + "nav_Notebook": { + "en": "Notebook", + "zh_CN": "单词管理", + "zh_TW": "單字管理" + }, + "nav_PDF": { + "en": "PDF", + "zh_CN": "PDF 设置", + "zh_TW": "PDF 設定" + }, + "nav_Popup": { "en": "Popup Panel", "zh_CN": "右上弹框", "zh_TW": "右上彈框" }, - "nav_profiles": { + "nav_Profiles": { "en": "Profiles", "zh_CN": "情景模式", "zh_TW": "情景模式" }, - "nav_quick_search": { + "nav_QuickSearch": { "en": "Quick Search", "zh_CN": "快捷查词", "zh_TW": "迅速查字" }, - "nav_search_modes": { + "nav_SearchModes": { "en": "Search Modes", "zh_CN": "查词习惯", "zh_TW": "查字習慣" }, + "opt_active": { + "en": "Enable Inline Translator", + "zh_CN": "启用划词翻译", + "zh_TW": "啟用滑鼠劃字翻譯" + }, + "opt_animation": { + "en": "Animation transitions", + "zh_CN": "开启动画过渡", + "zh_TW": "啓用轉換動畫" + }, + "opt_animation_help": { + "en": "Switch off animation transitions to reduce runtime cost.", + "zh_CN": "在低性能设备上关闭过渡动画可减少渲染负担。", + "zh_TW": "在低效能裝置上關閉過渡動畫可減少渲染負擔。" + }, + "opt_app_active_help": { + "en": "\"Quick Search\" is still available even if Inline translation is turned off.", + "zh_CN": "关闭后「快捷查词」功能依然可用。", + "zh_TW": "關閉後「迅速查字」功能依然可用。" + }, + "opt_edit_on_fav": { + "en": "Open WordEditor when saving", + "zh_CN": "红心单词时弹出编辑面板", + "zh_TW": "紅心單字時彈出編輯介面" + }, + "opt_edit_on_fav_help": { + "en": "When turned off, new words will be added to notebook directly.", + "zh_CN": "关闭后,点击红心生词将至今添加到生词本,上下文翻译亦会自动获取。", + "zh_TW": "關閉後,點選紅心生詞將至今新增到生詞本,上下文翻譯亦會自動獲取。" + }, + "opt_history": { + "en": "Keep search history", + "zh_CN": "记录查词历史", + "zh_TW": "記錄查字歷史" + }, + "opt_history_help": { + "en": "Search histry might unintentionally reveal your browsing history.", + "zh_CN": "查词记录可能会泄漏您的浏览痕迹。", + "zh_TW": "查字典記錄可能會泄漏您的瀏覽痕跡。" + }, + "opt_history_inco": { + "en": "Also in incognito mode", + "zh_CN": "在私隐模式中记录", + "zh_TW": "在私隱模式中記錄" + }, + "opt_language": { + "en": "App Language", + "zh_CN": "界面语言", + "zh_TW": "介面語言" + }, + "opt_profile_change": { + "en": "This option may change base on \"Profile\".", + "zh_CN": "此选项会因「情景模式」而改变。", + "zh_TW": "此選項會因「情景模式」而改變。" + }, + "opt_shortcuts": { + "en": "Set Shortcuts", + "zh_CN": "设置快捷键", + "zh_TW": "設定快捷鍵" + }, + "opt_sync_btn": { + "en": "Sync Service", + "zh_CN": "添加同步", + "zh_TW": "添加同步" + }, + "sync_delete_confirm": { + "en": "Delete?", + "zh_CN": "清空同步设置?", + "zh_TW": "清空同步設定?" + }, + "sync_error_url": { + "en": "Not a valid url.", + "zh_CN": "不正确的超链接格式。", + "zh_TW": "不正確的超連結格式。" + }, + "sync_close_confirm": { + "en": "Settings not saved. Close?", + "zh_CN": "设置未保存,关闭?", + "zh_TW": "設定未儲存,關閉?" + }, + "sync_description": { + "en": "Sync settings.", + "zh_CN": "数据同步设置。", + "zh_TW": "資料同步設定。" + }, + "sync_notebook_title": { + "en": "Notebook Sync", + "zh_CN": "生词本同步", + "zh_TW": "生字本同步" + }, + "sync_webdav_checking": { + "en": "Connecting...", + "zh_CN": "连接中...", + "zh_TW": "連線中..." + }, + "sync_webdav_duration": { + "en": "Duration", + "zh_CN": "同步周期", + "zh_TW": "同步頻率" + }, + "sync_webdav_duration_help": { + "en": "Data is guaranteed to be updated before upload. If you do not need real-time syncing across browsers, set a longer polling cycle to reduce CPU and memory footprint.", + "zh_CN": "添加生词后会马上上传,数据会在上传前保证同步,所以如果不需要多个浏览器实时查看更新,可将更新检测周期调大些以减少资源占用及避免服务器拒绝响应。", + "zh_TW": "新增生字後會馬上上傳,資料會在上傳前保證同步,所以如果不需要多個瀏覽器實時查看更新,可將更新檢測週期調大些以減少資源佔用及避免伺服器拒絕響應。" + }, + "sync_webdav_err_exist": { + "en": "Files under Saladict directory on server will be overwritten. Download and merge with local files first?", + "zh_CN": "服务器上 Saladict 目录下的文件将被替换。先下载合并到本地?", + "zh_TW": "伺服器上 Saladict 目錄下的檔案將被替換。先下載合併到本地?" + }, + "sync_webdav_err_mkcol": { + "en": "Cannot create \"Saladict\" directory on server. Please create the directory manualy on server.", + "zh_CN": "无法在服务器创建“Saladict”目录。请手动在服务器上创建。", + "zh_TW": "無法在伺服器建立“Saladict”目錄。請手動在伺服器上建立。" + }, + "sync_webdav_err_network": { + "en": "Network error. Cannot connect to server.", + "zh_CN": "连接服务器失败。", + "zh_TW": "連線伺服器失敗。" + }, + "sync_webdav_err_parse": { + "en": "Incorrect response XML from server.", + "zh_CN": "服务器返回 XML 格式不正确。", + "zh_TW": "伺服器返回 XML 格式不正確。" + }, + "sync_webdav_err_unauthorized": { + "en": "Incorrect account or password.", + "zh_CN": "账户或密码不正确。", + "zh_TW": "賬戶或密碼不正確。" + }, + "sync_webdav_explain": { + "en": "Extension settings (including this) are synced via browser. New words notebook can be synced via WebDAV through settings here. <a href=\"http://help.jianguoyun.com/?p=2064\" target=\"_blank\">See Jianguoyun for example</a>.", + "zh_CN": "应用设置(包括本设置)已通过浏览器自动同步。生词本可通过本设置实现 WebDAV 同步。<a href=\"http://help.jianguoyun.com/?p=2064\" target=\"_blank\">参考坚果云设置</a>。", + "zh_TW": "應用設定(包括本設定)已通過瀏覽器自動同步。生詞本可通過本設定實現 WebDAV 同步。<a href=\"http://help.jianguoyun.com/?p=2064\" target=\"_blank\">參考堅果雲設定</a>。" + }, + "sync_webdav_passwd": { + "en": "Password", + "zh_CN": "密码", + "zh_TW": "密碼" + }, + "sync_webdav_url": { + "en": "Server Address", + "zh_CN": "服务器地址", + "zh_TW": "伺服器地址" + }, + "sync_webdav_user": { + "en": "User Account", + "zh_CN": "账户", + "zh_TW": "賬戶" + }, "title": { "en": "Saladict Options", "zh_CN": "Saladict 设置", diff --git a/src/options/components/options/Notebook/SyncServiceModal.tsx b/src/options/components/options/Notebook/SyncServiceModal.tsx new file mode 100644 index 000000000..9f86931a7 --- /dev/null +++ b/src/options/components/options/Notebook/SyncServiceModal.tsx @@ -0,0 +1,87 @@ +import React from 'react' +import mapValues from 'lodash/mapValues' +import { storage } from '@/_helpers/browser-api' +import { getSyncConfig, removeSyncConfig } from '@/background/sync-manager/helpers' +import { getDefaultConfig, serviceID, SyncConfig } from '@/background/sync-manager/services/webdav' +import { Props } from '../typings' +import { updateConfig as updateConfigWrap } from '../helpers' + +import { FormComponentProps } from 'antd/lib/form' +import { + Form, Select, InputNumber, Switch, Radio, Input, + Slider, Button, Upload, Icon, Checkbox +} from 'antd' + +export type SyncServiceModalProps = Props & FormComponentProps & { + onChange: (syncConfig: SyncConfig) => void + syncConfig: SyncConfig +} + +export class SyncServiceModal extends React.Component<SyncServiceModalProps> { + render () { + const { t, syncConfig } = this.props + const { getFieldDecorator } = this.props.form + + const formItemLayout = { + labelCol: { span: 5 }, + wrapperCol: { span: 18 }, + } + + return ( + <Form> + <p dangerouslySetInnerHTML={{ __html: t('sync_webdav_explain') }} /> + <Form.Item + {...formItemLayout} + label={t('sync_webdav_url')} + hasFeedback + >{ + getFieldDecorator('url', { + initialValue: syncConfig.url, + rules: [{ type: 'url', message: t('sync_error_url') }] + })( + <Input /> + ) + }</Form.Item> + <Form.Item + {...formItemLayout} + label={t('sync_webdav_user')} + >{ + getFieldDecorator('user', { + initialValue: syncConfig.user, + })( + <Input /> + ) + }</Form.Item> + <Form.Item + {...formItemLayout} + label={t('sync_webdav_passwd')} + >{ + getFieldDecorator('passwd', { + initialValue: syncConfig.passwd, + })( + React.createElement(Input.Password) // Antd types bug + ) + }</Form.Item> + <Form.Item + {...formItemLayout} + label={t('sync_webdav_duration')} + extra={t('sync_webdav_duration_help')} + hasFeedback + >{ + getFieldDecorator('duration', { + initialValue: syncConfig.duration, + rules: [{ type: 'number' }], + })( + <InputNumber min={10} formatter={v => `${v} ${t('common:unit_mins')}`} /> + ) + }</Form.Item> + </Form> + ) + } +} + +export default Form.create<SyncServiceModalProps>({ + onValuesChange (props, changedFields, allValues) { + props.onChange(allValues) + }, +})(SyncServiceModal) diff --git a/src/options/components/options/Notebook/index.tsx b/src/options/components/options/Notebook/index.tsx new file mode 100644 index 000000000..296cc4442 --- /dev/null +++ b/src/options/components/options/Notebook/index.tsx @@ -0,0 +1,189 @@ +import React from 'react' +import { MsgSyncServiceInit, MsgType, MsgSyncServiceDownload, MsgSyncServiceUpload } from '@/typings/message' +import { message } from '@/_helpers/browser-api' +import { getSyncConfig, setSyncConfig , removeSyncConfig } from '@/background/sync-manager/helpers' +import { getDefaultConfig, serviceID, SyncConfig } from '@/background/sync-manager/services/webdav' +import { Props } from '../typings' +import { updateConfig as updateConfigWrap } from '../helpers' +import SyncServiceModal from './SyncServiceModal' + +import { FormComponentProps } from 'antd/lib/form' +import { Form, Switch, Modal, Button } from 'antd' + +export type NotebookProps = Props & FormComponentProps + +export class Notebook extends React.Component<NotebookProps> { + isSyncServiceTainted = false + + state = { + isSyncServiceLoading: false, + syncServiceConfig: null as null | SyncConfig, + } + + openSyncService = async () => { + this.setState({ + syncServiceConfig: ( + (await getSyncConfig<SyncConfig>(serviceID)) || getDefaultConfig() + ) + }) + } + + closeSyncService = () => { + if (!this.isSyncServiceTainted || + confirm(this.props.t('sync_close_confirm')) + ) { + this.setState({ syncServiceConfig: null }) + this.isSyncServiceTainted = false + } + } + + saveSyncService = async () => { + const { t } = this.props + const { syncServiceConfig } = this.state + if (!syncServiceConfig) { return } + + this.setState({ isSyncServiceLoading: true }) + + const { error } = await message.send<MsgSyncServiceInit>({ + type: MsgType.SyncServiceInit, + config: syncServiceConfig, + }) + if (error && error !== 'exist') { + if (/^(network|unauthorized|mkcol|parse)$/.test(error)) { + alert(t('sync_webdav_err_' + error)) + } + this.setState({ isSyncServiceLoading: false }) + return + } + + await setSyncConfig(serviceID, syncServiceConfig) + + if (error === 'exist') { + if (confirm(t('sync_webdav_err_exist'))) { + await message.send<MsgSyncServiceDownload>({ + type: MsgType.SyncServiceDownload, + force: true, + }).catch(() => { + alert(t('sync_webdav_err_network')) + }) + } + } + + await message.send<MsgSyncServiceUpload>({ + type: MsgType.SyncServiceUpload, + force: true, + }).catch(() => { + alert(t('sync_webdav_err_network')) + }) + + this.setState({ + isSyncServiceLoading: false, + syncServiceConfig: null, + }) + this.isSyncServiceTainted = false + } + + clearSyncService = async () => { + if (confirm(this.props.t('sync_delete_confirm'))) { + await removeSyncConfig() + this.setState({ syncServiceConfig: null }) + this.isSyncServiceTainted = false + } + } + + onSyncServiceChange = (newSyncConfig: SyncConfig) => { + this.isSyncServiceTainted = true + this.setState({ syncServiceConfig: newSyncConfig }) + console.log(newSyncConfig) + } + + render () { + const { t, config } = this.props + const { syncServiceConfig } = this.state + + const updateConfig = updateConfigWrap(config) + + const formItemLayout = { + labelCol: { span: 5 }, + wrapperCol: { span: 8 }, + } + + return ( + <Form> + <Button onClick={this.openSyncService}>{t('opt_sync_btn')}</Button> + <Form.Item + {...formItemLayout} + label={t('opt_edit_on_fav')} + help={t('opt_edit_on_fav_help')} + >{ + this.props.form.getFieldDecorator('editOnFav', { + initialValue: config.editOnFav, + getValueFromEvent: updateConfig('editOnFav'), + valuePropName: 'checked', + })( + <Switch /> + ) + }</Form.Item> + <Form.Item + {...formItemLayout} + label={t('opt_history')} + help={t('opt_history_help')} + >{ + this.props.form.getFieldDecorator('searhHistory', { + initialValue: config.searhHistory, + getValueFromEvent: updateConfig('searhHistory'), + valuePropName: 'checked', + })( + <Switch /> + ) + }</Form.Item> + {config.searhHistory && + <Form.Item + {...formItemLayout} + label={t('opt_history_inco')} + >{ + this.props.form.getFieldDecorator('searhHistoryInco', { + initialValue: config.searhHistoryInco, + getValueFromEvent: updateConfig('searhHistoryInco'), + valuePropName: 'checked', + })( + <Switch /> + ) + }</Form.Item> + } + <Modal + visible={!!syncServiceConfig} + title={t('sync_notebook_title')} + destroyOnClose + onOk={this.saveSyncService} + onCancel={this.closeSyncService} + footer={[ + <Button + key='delete' + type='danger' + onClick={this.clearSyncService} + >{t('common:delete')}</Button>, + <Button + key='save' + type='primary' + loading={this.state.isSyncServiceLoading} + onClick={this.saveSyncService} + >{t('common:save')}</Button>, + <Button + key='cancel' + onClick={this.closeSyncService} + >{t('common:cancel')}</Button>, + ]} + >{ + React.createElement(SyncServiceModal, { + t, config, + onChange: this.onSyncServiceChange, + syncConfig: syncServiceConfig as SyncConfig, + }) + }</Modal> + </Form> + ) + } +} + +export default Form.create()(Notebook)
refactor
add page notebook
514fdb99f43802edab513e3b59568079156483e3
2018-12-10 01:41:43
CRIMX
refactor: add more controll on notification
false
diff --git a/src/background/initialization.ts b/src/background/initialization.ts index 9e9b6cd3d..685e438ca 100644 --- a/src/background/initialization.ts +++ b/src/background/initialization.ts @@ -87,9 +87,19 @@ async function onInstalled ({ reason, previousVersion }: { reason: string, previ } }) } else if (reason === 'update') { - // ignore patch updates - if (!previousVersion || previousVersion.replace(/[^.]*$/, '') !== browser.runtime.getManifest().version.replace(/[^.]*$/, '')) { - showNews() + let data + if (!process.env.DEV_BUILD) { + try { + const response = await fetch('https://api.github.com/repos/crimx/crx-saladict/releases/latest') + data = await response.json() + } catch (e) {/* */} + } + + if (data) { + // ignore patch updates + if (data.name.endsWith('#') || !previousVersion || previousVersion.replace(/[^.]*$/, '') !== browser.runtime.getManifest().version.replace(/[^.]*$/, '')) { + showNews(data) + } } } } @@ -142,25 +152,21 @@ function genClickListener (url: string) { } } -function showNews () { - return fetch('https://api.github.com/repos/crimx/crx-saladict/releases/latest') - .then(r => r.json()) - .then(data => { - const message = '-= 感谢支持本扩展开发的朋友!=-\n' + - data.body - .match(/^\d+\..+/gm) // item list - .map(line => line.replace(/\[(\S+)\](?:\(\S+\)|\[\S+\])/g, '$1')) // strip markdown link - .join('\n') - if (data && data.tag_name) { - browser.notifications.create('oninstall', { - type: 'basic', - iconUrl: browser.runtime.getURL(`static/icon-128.png`), - title: `Saladict ${data.tag_name} 新增特性:`, - message, - buttons: [{ title: '查看更新介绍' }], - eventTime: Date.now() + 10000, - priority: 2, - }) - } +function showNews (data) { + const message = '-= 感谢支持本扩展开发的朋友!=-\n' + + data.body + .match(/^\d+\..+/gm) // item list + .map(line => line.replace(/\[(\S+)\](?:\(\S+\)|\[\S+\])/g, '$1')) // strip markdown link + .join('\n') + if (data && data.tag_name) { + browser.notifications.create('oninstall', { + type: 'basic', + iconUrl: browser.runtime.getURL(`static/icon-128.png`), + title: `Saladict ${data.tag_name} 新增特性:`, + message, + buttons: [{ title: '查看更新介绍' }], + eventTime: Date.now() + 10000, + priority: 2, }) + } }
refactor
add more controll on notification
4dade9b6e73bf940eddc3bc5e8701de167ebd40d
2019-01-17 01:15:26
CRIMX
fix: langcode comparison
false
diff --git a/src/components/WordPage/index.tsx b/src/components/WordPage/index.tsx index 6ca865388..f958ee24b 100644 --- a/src/components/WordPage/index.tsx +++ b/src/components/WordPage/index.tsx @@ -30,17 +30,13 @@ export interface WordPageState { } export default class WordPage extends React.Component<WordPageProps, WordPageState> { - constructor (props) { + constructor (props: WordPageProps) { super(props) this.state = { locale: 'zh-CN' } - } - - componentDidMount () { createActiveConfigStream().subscribe(config => { - const { locale } = this.state - if (locale !== config.langCode && antdLocales[locale]) { + if (this.state.locale !== config.langCode && antdLocales[config.langCode]) { this.setState({ locale: config.langCode }) } })
fix
langcode comparison
ed1b7c4b9feea6729086fe734a67596e58293dce
2018-08-04 12:23:22
CRIMX
feat(dicts): bing sentence highlight
false
diff --git a/src/components/dictionaries/bing/View.tsx b/src/components/dictionaries/bing/View.tsx index 4fc4649b3..5c134a5ee 100644 --- a/src/components/dictionaries/bing/View.tsx +++ b/src/components/dictionaries/bing/View.tsx @@ -45,8 +45,8 @@ export default class DictBing extends React.PureComponent<{ result: BingResult } <ol className='dictBing-SentenceList'> {result.sentences.map(sen => ( <li className='dictBing-SentenceItem' key={sen.en}> - {sen.en && <p>{sen.en} <Speaker src={sen.mp3}></Speaker></p>} - {sen.chs && <p>{sen.chs}</p>} + {sen.en && <p><span dangerouslySetInnerHTML={{ __html: sen.en }} /> <Speaker src={sen.mp3}></Speaker></p>} + {sen.chs && <p dangerouslySetInnerHTML={{ __html: sen.chs }} />} {sen.source && <footer className='dictBing-SentenceSource'>{sen.source}</footer>} </li> ))} diff --git a/src/components/dictionaries/bing/_style.scss b/src/components/dictionaries/bing/_style.scss index 0bc742fd4..4ad972d63 100644 --- a/src/components/dictionaries/bing/_style.scss +++ b/src/components/dictionaries/bing/_style.scss @@ -55,6 +55,10 @@ } } +.dictBing-SentenceItem_HL { + color: #f9690e; +} + .dictBing-SentenceSource { color: #999; } diff --git a/src/components/dictionaries/bing/engine.ts b/src/components/dictionaries/bing/engine.ts index b4381b4a2..2be28471c 100644 --- a/src/components/dictionaries/bing/engine.ts +++ b/src/components/dictionaries/bing/engine.ts @@ -1,8 +1,10 @@ import { fetchDirtyDOM } from '@/_helpers/fetch-dom' -import { handleNoResult } from '../helpers' +import { handleNoResult, getText, getInnerHTMLThunk } from '../helpers' import { AppConfig, DictConfigs } from '@/app-config' import { DictSearchResult } from '@/typings/server' +const getInnerHTML = getInnerHTMLThunk('https://cn.bing.com/') + const DICT_LINK = 'https://cn.bing.com/dict/clientsearch?mkt=zh-CN&setLang=zh&form=BDVEHC&ClientVer=BDDTV3.5.1.4320&q=' /** Lexical result */ @@ -154,13 +156,22 @@ function handleLexResult ( searchResult.result.sentences = $sens .map(el => { let mp3 = '' - let $audio = el.querySelector('.client_aud_o') + const $audio = el.querySelector('.client_aud_o') if ($audio) { mp3 = (($audio.getAttribute('onclick') || '').match(/https.*\.mp3/) || [''])[0] } + el.querySelectorAll('.client_sen_en_word').forEach($word => { + $word.outerHTML = getText($word) + }) + el.querySelectorAll('.client_sen_cn_word').forEach($word => { + $word.outerHTML = getText($word) + }) + el.querySelectorAll('.client_sentence_search').forEach($word => { + $word.outerHTML = `<span class="dictBing-SentenceItem_HL">${getText($word)}</span>` + }) return { - en: getText(el, '.client_sen_en'), - chs: getText(el, '.client_sen_cn'), + en: getInnerHTML(el, '.client_sen_en'), + chs: getInnerHTML(el, '.client_sen_cn'), source: getText(el, '.client_sentence_list_link'), mp3 } @@ -226,11 +237,3 @@ function handleRelatedResult ( } return handleNoResult() } - -function getText (el: ParentNode, childSelector: string): string { - let child = el.querySelector(childSelector) - if (child) { - return (child.textContent || '').trim() - } - return '' -}
feat
bing sentence highlight
ee20d4e4496ea947853099ffdddb4402ce897f83
2018-01-15 06:26:39
greenkeeper[bot]
chore(package): update react-dev-utils to version 5.0.0
false
diff --git a/package.json b/package.json index 54262cb53..bb93cebd6 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "postcss-loader": "2.0.10", "postcss-safe-important": "^1.1.0", "raf": "3.4.0", - "react-dev-utils": "^4.2.1", + "react-dev-utils": "^5.0.0", "sass-loader": "^6.0.6", "semver": "^5.4.1", "style-loader": "0.19.1",
chore
update react-dev-utils to version 5.0.0
32eb70a2ec4cc7b334dbc90a0ffb672ca54f7da7
2018-01-21 09:58:41
CRIMX
build(package): add conventional flow
false
diff --git a/README.md b/README.md index c5d671035..afda09453 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.org/crimx/ext-saladict.svg)](https://travis-ci.org/crimx/ext-saladict) [![Greenkeeper badge](https://badges.greenkeeper.io/crimx/ext-saladict.svg)](https://greenkeeper.io/) +[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) Chrome extension, feature-rich inline translator powered with mutiple online dictionaries. diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 000000000..a4f436977 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'] +} diff --git a/package.json b/package.json index ee77ee09a..d9dbd87cd 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,17 @@ { "name": "saladict", - "version": "0.1.0", + "version": "6.0.0", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": { "start": "node scripts/start.js", "build": "node scripts/build.js", "devbuild": "node scripts/build.js --devbuild", - "test": "node scripts/test.js --env=jsdom" + "test": "node scripts/test.js --env=jsdom", + "commit": "git-cz", + "release": "standard-version", + + "commitmsg": "commitlint -e $GIT_PARAMS" }, "engines": { "node": ">= 8.0.0", @@ -23,6 +27,11 @@ "bugs": { "url": "https://github.com/crimx/create-react-typescript-sass-webextension/issues" }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, "dependencies": { "@types/node": "^9.3.0", "@types/react": "^16.0.34", @@ -42,6 +51,8 @@ "webextension-polyfill": "^0.2.1" }, "devDependencies": { + "@commitlint/cli": "^6.0.2", + "@commitlint/config-conventional": "^6.0.2", "@types/jest": "^22.0.1", "@types/sinon-chrome": "^0.2.29", "autoprefixer": "7.2.5", @@ -54,8 +65,10 @@ "babel-runtime": "6.26.0", "case-sensitive-paths-webpack-plugin": "2.1.1", "chalk": "2.3.0", + "commitizen": "^2.9.6", "copy-webpack-plugin": "^4.3.1", "css-loader": "0.28.9", + "cz-conventional-changelog": "^2.1.0", "dotenv": "4.0.0", "extract-text-webpack-plugin": "3.0.2", "file-loader": "1.1.6", @@ -63,6 +76,7 @@ "fs-extra": "^5.0.0", "generate-json-webpack-plugin": "^0.2.2", "html-webpack-plugin": "2.30.1", + "husky": "^0.14.3", "jest": "^22.0.6", "jest-fetch-mock": "^1.4.0", "lodash": "^4.17.4", @@ -76,6 +90,7 @@ "sass-loader": "^6.0.6", "semver": "^5.4.1", "sinon-chrome": "^2.2.4", + "standard-version": "^4.3.0", "style-loader": "0.19.1", "text-transform-loader": "^2.0.0", "ts-jest": "^22.0.0", diff --git a/scripts/build.js b/scripts/build.js index 587da22b5..9c847c391 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -42,11 +42,6 @@ const useYarn = fs.existsSync(paths.yarnLockFile) const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024 const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024 -// 'patch' increases 1 on every build (but not devbuild) -if (!argv.devbuild) { - updateVerison() -} - // First, read the current file sizes in build directory. // This lets us display how much they changed later. measureFileSizesBeforeBuild(paths.appBuild) @@ -137,20 +132,10 @@ function build(previousFileSizes) { }) } -// Change version in 'common.manifest.json' -// 'patch' increases 1 on every build -function updateVerison () { - const manifestPath = require.resolve('../src/manifest/common.manifest.json') - const rawManifest = fs.readFileSync(manifestPath, 'utf8') - const manifest = JSON.parse(rawManifest) - const version = semver.valid(manifest.version) - if (!version) { throw new Error('Manifest version incorrect') } - fs.writeFileSync(manifestPath, rawManifest.replace(`"${manifest.version}"`, `"${semver.inc(version, 'patch')}"`)) -} - // Generate results for all browsers function generateByBrowser () { const commonManifest = require('../src/manifest/common.manifest.json') + const version = { version: require('../package.json').version } const files = fs.readdirSync(paths.appBuild) .map(name => ({name, path: path.join(paths.appBuild, name)})) @@ -164,7 +149,7 @@ function generateByBrowser () { // manifest fs.writeJson( path.join(dest, 'manifest.json'), - Object.assign({}, commonManifest, browserManifest), + Object.assign({}, commonManifest, browserManifest, version), { spaces: 2 }, ), // public assets diff --git a/src/manifest/common.manifest.json b/src/manifest/common.manifest.json index a366f4f27..21ca31fba 100644 --- a/src/manifest/common.manifest.json +++ b/src/manifest/common.manifest.json @@ -7,7 +7,6 @@ "short_name": "__MSG_extension_short_name__", "description": "__MSG_extension_description__", - "version": "0.0.0", "update_url": "https://clients2.google.com/service/update2/crx", "default_locale": "zh_CN", diff --git a/yarn.lock b/yarn.lock index c8e1fe277..8559eb3fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,6 +10,114 @@ esutils "^2.0.2" js-tokens "^3.0.0" +"@commitlint/cli@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/cli/-/cli-6.0.2.tgz#378d37e92c4d97346e84c3a3d6677a62e9471d66" + dependencies: + "@commitlint/core" "^6.0.2" + babel-polyfill "6.26.0" + chalk "2.3.0" + get-stdin "5.0.1" + lodash.merge "4.6.0" + lodash.pick "4.4.0" + meow "3.7.0" + +"@commitlint/config-conventional@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-6.0.2.tgz#8ef87a6facb75b3377b2760b0e91097f8ec64db4" + +"@commitlint/core@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/core/-/core-6.0.2.tgz#8e79e18d57ea3d30ca4bbfdf028d5f5d0cd3e422" + dependencies: + "@commitlint/execute-rule" "^6.0.2" + "@commitlint/is-ignored" "^6.0.2" + "@commitlint/parse" "^6.0.2" + "@commitlint/resolve-extends" "^6.0.2" + "@commitlint/rules" "^6.0.2" + "@commitlint/top-level" "^6.0.2" + "@marionebl/sander" "^0.6.0" + babel-runtime "^6.23.0" + chalk "^2.0.1" + cosmiconfig "^3.0.1" + git-raw-commits "^1.3.0" + lodash.merge "4.6.0" + lodash.mergewith "4.6.0" + lodash.pick "4.4.0" + lodash.topairs "4.3.0" + resolve-from "4.0.0" + +"@commitlint/ensure@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/ensure/-/ensure-6.0.2.tgz#31611fac3d3e67d574ae3808a3a91467fa83e3f4" + dependencies: + lodash.camelcase "4.3.0" + lodash.kebabcase "4.1.1" + lodash.snakecase "4.1.1" + lodash.startcase "4.4.0" + lodash.upperfirst "4.3.1" + +"@commitlint/execute-rule@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-6.0.2.tgz#764a10a5ad7055e5c1508f1c80be85a3d2c8668a" + dependencies: + babel-runtime "6.26.0" + +"@commitlint/is-ignored@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-6.0.2.tgz#3c48bd8473da6471259bb8fd5dbc49ac3ee5b150" + dependencies: + semver "5.4.1" + +"@commitlint/message@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/message/-/message-6.0.2.tgz#7003156700e14c692cbbc26ada8c5b5cb5986805" + +"@commitlint/parse@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/parse/-/parse-6.0.2.tgz#1978de35bd2e620a892511c4642779a83ad2400e" + dependencies: + conventional-changelog-angular "^1.3.3" + conventional-commits-parser "^2.1.0" + +"@commitlint/resolve-extends@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-6.0.2.tgz#1937640053f3a865490aeac97b2efac66dbe9a96" + dependencies: + babel-runtime "6.26.0" + lodash.merge "4.6.0" + lodash.omit "4.5.0" + require-uncached "^1.0.3" + resolve-from "^4.0.0" + resolve-global "^0.1.0" + +"@commitlint/rules@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/rules/-/rules-6.0.2.tgz#11fee4bc134ba6e9da261685a1653d86fcae7771" + dependencies: + "@commitlint/ensure" "^6.0.2" + "@commitlint/message" "^6.0.2" + "@commitlint/to-lines" "^6.0.2" + babel-runtime "^6.23.0" + +"@commitlint/to-lines@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-6.0.2.tgz#be76792eae6f2446de1d9e15b20b3e3b990c838b" + +"@commitlint/top-level@^6.0.2": + version "6.0.2" + resolved "https://registry.npmjs.org/@commitlint/top-level/-/top-level-6.0.2.tgz#fffc584d7275868b884439e5ab02969dee3d62f5" + dependencies: + find-up "^2.1.0" + +"@marionebl/sander@^0.6.0": + version "0.6.1" + resolved "https://registry.npmjs.org/@marionebl/sander/-/sander-0.6.1.tgz#1958965874f24bc51be48875feb50d642fc41f7b" + dependencies: + graceful-fs "^4.1.3" + mkdirp "^0.5.1" + rimraf "^2.5.2" + "@types/chrome@*": version "0.0.58" resolved "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.58.tgz#adf75cecfd29cd2923b019315bc2ea2ac1b49962" @@ -64,6 +172,13 @@ version "0.0.30" resolved "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" +JSONStream@^1.0.4: + version "1.3.2" + resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + abab@^1.0.3: version "1.0.4" resolved "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" @@ -139,6 +254,10 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-escapes@^1.1.0: + version "1.4.0" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + ansi-escapes@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" @@ -240,6 +359,10 @@ array-flatten@^2.1.0: version "2.1.1" resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.1.tgz#426bb9da84090c1838d812c8150af20a8331e296" +array-ify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + array-includes@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" @@ -867,6 +990,14 @@ babel-plugin-transform-vue-jsx@^3.5.0: dependencies: esutils "^2.0.2" [email protected]: + version "6.26.0" + resolved "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + babel-preset-env@^1.6.0, babel-preset-env@^1.6.1: version "1.6.1" resolved "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48" @@ -960,7 +1091,7 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" [email protected], babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0, babel-runtime@^6.9.2: [email protected], babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0, babel-runtime@^6.9.2: version "6.26.0" resolved "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: @@ -1293,6 +1424,22 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cachedir@^1.1.0: + version "1.2.0" + resolved "https://registry.npmjs.org/cachedir/-/cachedir-1.2.0.tgz#e9a0a25bb21a2b7a0f766f07c41eb7a311919b97" + dependencies: + os-homedir "^1.0.1" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + callsites@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" @@ -1363,7 +1510,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" [email protected], chalk@^1.1.1, chalk@^1.1.3: [email protected], chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1453,6 +1600,12 @@ [email protected]: dependencies: source-map "0.5.x" +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -1575,10 +1728,37 @@ commander@^2.12.1, commander@^2.9.0, commander@~2.13.0: version "2.13.0" resolved "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" +commitizen@^2.9.6: + version "2.9.6" + resolved "https://registry.npmjs.org/commitizen/-/commitizen-2.9.6.tgz#c0d00535ef264da7f63737edfda4228983fa2291" + dependencies: + cachedir "^1.1.0" + chalk "1.1.3" + cz-conventional-changelog "1.2.0" + dedent "0.6.0" + detect-indent "4.0.0" + find-node-modules "1.0.4" + find-root "1.0.0" + fs-extra "^1.0.0" + glob "7.1.1" + inquirer "1.2.3" + lodash "4.17.2" + minimist "1.2.0" + path-exists "2.1.0" + shelljs "0.7.6" + strip-json-comments "2.0.1" + commondir@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" +compare-func@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" + dependencies: + array-ify "^1.0.0" + dot-prop "^3.0.0" + component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" @@ -1605,7 +1785,7 @@ [email protected]: version "0.0.1" resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.5.0: +concat-stream@^1.4.10, concat-stream@^1.4.7, concat-stream@^1.5.0: version "1.6.0" resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -1656,6 +1836,145 @@ content-type@~1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" +conventional-changelog-angular@^1.3.3, conventional-changelog-angular@^1.5.2: + version "1.6.0" + resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.0.tgz#0a26a071f2c9fcfcf2b86ba0cfbf6e6301b75bfa" + dependencies: + compare-func "^1.3.1" + q "^1.4.1" + +conventional-changelog-atom@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-0.1.2.tgz#12595ad5267a6937c34cf900281b1c65198a4c63" + dependencies: + q "^1.4.1" + +conventional-changelog-codemirror@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.2.1.tgz#299a4f7147baf350e6c8158fc54954a291c5cc09" + dependencies: + q "^1.4.1" + +conventional-changelog-core@^1.9.3: + version "1.9.5" + resolved "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-1.9.5.tgz#5db7566dad7c0cb75daf47fbb2976f7bf9928c1d" + dependencies: + conventional-changelog-writer "^2.0.3" + conventional-commits-parser "^2.1.0" + dateformat "^1.0.12" + get-pkg-repo "^1.0.0" + git-raw-commits "^1.3.0" + git-remote-origin-url "^2.0.0" + git-semver-tags "^1.2.3" + lodash "^4.0.0" + normalize-package-data "^2.3.5" + q "^1.4.1" + read-pkg "^1.1.0" + read-pkg-up "^1.0.1" + through2 "^2.0.0" + +conventional-changelog-ember@^0.2.9: + version "0.2.10" + resolved "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-0.2.10.tgz#dcd6e4cdc2e6c2b58653cf4d2cb1656a60421929" + dependencies: + q "^1.4.1" + +conventional-changelog-eslint@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-0.2.1.tgz#2c2a11beb216f80649ba72834180293b687c0662" + dependencies: + q "^1.4.1" + +conventional-changelog-express@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-0.2.1.tgz#838d9e1e6c9099703b150b9c19aa2d781742bd6c" + dependencies: + q "^1.4.1" + +conventional-changelog-jquery@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz#0208397162e3846986e71273b6c79c5b5f80f510" + dependencies: + q "^1.4.1" + +conventional-changelog-jscs@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz#0479eb443cc7d72c58bf0bcf0ef1d444a92f0e5c" + dependencies: + q "^1.4.1" + +conventional-changelog-jshint@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-0.2.1.tgz#86139bb3ac99899f2b177e9617e09b37d99bcf3a" + dependencies: + compare-func "^1.3.1" + q "^1.4.1" + +conventional-changelog-writer@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-2.0.3.tgz#073b0c39f1cc8fc0fd9b1566e93833f51489c81c" + dependencies: + compare-func "^1.3.1" + conventional-commits-filter "^1.1.1" + dateformat "^1.0.11" + handlebars "^4.0.2" + json-stringify-safe "^5.0.1" + lodash "^4.0.0" + meow "^3.3.0" + semver "^5.0.1" + split "^1.0.0" + through2 "^2.0.0" + +conventional-changelog@^1.1.0: + version "1.1.7" + resolved "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-1.1.7.tgz#9151a62b1d8edb2d82711dabf5b7cf71041f82b1" + dependencies: + conventional-changelog-angular "^1.5.2" + conventional-changelog-atom "^0.1.2" + conventional-changelog-codemirror "^0.2.1" + conventional-changelog-core "^1.9.3" + conventional-changelog-ember "^0.2.9" + conventional-changelog-eslint "^0.2.1" + conventional-changelog-express "^0.2.1" + conventional-changelog-jquery "^0.1.0" + conventional-changelog-jscs "^0.1.0" + conventional-changelog-jshint "^0.2.1" + +conventional-commit-types@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz#5db95739d6c212acbe7b6f656a11b940baa68946" + +conventional-commits-filter@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.1.1.tgz#72172319c0c88328a015b30686b55527b3a5e54a" + dependencies: + is-subset "^0.1.1" + modify-values "^1.0.0" + +conventional-commits-parser@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.0.tgz#9b4b7c91124bf2a1a9a2cc1c72760d382cbbb229" + dependencies: + JSONStream "^1.0.4" + is-text-path "^1.0.0" + lodash "^4.2.1" + meow "^3.3.0" + split2 "^2.0.0" + through2 "^2.0.0" + trim-off-newlines "^1.0.0" + +conventional-recommended-bump@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-1.1.0.tgz#964d4fcc70fb5259d41fa9b39d3df6afdb87d253" + dependencies: + concat-stream "^1.4.10" + conventional-commits-filter "^1.1.1" + conventional-commits-parser "^2.1.0" + git-raw-commits "^1.3.0" + git-semver-tags "^1.2.3" + meow "^3.3.0" + object-assign "^4.0.1" + convert-source-map@^1.4.0, convert-source-map@^1.5.0: version "1.5.1" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" @@ -1722,6 +2041,15 @@ cosmiconfig@^2.1.0, cosmiconfig@^2.1.1: parse-json "^2.2.0" require-from-string "^1.1.0" +cosmiconfig@^3.0.1: + version "3.1.0" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-3.1.0.tgz#640a94bf9847f321800403cd273af60665c73397" + dependencies: + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^3.0.0" + require-from-string "^2.0.1" + cpx@^1.5.0: version "1.5.0" resolved "https://registry.npmjs.org/cpx/-/cpx-1.5.0.tgz#185be018511d87270dedccc293171e37655ab88f" @@ -1820,7 +2148,7 @@ [email protected]: [email protected]: version "0.28.9" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.9.tgz#68064b85f4e271d7ce4c48a58300928e535d1c95" + resolved "https://registry.npmjs.org/css-loader/-/css-loader-0.28.9.tgz#68064b85f4e271d7ce4c48a58300928e535d1c95" dependencies: babel-code-frame "^6.26.0" css-selector-tokenizer "^0.7.0" @@ -1926,12 +2254,39 @@ cyclist@~0.2.2: version "0.2.2" resolved "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" [email protected]: + version "1.2.0" + resolved "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-1.2.0.tgz#2bca04964c8919b23f3fd6a89ef5e6008b31b3f8" + dependencies: + conventional-commit-types "^2.0.0" + lodash.map "^4.5.1" + longest "^1.0.1" + pad-right "^0.2.2" + right-pad "^1.0.1" + word-wrap "^1.0.3" + +cz-conventional-changelog@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-2.1.0.tgz#2f4bc7390e3244e4df293e6ba351e4c740a7c764" + dependencies: + conventional-commit-types "^2.0.0" + lodash.map "^4.5.1" + longest "^1.0.1" + right-pad "^1.0.1" + word-wrap "^1.0.3" + d@1: version "1.0.0" resolved "https://registry.npmjs.org/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" dependencies: es5-ext "^0.10.9" +dargs@^4.0.1: + version "4.1.0" + resolved "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" + dependencies: + number-is-nan "^1.0.0" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1942,6 +2297,13 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" +dateformat@^1.0.11, dateformat@^1.0.12: + version "1.0.12" + resolved "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" + dependencies: + get-stdin "^4.0.1" + meow "^3.3.0" + de-indent@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" @@ -1966,6 +2328,10 @@ decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" [email protected]: + version "0.6.0" + resolved "https://registry.npmjs.org/dedent/-/dedent-0.6.0.tgz#0e6da8f0ce52838ef5cec5c8f9396b0c1b64a3cb" + deep-equal@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -2045,7 +2411,13 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" -detect-indent@^4.0.0: +detect-file@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz#4935dedfd9488648e006b0129566e9386711ea63" + dependencies: + fs-exists-sync "^0.1.0" + [email protected], detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" dependencies: @@ -2161,10 +2533,23 @@ [email protected]: dom-serializer "0" domelementtype "1" +dot-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" + dependencies: + is-obj "^1.0.0" + [email protected]: version "4.0.0" resolved "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d" +dotgitignore@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/dotgitignore/-/dotgitignore-1.0.3.tgz#a442cbde7dc20dff51cdb849e4c5a64568c07923" + dependencies: + find-up "^2.1.0" + minimatch "^3.0.4" + duplexer@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -2253,7 +2638,7 @@ errno@^0.1.3, errno@^0.1.4: dependencies: prr "~1.0.1" -error-ex@^1.2.0: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: @@ -2438,6 +2823,10 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + exit@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -2466,6 +2855,12 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +expand-tilde@^1.2.2: + version "1.2.2" + resolved "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" + dependencies: + os-homedir "^1.0.1" + expand-tilde@^2.0.0, expand-tilde@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" @@ -2531,10 +2926,18 @@ extend-shallow@^3.0.0: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.0, extend@~3.0.1: +extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +external-editor@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-1.1.1.tgz#12d7b0db850f7ff7e7081baf4005700060c4600b" + dependencies: + extend "^3.0.0" + spawn-sync "^1.0.15" + tmp "^0.0.29" + external-editor@^2.0.4: version "2.1.0" resolved "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" @@ -2625,6 +3028,13 @@ fbjs@^0.8.16: setimmediate "^1.0.5" ua-parser-js "^0.7.9" +figures@^1.3.5, figures@^1.5.0: + version "1.7.0" + resolved "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + figures@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -2703,6 +3113,17 @@ find-index@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" [email protected]: + version "1.0.4" + resolved "https://registry.npmjs.org/find-node-modules/-/find-node-modules-1.0.4.tgz#b6deb3cccb699c87037677bcede2c5f5862b2550" + dependencies: + findup-sync "0.4.2" + merge "^1.2.0" + [email protected]: + version "1.0.0" + resolved "https://registry.npmjs.org/find-root/-/find-root-1.0.0.tgz#962ff211aab25c6520feeeb8d6287f8f6e95807a" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -2716,6 +3137,15 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" [email protected]: + version "0.4.2" + resolved "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.2.tgz#a8117d0f73124f5a4546839579fe52d7129fb5e5" + dependencies: + detect-file "^0.1.0" + is-glob "^2.0.1" + micromatch "^2.3.7" + resolve-dir "^0.1.0" + findup-sync@~0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz#37930aa5d816b777c03445e1966cc6790a4c0b16" @@ -2819,6 +3249,16 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +fs-access@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" + dependencies: + null-check "^1.0.0" + +fs-exists-sync@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" + [email protected]: version "4.0.3" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" @@ -2827,6 +3267,14 @@ [email protected]: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + fs-extra@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" @@ -2913,6 +3361,20 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" +get-pkg-repo@^1.0.0: + version "1.4.0" + resolved "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" + dependencies: + hosted-git-info "^2.1.4" + meow "^3.3.0" + normalize-package-data "^2.3.0" + parse-github-repo-url "^1.3.0" + through2 "^2.0.0" + [email protected]: + version "5.0.1" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" @@ -2931,6 +3393,36 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +git-raw-commits@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.0.tgz#0bc8596e90d5ffe736f7f5546bd2d12f73abaac6" + dependencies: + dargs "^4.0.1" + lodash.template "^4.0.2" + meow "^3.3.0" + split2 "^2.0.0" + through2 "^2.0.0" + +git-remote-origin-url@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" + dependencies: + gitconfiglocal "^1.0.0" + pify "^2.3.0" + +git-semver-tags@^1.2.3: + version "1.2.3" + resolved "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.2.3.tgz#188b453882bf9d7a23afd31baba537dab7388d5d" + dependencies: + meow "^3.3.0" + semver "^5.0.1" + +gitconfiglocal@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" + dependencies: + ini "^1.3.2" + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -2957,6 +3449,17 @@ glob2base@^0.0.12: dependencies: find-index "^0.1.1" [email protected]: + version "7.1.1" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@^6.0.4: version "6.0.4" resolved "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -2988,6 +3491,12 @@ glob@~5.0.0: once "^1.3.0" path-is-absolute "^1.0.0" +global-dirs@^0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + dependencies: + ini "^1.3.4" + [email protected], global-modules@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -2996,6 +3505,22 @@ [email protected], global-modules@^1.0.0: is-windows "^1.0.1" resolve-dir "^1.0.0" +global-modules@^0.2.3: + version "0.2.3" + resolved "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" + dependencies: + global-prefix "^0.1.4" + is-windows "^0.2.0" + +global-prefix@^0.1.4: + version "0.1.5" + resolved "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz#8d3bc6b8da3ca8112a160d8d496ff0462bfef78f" + dependencies: + homedir-polyfill "^1.0.0" + ini "^1.3.4" + is-windows "^0.2.0" + which "^1.2.12" + global-prefix@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" @@ -3039,7 +3564,7 @@ globule@^1.0.0: lodash "~4.17.4" minimatch "~3.0.2" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -3057,7 +3582,7 @@ handle-thing@^1.2.5: version "1.2.5" resolved "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" -handlebars@^4.0.3: +handlebars@^4.0.2, handlebars@^4.0.3: version "4.0.11" resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" dependencies: @@ -3222,7 +3747,7 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" -homedir-polyfill@^1.0.1: +homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" dependencies: @@ -3351,6 +3876,14 @@ https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" +husky@^0.14.3: + version "0.14.3" + resolved "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" + dependencies: + is-ci "^1.0.10" + normalize-path "^1.0.0" + strip-indent "^2.0.0" + [email protected], iconv-lite@^0.4.17, iconv-lite@~0.4.13: version "0.4.19" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -3421,10 +3954,29 @@ [email protected]: version "2.0.1" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" -ini@^1.3.4, ini@~1.3.0: +ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" [email protected]: + version "1.2.3" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-1.2.3.tgz#4dec6f32f37ef7bb0b2ed3f1d1a5c3f545074918" + dependencies: + ansi-escapes "^1.1.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + external-editor "^1.1.0" + figures "^1.3.5" + lodash "^4.3.0" + mute-stream "0.0.6" + pinkie-promise "^2.0.0" + run-async "^2.2.0" + rx "^4.1.0" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + [email protected]: version "3.3.0" resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" @@ -3641,6 +4193,10 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + is-odd@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-odd/-/is-odd-1.0.0.tgz#3b8a932eb028b3775c39bb09e91767accdb69088" @@ -3703,6 +4259,10 @@ is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + is-svg@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" @@ -3713,6 +4273,12 @@ is-symbol@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" +is-text-path@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + dependencies: + text-extensions "^1.0.0" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -3721,6 +4287,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" + is-windows@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9" @@ -3825,15 +4395,15 @@ istanbul-reports@^1.1.3: dependencies: handlebars "^4.0.3" -jest-changed-files@^22.1.0: - version "22.1.0" - resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-22.1.0.tgz#586a6164b87255dbd541a8bab880d98f14c99b7d" +jest-changed-files@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-22.1.4.tgz#1f7844bcb739dec07e5899a633c0cb6d5069834e" dependencies: throat "^4.0.0" -jest-cli@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-22.1.2.tgz#89497932d7befb8a6952f2712473695c4bbef43f" +jest-cli@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-22.1.4.tgz#0fe9f3ac881b0cdc00227114c58583a2ebefcc04" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -3846,18 +4416,18 @@ jest-cli@^22.1.2: istanbul-lib-coverage "^1.1.1" istanbul-lib-instrument "^1.8.0" istanbul-lib-source-maps "^1.2.1" - jest-changed-files "^22.1.0" - jest-config "^22.1.2" - jest-environment-jsdom "^22.1.2" + jest-changed-files "^22.1.4" + jest-config "^22.1.4" + jest-environment-jsdom "^22.1.4" jest-get-type "^22.1.0" jest-haste-map "^22.1.0" jest-message-util "^22.1.0" jest-regex-util "^22.1.0" jest-resolve-dependencies "^22.1.0" - jest-runner "^22.1.2" - jest-runtime "^22.1.2" + jest-runner "^22.1.4" + jest-runtime "^22.1.4" jest-snapshot "^22.1.2" - jest-util "^22.1.2" + jest-util "^22.1.4" jest-worker "^22.1.0" micromatch "^2.3.11" node-notifier "^5.1.2" @@ -3869,19 +4439,19 @@ jest-cli@^22.1.2: which "^1.2.12" yargs "^10.0.3" -jest-config@^22.0.1, jest-config@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-config/-/jest-config-22.1.2.tgz#d3aee5c1df0997f0e2ae5c707eee04a7c87f1653" +jest-config@^22.0.1, jest-config@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-config/-/jest-config-22.1.4.tgz#075ffacce83c3e38cf85b1b9ba0d21bd3ee27ad0" dependencies: chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^22.1.2" - jest-environment-node "^22.1.2" + jest-environment-jsdom "^22.1.4" + jest-environment-node "^22.1.4" jest-get-type "^22.1.0" - jest-jasmine2 "^22.1.2" + jest-jasmine2 "^22.1.4" jest-regex-util "^22.1.0" - jest-resolve "^22.1.0" - jest-util "^22.1.2" + jest-resolve "^22.1.4" + jest-util "^22.1.4" jest-validate "^22.1.2" pretty-format "^22.1.0" @@ -3900,20 +4470,20 @@ jest-docblock@^22.1.0: dependencies: detect-newline "^2.1.0" -jest-environment-jsdom@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-22.1.2.tgz#4488c629631dd5de9059ec747fcd358735247f70" +jest-environment-jsdom@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-22.1.4.tgz#704518ce8375f7ec5de048d1e9c4268b08a03e00" dependencies: jest-mock "^22.1.0" - jest-util "^22.1.2" + jest-util "^22.1.4" jsdom "^11.5.1" -jest-environment-node@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-22.1.2.tgz#77dc32fbe08caa03ef2acb0948dce4b25a14633a" +jest-environment-node@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-22.1.4.tgz#0f2946e8f8686ce6c5d8fa280ce1cd8d58e869eb" dependencies: jest-mock "^22.1.0" - jest-util "^22.1.2" + jest-util "^22.1.4" jest-fetch-mock@^1.4.0: version "1.4.0" @@ -3936,9 +4506,9 @@ jest-haste-map@^22.1.0: micromatch "^2.3.11" sane "^2.0.0" -jest-jasmine2@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-22.1.2.tgz#dee4ba04fb2cf462e4c7cfb499426e82e8fde5ac" +jest-jasmine2@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-22.1.4.tgz#cada0baf50a220c616a9575728b80d4ddedebe8b" dependencies: callsites "^2.0.0" chalk "^2.0.1" @@ -3990,32 +4560,32 @@ jest-resolve-dependencies@^22.1.0: dependencies: jest-regex-util "^22.1.0" -jest-resolve@^22.1.0: - version "22.1.0" - resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-22.1.0.tgz#5f4307f48b93c1abdbeacc9ed80642ffcb246294" +jest-resolve@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-22.1.4.tgz#72b9b371eaac48f84aad4ad732222ffe37692602" dependencies: browser-resolve "^1.11.2" chalk "^2.0.1" -jest-runner@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-22.1.2.tgz#e8565e4eb56c27219352b8486338ced9ceb462da" +jest-runner@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-22.1.4.tgz#e039039110cb1b31febc0f99e349bf7c94304a2f" dependencies: exit "^0.1.2" - jest-config "^22.1.2" + jest-config "^22.1.4" jest-docblock "^22.1.0" jest-haste-map "^22.1.0" - jest-jasmine2 "^22.1.2" + jest-jasmine2 "^22.1.4" jest-leak-detector "^22.1.0" jest-message-util "^22.1.0" - jest-runtime "^22.1.2" - jest-util "^22.1.2" + jest-runtime "^22.1.4" + jest-util "^22.1.4" jest-worker "^22.1.0" throat "^4.0.0" -jest-runtime@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-22.1.2.tgz#42755d7cea2ffc7cdaa7f2dfa8736264a6057bf9" +jest-runtime@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-22.1.4.tgz#1474d9f5cda518b702e0b25a17d4ef3fc563a20c" dependencies: babel-core "^6.0.0" babel-jest "^22.1.0" @@ -4024,11 +4594,11 @@ jest-runtime@^22.1.2: convert-source-map "^1.4.0" exit "^0.1.2" graceful-fs "^4.1.11" - jest-config "^22.1.2" + jest-config "^22.1.4" jest-haste-map "^22.1.0" jest-regex-util "^22.1.0" - jest-resolve "^22.1.0" - jest-util "^22.1.2" + jest-resolve "^22.1.4" + jest-util "^22.1.4" json-stable-stringify "^1.0.1" micromatch "^2.3.11" realpath-native "^1.0.0" @@ -4048,9 +4618,9 @@ jest-snapshot@^22.1.2: natural-compare "^1.4.0" pretty-format "^22.1.0" -jest-util@^22.1.2: - version "22.1.2" - resolved "https://registry.npmjs.org/jest-util/-/jest-util-22.1.2.tgz#4bf098f651e8611d744cefa23fa026c97a6a3d5d" +jest-util@^22.1.4: + version "22.1.4" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-22.1.4.tgz#ac8cbd43ee654102f1941f3f0e9d1d789a8b6a9b" dependencies: callsites "^2.0.0" chalk "^2.0.1" @@ -4076,10 +4646,10 @@ jest-worker@^22.1.0: merge-stream "^1.0.1" jest@^22.0.6: - version "22.1.2" - resolved "https://registry.npmjs.org/jest/-/jest-22.1.2.tgz#54dce0f4946a089a00d5fdac8291d5926e24f6ab" + version "22.1.4" + resolved "https://registry.npmjs.org/jest/-/jest-22.1.4.tgz#9ec71373a38f40ff92a3e5e96ae85687c181bb72" dependencies: - jest-cli "^22.1.2" + jest-cli "^22.1.4" js-base64@^2.1.8, js-base64@^2.1.9: version "2.4.1" @@ -4098,7 +4668,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.4.3, js-yaml@^3.7.0: +js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.0: version "3.10.0" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -4171,7 +4741,7 @@ json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -4183,6 +4753,12 @@ json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -4193,6 +4769,10 @@ jsonify@~0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + jsonpointer@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" @@ -4236,6 +4816,12 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + optionalDependencies: + graceful-fs "^4.1.9" + lazy-cache@^0.2.3: version "0.2.7" resolved "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz#7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65" @@ -4318,11 +4904,15 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + lodash.assign@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" -lodash.camelcase@^4.3.0: [email protected], lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -4342,18 +4932,46 @@ lodash.isstring@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" [email protected]: + version "4.1.1" + resolved "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" + +lodash.map@^4.5.1: + version "4.6.0" + resolved "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" + lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" -lodash.mergewith@^4.6.0: [email protected]: + version "4.6.0" + resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" + [email protected], lodash.mergewith@^4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55" [email protected]: + version "4.5.0" + resolved "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60" + [email protected]: + version "4.4.0" + resolved "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + [email protected]: + version "4.1.1" + resolved "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" [email protected]: + version "4.4.0" + resolved "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" + lodash.startswith@^4.2.1: version "4.2.1" resolved "https://registry.npmjs.org/lodash.startswith/-/lodash.startswith-4.2.1.tgz#c598c4adce188a27e53145731cdc6c0e7177600c" @@ -4362,11 +4980,36 @@ lodash.tail@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" +lodash.template@^4.0.2: + version "4.4.0" + resolved "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + dependencies: + lodash._reinterpolate "~3.0.0" + [email protected]: + version "4.3.0" + resolved "https://registry.npmjs.org/lodash.topairs/-/lodash.topairs-4.3.0.tgz#3b6deaa37d60fb116713c46c5f17ea190ec48d64" + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" [email protected], lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.16.3, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.4: [email protected]: + version "4.3.1" + resolved "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" + [email protected]: + version "4.17.2" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" + [email protected], lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.16.3, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.4: version "4.17.4" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -4470,7 +5113,7 @@ memory-fs@^0.4.0, memory-fs@~0.4.1: errno "^0.1.3" readable-stream "^2.0.1" -meow@^3.3.0, meow@^3.7.0: [email protected], meow@^3.3.0, meow@^3.7.0: version "3.7.0" resolved "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" dependencies: @@ -4495,7 +5138,7 @@ merge-stream@^1.0.1: dependencies: readable-stream "^2.0.1" -merge@^1.1.3: +merge@^1.1.3, merge@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" @@ -4503,7 +5146,7 @@ methods@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" -micromatch@^2.1.5, micromatch@^2.3.11: +micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: version "2.3.11" resolved "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -4596,7 +5239,7 @@ [email protected]: version "0.0.8" resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: [email protected], minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -4639,6 +5282,10 @@ [email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkd dependencies: minimist "0.0.8" +modify-values@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2" + moment@^2.20.1: version "2.20.1" resolved "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd" @@ -4669,6 +5316,10 @@ multicast-dns@^6.0.1: dns-packet "^1.0.1" thunky "^0.1.0" [email protected]: + version "0.0.6" + resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db" + [email protected]: version "0.0.7" resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -4847,7 +5498,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: +normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5: version "2.4.0" resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" dependencies: @@ -4856,6 +5507,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" +normalize-path@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -4900,6 +5555,10 @@ nth-check@~1.0.1: dependencies: boolbase "~1.0.0" +null-check@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" + num2fraction@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" @@ -4978,6 +5637,10 @@ once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0: dependencies: wrappy "1" +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + onetime@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" @@ -5036,7 +5699,11 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: +os-shim@^0.1.2: + version "0.1.3" + resolved "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -5071,6 +5738,12 @@ p-try@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" +pad-right@^0.2.2: + version "0.2.2" + resolved "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774" + dependencies: + repeat-string "^1.5.2" + pako@~1.0.5: version "1.0.6" resolved "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" @@ -5099,6 +5772,10 @@ parse-asn1@^5.0.0: evp_bytestokey "^1.0.0" pbkdf2 "^3.0.3" +parse-github-repo-url@^1.3.0: + version "1.4.1" + resolved "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" + parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -5114,6 +5791,12 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-json@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13" + dependencies: + error-ex "^1.3.1" + parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -5140,7 +5823,7 @@ path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" -path-exists@^2.0.0: [email protected], path-exists@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" dependencies: @@ -5214,7 +5897,7 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" -pify@^2.0.0: +pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -5416,7 +6099,7 @@ postcss-minify-selectors@^2.0.4: postcss-modules-extract-imports@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz#66140ecece38ef06bf0d3e355d69bf59d141ea85" + resolved "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz#66140ecece38ef06bf0d3e355d69bf59d141ea85" dependencies: postcss "^6.0.1" @@ -5667,7 +6350,7 @@ punycode@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" -q@^1.1.2: +q@^1.1.2, q@^1.4.1: version "1.5.1" resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -5813,7 +6496,7 @@ read-pkg-up@^2.0.0: find-up "^2.0.0" read-pkg "^2.0.0" -read-pkg@^1.0.0: +read-pkg@^1.0.0, read-pkg@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" dependencies: @@ -5865,6 +6548,12 @@ realpath-native@^1.0.0: dependencies: util.promisify "^1.0.0" +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + [email protected]: version "2.2.1" resolved "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.1.tgz#90ef231d0778c5ce093c9a48d74e5c5422d13a99" @@ -5896,6 +6585,10 @@ regenerate@^1.2.1: version "1.3.3" resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -6079,10 +6772,21 @@ require-from-string@^1.1.0: version "1.2.1" resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" +require-from-string@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" + require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + [email protected], [email protected], requires-port@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -6093,6 +6797,13 @@ resolve-cwd@^2.0.0: dependencies: resolve-from "^3.0.0" +resolve-dir@^0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e" + dependencies: + expand-tilde "^1.2.2" + global-modules "^0.2.3" + resolve-dir@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" @@ -6100,10 +6811,24 @@ resolve-dir@^1.0.0: expand-tilde "^2.0.0" global-modules "^1.0.0" [email protected], resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" +resolve-global@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/resolve-global/-/resolve-global-0.1.0.tgz#8fb02cfd5b7db20118e886311f15af95bd15fbd9" + dependencies: + global-dirs "^0.1.0" + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -6112,12 +6837,19 @@ [email protected]: version "1.1.7" resolved "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.7, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0: version "1.5.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: path-parse "^1.0.5" +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -6131,7 +6863,11 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +right-pad@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" + +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -6166,6 +6902,10 @@ rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" +rx@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" + [email protected], safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -6245,6 +6985,10 @@ selfsigned@^1.9.1: version "5.5.0" resolved "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" [email protected]: + version "5.4.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + semver@~5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -6371,6 +7115,14 @@ [email protected], shell-quote@^1.6.1: array-reduce "~0.0.0" jsonify "~0.0.0" [email protected]: + version "0.7.6" + resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -6496,8 +7248,8 @@ source-map-support@^0.4.15: source-map "^0.5.6" source-map-support@^0.5.0: - version "0.5.1" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.1.tgz#72291517d1fd0cb9542cee6c27520884b5da1a07" + version "0.5.2" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.2.tgz#1a6297fd5b2e762b39688c7fc91233b60984f0a5" dependencies: source-map "^0.6.0" @@ -6519,6 +7271,13 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" +spawn-sync@^1.0.15: + version "1.0.15" + resolved "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476" + dependencies: + concat-stream "^1.4.7" + os-shim "^0.1.2" + spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -6562,6 +7321,18 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +split2@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" + dependencies: + through2 "^2.0.2" + +split@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" + dependencies: + through "2" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -6581,8 +7352,8 @@ sshpk@^1.7.0: tweetnacl "~0.14.0" ssri@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/ssri/-/ssri-5.0.0.tgz#13c19390b606c821f2a10d02b351c1729b94d8cf" + version "5.1.0" + resolved "https://registry.npmjs.org/ssri/-/ssri-5.1.0.tgz#2cbf1df36b74d0fc91fcf89640a4b3e1d10b1899" dependencies: safe-buffer "^5.1.0" @@ -6590,6 +7361,19 @@ stack-utils@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" +standard-version@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/standard-version/-/standard-version-4.3.0.tgz#41006cfee4eeab7c0ff3a47eecaa4c7506ed2e3f" + dependencies: + chalk "^1.1.3" + conventional-changelog "^1.1.0" + conventional-recommended-bump "^1.0.0" + dotgitignore "^1.0.3" + figures "^1.5.0" + fs-access "^1.0.0" + semver "^5.1.0" + yargs "^8.0.1" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -6715,7 +7499,11 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: +strip-indent@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + [email protected], strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -6813,6 +7601,10 @@ [email protected]: version "0.6.4" resolved "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" +text-extensions@^1.0.0: + version "1.7.0" + resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.7.0.tgz#faaaba2625ed746d568a23e4d0aacd9bf08a8b39" + [email protected]: version "0.2.0" resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -6827,14 +7619,14 @@ throat@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" -through2@^2.0.0: +through2@^2.0.0, through2@^2.0.2: version "2.0.3" resolved "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" dependencies: readable-stream "^2.1.5" xtend "~4.0.1" -through@^2.3.6: +through@2, "through@>=2.2.7 <3", through@^2.3.6: version "2.3.8" resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -6852,6 +7644,12 @@ timers-browserify@^2.0.4: dependencies: setimmediate "^1.0.4" +tmp@^0.0.29: + version "0.0.29" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz#f25125ff0dd9da3ccb0c2dd371ee1288bb9128c0" + dependencies: + os-tmpdir "~1.0.1" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -6911,6 +7709,10 @@ trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" +trim-off-newlines@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" + trim-right@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" @@ -6968,8 +7770,8 @@ tsconfig@^7.0.0: strip-json-comments "^2.0.0" tslib@^1.0.0, tslib@^1.8.0, tslib@^1.8.1: - version "1.8.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.8.1.tgz#6946af2d1d651a7b1863b531d6e5afa41aa44eac" + version "1.9.0" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" tslint-config-standard@^7.0.0: version "7.0.0" @@ -7037,8 +7839,8 @@ type-check@~0.3.2: prelude-ls "~1.1.2" type-detect@^4.0.0: - version "4.0.6" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.6.tgz#88cbce3d13bc675a63f840b3225c180f870786d7" + version "4.0.7" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.7.tgz#862bd2cf6058ad92799ff5a5b8cf7b6cec726198" type-is@~1.6.15: version "1.6.15" @@ -7402,7 +8204,7 @@ [email protected]: [email protected]: version "2.11.1" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.11.1.tgz#6f9358a002db8403f016e336816f4485384e5ec0" + resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.11.1.tgz#6f9358a002db8403f016e336816f4485384e5ec0" dependencies: ansi-html "0.0.7" array-includes "^3.0.3" @@ -7523,6 +8325,10 @@ [email protected]: version "0.1.0" resolved "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +word-wrap@^1.0.3: + version "1.2.3" + resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + [email protected]: version "0.0.2" resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" @@ -7658,7 +8464,7 @@ yargs@^7.0.0: y18n "^3.2.1" yargs-parser "^5.0.0" -yargs@^8.0.2: +yargs@^8.0.1, yargs@^8.0.2: version "8.0.2" resolved "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" dependencies:
build
add conventional flow
9f474ee4098e0624282e91d5f935fbe503c20833
2019-09-29 14:27:03
crimx
docs: update saladict 7 features
false
diff --git a/README.md b/README.md index f89c7dd83..a13db6ce4 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,7 @@ [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?maxAge=2592000)](https://standardjs.com/) [![License](https://img.shields.io/github/license/crimx/ext-saladict.svg?colorB=44cc11?maxAge=2592000)](https://github.com/crimx/ext-saladict/blob/dev/LICENSE) -Chrome/Firefox WebExtension. Feature-rich inline translator with PDF support. Vimium compatible. - -:rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: -The core engine of Saladict is under rewriting right now. PRs are not encouraged unless there are critical bugs. Adding new dictionaries is not affected though. Please follow [contribution guide](./CONTRIBUTING.md) and make WIP PR before writing any code. -:rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: :rotating_light: +Chrome/Firefox WebExtension. Feature-rich inline translator with PDF support. [【中文】](https://www.crimx.com/ext-saladict/)Chrome/Firefox 浏览器插件,网页划词翻译。 @@ -28,7 +24,7 @@ The core engine of Saladict is under rewriting right now. PRs are not encouraged [Chrome Web Store](https://chrome.google.com/webstore/detail/cdonnmffkdaoajfknoeeecmchibpmkmg?hl=en) / [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/ext-saladict/) -Saladict 6 is a complete rewrite in React Typescript for both Chrome & Firefox. Built for speed, stability and customization. +Saladict 7 is a complete rewrite with sophisticated interaction and buttery smooth experience. Built for speed, stability and customization. ## Change Log diff --git a/docs/index.md b/docs/index.md index d4058a445..f3a90cf61 100644 --- a/docs/index.md +++ b/docs/index.md @@ -37,7 +37,6 @@ Chrome/Firefox 浏览器插件,网页划词翻译。 - [每个情境模式下设置相互独立,快速切换](https://github.com/crimx/ext-saladict/wiki#profile) - 全键盘操作亦可 - [支持设置浏览器快捷键](https://github.com/crimx/ext-saladict/wiki#shortcuts) - - [兼容 Vimium 全键盘操作](https://github.com/crimx/ext-saladict/wiki#vimium) - [三按 ctrl 打开快捷查词](https://github.com/crimx/ext-saladict/wiki#triple-ctrl) - [点击地址栏图标快速查词(可设置快捷键)](https://github.com/crimx/ext-saladict/wiki#popup-icon) - 单词管理 diff --git a/src/_locales/manifest/en/messages.json b/src/_locales/manifest/en/messages.json index 275f91e0f..f534175f2 100644 --- a/src/_locales/manifest/en/messages.json +++ b/src/_locales/manifest/en/messages.json @@ -9,7 +9,7 @@ }, "extension_description": { "description": "Description of extension", - "message": "Saladict 沙拉查词是一款专业划词翻译扩展,为交叉阅读而生。大量权威词典涵盖中英日韩法德西语,支持复杂的划词操作、网页翻译、生词本、PDF,以及 Vimium 全键盘操作。" + "message": "Saladict 沙拉查词是一款专业划词翻译扩展,为交叉阅读而生。大量权威词典涵盖中英日韩法德西语,支持复杂的划词操作、网页翻译、生词本与 PDF 浏览。" }, "command_toggle_active": { "message": "Toggle inline translator" @@ -29,4 +29,4 @@ "command_open_pdf": { "message": "Open current PDF in Saladict" } -} \ No newline at end of file +} diff --git a/src/_locales/manifest/zh_CN/messages.json b/src/_locales/manifest/zh_CN/messages.json index 13763ff72..1e30651ba 100644 --- a/src/_locales/manifest/zh_CN/messages.json +++ b/src/_locales/manifest/zh_CN/messages.json @@ -9,7 +9,7 @@ }, "extension_description": { "description": "Description of extension", - "message": "Saladict 沙拉查词是一款专业划词翻译扩展,为交叉阅读而生。大量权威词典涵盖中英日韩法德西语,支持复杂的划词操作、网页翻译、生词本、PDF,以及 Vimium 全键盘操作。" + "message": "Saladict 沙拉查词是一款专业划词翻译扩展,为交叉阅读而生。大量权威词典涵盖中英日韩法德西语,支持复杂的划词操作、网页翻译、生词本与 PDF 浏览。" }, "command_toggle_active": { "message": "鼠标划词翻译开关" @@ -29,4 +29,4 @@ "command_open_pdf": { "message": "在 Saladict 中浏览此 PDF" } -} \ No newline at end of file +} diff --git a/src/_locales/manifest/zh_TW/messages.json b/src/_locales/manifest/zh_TW/messages.json index 7d8fdc2d2..3dc0b074c 100644 --- a/src/_locales/manifest/zh_TW/messages.json +++ b/src/_locales/manifest/zh_TW/messages.json @@ -9,7 +9,7 @@ }, "extension_description": { "description": "Description of extension", - "message": "Saladict 沙拉查詞是一款專業滑鼠選字翻譯套件,為交叉閱讀而生。大量權威字典涵蓋中英日韓法德西語,支援複雜的選字操作、網頁翻譯、生字本、PDF,以及 Vimium 全鍵盤操作。" + "message": "Saladict 沙拉查詞是一款專業滑鼠選字翻譯套件,為交叉閱讀而生。大量權威字典涵蓋中英日韓法德西語,支援複雜的選字操作、網頁翻譯、生字本与 PDF 瀏覽。" }, "command_toggle_active": { "message": "滑鼠選字翻譯開關" @@ -29,4 +29,4 @@ "command_open_pdf": { "message": "在 Saladict 中瀏覽此 PDF" } -} \ No newline at end of file +}
docs
update saladict 7 features
8fd4ba5d12d295bc0734f29ff68f0a65c5214abe
2018-01-21 12:22:22
CRIMX
refactor(helpers): remove unused code
false
diff --git a/src/_helpers/iframe-chrome-api-frame.js b/src/_helpers/iframe-chrome-api-frame.js deleted file mode 100644 index 0f3a86c17..000000000 --- a/src/_helpers/iframe-chrome-api-frame.js +++ /dev/null @@ -1,244 +0,0 @@ -/** - * Wraps chrome extension apis with iframe messaging - */ - -var responseCbs = {} -var storageChangeCbs = [] - -export const storage = { - sync: { - get: storageGet('sync'), - set: storageSet('sync') - }, - local: { - get: storageGet('local'), - set: storageSet('local') - }, - listen: storageListen, - addListener: storageListen, - on: storageListen -} - -/** - * Wraps in-app runtime.sendMessage and tabs.sendMessage - * Does not warp cross extension messaging! - */ -export const message = { - send: messageSend, - fire: messageSend, - emit: messageSend, - - listen: messageListen, - addListener: messageListen, - on: messageListen -} - -export default { - storage, - message -} - -function storageGet (storageArea) { - /** - * @param {string|array|Object|null} [keys] keys to get values - * @param {function} [cb] callback with storage items or on failure - * @returns {Promise|undefined} returns a promise with the result if callback is missed - * @see https://developer.chrome.com/extensions/storage#type-StorageArea - */ - return function get (keys, cb) { - if (typeof keys === 'function') { - cb = keys - keys = undefined - } - - function _get (cb) { - const timeStamp = Date.now() - - responseCbs[timeStamp] = cb - - window.parent.postMessage({ - msg: 'SALADICT_SOTRAGE_GET', - storageArea, - keys, - timeStamp - }, '*') - } - - if (typeof cb === 'function') { - _get(data => cb(data.items)) - } else { - return new Promise((resolve, reject) => { - _get(data => { - if (data.error) { - reject(data.error) - } else if (!data || Object.keys(data).length < 1) { - reject({}) - } else { - resolve(data.items) - } - }) - }) - } - } -} - -function storageSet (storageArea) { - /** - * @param {object} items items to set - * @param {function} [cb] Callback on success, or on failure - * @returns {Promise|undefined} returns a promise if callback is missed - * @see https://developer.chrome.com/extensions/storage#type-StorageArea - */ - return function set (items, cb) { - function _set (cb) { - const timeStamp = Date.now() - - // let listener = window.addEventListener('message', evt => { - // const data = evt.data - // if (data.timeStamp === timeStamp) { - // cb(data) - // window.removeEventListener('message', listener, false) - // } - // }, false) - - responseCbs[timeStamp] = cb - - window.parent.postMessage({ - msg: 'SALADICT_SOTRAGE_SET', - storageArea, - items, - timeStamp - }, '*') - } - - if (typeof cb === 'function') { - _set(cb) - } else { - return new Promise((resolve, reject) => { - _set(data => { - if (data.error) { - reject(data.error) - } else { - resolve() - } - }) - }) - } - } -} - -/** - * Listens to a specific key or uses the generic addListener - * @param {string|number} [key] key to listen to - * @param {function} cb callback function - * @see https://developer.chrome.com/extensions/storage#event-onChanged - */ -function storageListen (key, cb) { - if (typeof key === 'function') { - cb = key - storageChangeCbs.push(cb) - } else if (typeof cb === 'function') { - storageChangeCbs.push((changes, areaName) => { - if (changes[key]) { - cb(changes, areaName) - } - }) - } -} - -/** - * @param {number|string} [tabId] send to a specific tab - * @param {object} message should be a JSON-ifiable object - * @param {function} [cb] response callback - * @returns {Promise|undefined} returns a promise with the response if callback is missed - * @see https://developer.chrome.com/extensions/runtime#method-sendMessage - * @see https://developer.chrome.com/extensions/tabs#method-sendMessage - */ -function messageSend (tabId, message, cb) { - if (tabId === Object(tabId)) { - // runtime - cb = message - message = tabId - tabId = undefined - } - - function _send (cb) { - const timeStamp = Date.now() - - responseCbs[timeStamp] = cb - - window.parent.postMessage({ - msg: 'SALADICT_MSG_SEND', - tabId, - message, - timeStamp - }, '*') - } - - if (typeof cb === 'function') { - return _send(data => cb(data.response)) - } else { - return new Promise((resolve, reject) => { - _send(data => { - if (data.error) { - reject(data.error) - } else { - resolve(data.response) - } - }) - }) - } -} - -/** - * Listens to a specific message or uses the generic onMessage.addListener - * @param {string|number} [message] message to listen to - * @param {function} cb callback function - * @param {Boolean} [isResopnse] will send response? So that the channel will keep open. Can't directly pass sendResponse. - * @see https://developer.chrome.com/extensions/runtime#event-onMessage - */ -function messageListen (message, cb, isResopnse) { - if (typeof message === 'function') { - cb = message - isResopnse = cb - message = undefined - } - - if (typeof cb === 'function') { - let timeStamp = Date.now() - window.parent.postMessage({ - msg: 'SALADICT_MESSAGE_LISTEN', - timeStamp, - message, - isResopnse - }, '*') - - responseCbs[timeStamp] = ({receivedMsg, sender}) => { - if (!message || (receivedMsg && receivedMsg.msg === message)) { - cb(receivedMsg, sender, responseMsg => { - window.parent.postMessage({ - msg: 'SALADICT_MESSAGE_RESPONSE', - timeStamp, - message: responseMsg - }, '*') - }) - } - } - } -} - -window.addEventListener('message', evt => { - const data = evt.data - switch (data.msg) { - case 'SALADICT_SOTRAGE_CHANGE': - storageChangeCbs.forEach(cb => cb(data.changes, data.areaName)) - break - case 'SALADICT_RESPONSE': - let cb = responseCbs[data.timeStamp] - if (typeof cb === 'function') { - cb(data) - delete responseCbs[data.timeStamp] - } - break - } -}, false) diff --git a/src/_helpers/iframe-chrome-api-parent.js b/src/_helpers/iframe-chrome-api-parent.js deleted file mode 100644 index 5129c5119..000000000 --- a/src/_helpers/iframe-chrome-api-parent.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Transfer chrome extension apis requests from iframes - */ - -var msgResponseCallbacks = {} - -window.addEventListener('message', evt => { - let data = evt.data - switch (data.msg) { - case 'SALADICT_SOTRAGE_GET': - chrome.storage[data.storageArea].get(data.keys, items => { - let result = { - msg: 'SALADICT_RESPONSE', - timeStamp: data.timeStamp, - items - } - if (chrome.runtime.lastError) { - result.error = chrome.runtime.lastError.message - } - evt.source.postMessage(result, '*') - }) - break - - case 'SALADICT_SOTRAGE_SET': - chrome.storage[data.storageArea].set(data.items, () => { - let result = { - msg: 'SALADICT_RESPONSE', - timeStamp: data.timeStamp - } - if (chrome.runtime.lastError) { - result.error = chrome.runtime.lastError.message - } - evt.source.postMessage(result, '*') - }) - break - - case 'SALADICT_SOTRAGE_LISTEN': - chrome.storage.onChanged.addListener((changes, areaName) => { - evt.source.postMessage({ - msg: 'SALADICT_SOTRAGE_CHANGE', - changes, - areaName - }, '*') - }) - break - - case 'SALADICT_MSG_SEND': - if (data.tabId) { - chrome.tabs.sendMessage(data.tabId, data.message, response => { - evt.source.postMessage({ - msg: 'SALADICT_RESPONSE', - timeStamp: data.timeStamp, - response - }, '*') - }) - } else { - chrome.runtime.sendMessage(data.message, response => { - evt.source.postMessage({ - msg: 'SALADICT_RESPONSE', - timeStamp: data.timeStamp, - response - }, '*') - }) - } - break - - case 'SALADICT_MESSAGE_LISTEN': - chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { - evt.source.postMessage({ - msg: 'SALADICT_RESPONSE', - message, - sender - }, '*') - if (data.isResopnse) { - msgResponseCallbacks[data.timeStamp] = sendResponse - return true - } - }) - break - - case 'SALADICT_MESSAGE_RESPONSE': - let sendResponse = msgResponseCallbacks[data.timeStamp] - if (sendResponse) { - sendResponse(data.message) - delete msgResponseCallbacks[data.timeStamp] - } - break - } -}, false)
refactor
remove unused code
310b19819509e046a81660aecc271440ceb42051
2018-05-01 20:30:36
CRIMX
style(helpers): add typings
false
diff --git a/src/_helpers/browser-api.ts b/src/_helpers/browser-api.ts index baf9984a7..89ba0ae22 100644 --- a/src/_helpers/browser-api.ts +++ b/src/_helpers/browser-api.ts @@ -272,8 +272,8 @@ function storageCreateStream (this: StorageThisThree, key: string) { \* --------------------------------------- */ type MessageThis = typeof message | typeof message.self -function messageSend<T extends Message> (tabId: number, message: T): Promise<any> -function messageSend<T extends Message> (message: T): Promise<any> +function messageSend<T extends Message, U = any> (tabId: number, message: T): Promise<U> +function messageSend<T extends Message, U = any> (message: T): Promise<U> function messageSend (...args): Promise<any> { if (args.length === 1) { return browser.runtime.sendMessage(args[0]) @@ -282,7 +282,7 @@ function messageSend (...args): Promise<any> { } } -function messageSendSelf<T extends Message> (message: T): Promise<any> { +function messageSendSelf<T extends Message, U = any> (message: T): Promise<U> { if (window.pageId === undefined) { return initClient().then(() => messageSendSelf(message)) }
style
add typings
b8b5185c801cd0852d1b4c62ebddfe3001171e05
2019-08-01 09:31:34
crimx
refactor: use default export on views
false
diff --git a/src/components/dictionaries/baidu/View.tsx b/src/components/dictionaries/baidu/View.tsx index 75677b551..65d76d1c7 100644 --- a/src/components/dictionaries/baidu/View.tsx +++ b/src/components/dictionaries/baidu/View.tsx @@ -1,3 +1 @@ -import { MachineTrans } from '@/components/MachineTrans/MachineTrans' - -export const View = MachineTrans +export { MachineTrans as default } from '@/components/MachineTrans/MachineTrans' diff --git a/src/content/components/DictItem/DictItem.tsx b/src/content/components/DictItem/DictItem.tsx index ef0d89539..3fe40af2f 100644 --- a/src/content/components/DictItem/DictItem.tsx +++ b/src/content/components/DictItem/DictItem.tsx @@ -101,7 +101,7 @@ export const DictItem: FC<DictItem> = props => { {React.createElement<ViewPorps<any>>( require('@/components/dictionaries/' + props.dictID + - '/View.tsx').View, + '/View.tsx').default, { result: props.searchResult, searchText: props.searchText,
refactor
use default export on views
511a12e7b4cbf0f50ee9d73e39429f9f876faa4f
2018-05-14 17:43:44
CRIMX
refactor(helpers): simplify fetch-dom
false
diff --git a/src/_helpers/fetch-dom.ts b/src/_helpers/fetch-dom.ts index 9029bc64a..437c94451 100644 --- a/src/_helpers/fetch-dom.ts +++ b/src/_helpers/fetch-dom.ts @@ -1,25 +1,19 @@ -type Options = { - method?: string - body?: null | Document | Blob | BufferSource | FormData | URLSearchParams | ReadableStream | USVString -} - -export default function fetchDOM (url: string, options?: Options): Promise<Document> { - url = encodeURI(url.replace('\n', ' ')) +import DOMPurify from 'dompurify' - const method = (options && options.method && options.method.toLowerCase() === 'post') ? 'POST' : 'GET' - const body = options && options.body +export function fetchDOM (input?: string | Request, init?: RequestInit): Promise<Document> { + return fetch(input, init) + .then(r => r.text()) + .then(text => new DOMParser().parseFromString( + DOMPurify.sanitize(text), + 'text/html', + )) +} - return new Promise((resolve, reject) => { - let xhr = new XMLHttpRequest() - xhr.onload = () => { - if (!xhr.responseXML) { - return reject(new Error('Empty body, Response code ' + xhr.status)) - } - resolve(xhr.responseXML) - } - xhr.onerror = reject - xhr.open(method, url) - xhr.responseType = 'document' - return body ? xhr.send(body) : xhr.send() - }) +export function fetchDirtyDOM (input?: string | Request, init?: RequestInit): Promise<Document> { + return fetch(input, init) + .then(r => r.text()) + .then(text => new DOMParser().parseFromString( + text, + 'text/html', + )) } diff --git a/test/specs/_helpers/fetch-dom.spec.ts b/test/specs/_helpers/fetch-dom.spec.ts deleted file mode 100644 index ce7b12db1..000000000 --- a/test/specs/_helpers/fetch-dom.spec.ts +++ /dev/null @@ -1,165 +0,0 @@ -import fetchDOM from '@/_helpers/fetch-dom' - -class XMLHttpRequestMock { - static queue: XMLHttpRequestMock[] = [] - static lastXhr: XMLHttpRequestMock - - status?: number - responseType?: string - responseXML?: Document - onload?: Function - onerror?: Function - send = jest.fn(() => { - XMLHttpRequestMock.queue.push(this) - XMLHttpRequestMock.lastXhr = this - }) - open = jest.fn() - - static response (isSuccess, res) { - if (isSuccess) { - XMLHttpRequestMock.queue.forEach(xhr => { - xhr.status = res.status - if (res.body) { - xhr.responseXML = document.implementation.createHTMLDocument('') - xhr.responseXML.body.innerHTML = res.body - } - xhr.onload && xhr.onload() - }) - } else { - XMLHttpRequestMock.queue.forEach(xhr => { - xhr.onerror && xhr.onerror(new Error(res)) - }) - } - XMLHttpRequestMock.queue = [] - } - static flush () { - XMLHttpRequestMock.queue = [] - } -} - -describe('Fetch DOM', () => { - const bakXMLHttpRequest = (window as any).XMLHttpRequest - beforeAll(() => { - (window as any).XMLHttpRequest = XMLHttpRequestMock - }) - afterAll(() => { - (window as any).XMLHttpRequest = bakXMLHttpRequest - }) - beforeEach(() => { - XMLHttpRequestMock.flush() - }) - - describe('GET', () => { - it('Success', () => { - const url = 'https://example.com/res' - const resolveSpy = jest.fn(doc => { - expect(doc.getElementById('app').textContent).toBe('HEY') - }) - const rejectSpy = jest.fn() - const catchSpy = jest.fn() - - const p = fetchDOM(url) - .then(resolveSpy, rejectSpy) - .catch(catchSpy) - .then(() => { - expect(resolveSpy).toHaveBeenCalledTimes(1) - expect(rejectSpy).toHaveBeenCalledTimes(0) - expect(catchSpy).toHaveBeenCalledTimes(0) - }) - - XMLHttpRequestMock.response(true, { - status: 200, - body: '<div id="app">HEY</div>', - }) - const xhr = XMLHttpRequestMock.lastXhr - expect(xhr.send).toHaveBeenCalledTimes(1) - expect(xhr.responseType).toBe('document') - expect(xhr.open).toHaveBeenCalledWith('GET', url) - - return p - }) - it('Failed', () => { - const url = 'https://example.com/res' - const resolveSpy = jest.fn() - const rejectSpy = jest.fn() - const catchSpy = jest.fn() - - const p = fetchDOM(url) - .then(resolveSpy, rejectSpy) - .catch(catchSpy) - .then(() => { - expect(resolveSpy).toHaveBeenCalledTimes(0) - expect(rejectSpy).toHaveBeenCalledTimes(1) - expect(catchSpy).toHaveBeenCalledTimes(0) - }) - - XMLHttpRequestMock.response(true, { - status: 404 - }) - const xhr = XMLHttpRequestMock.lastXhr - expect(xhr.send).toHaveBeenCalledTimes(1) - expect(xhr.responseType).toBe('document') - expect(xhr.open).toHaveBeenCalledWith('GET', url) - - return p - }) - }) - - describe('POST', () => { - it('Success', () => { - const url = 'https://example.com/res' - const resolveSpy = jest.fn(doc => { - expect(doc.getElementById('app').textContent).toBe('HEY') - }) - const rejectSpy = jest.fn() - const catchSpy = jest.fn() - - const p = fetchDOM(url, { method: 'post', body: 'request body' }) - .then(resolveSpy, rejectSpy) - .catch(catchSpy) - .then(() => { - expect(resolveSpy).toHaveBeenCalledTimes(1) - expect(rejectSpy).toHaveBeenCalledTimes(0) - expect(catchSpy).toHaveBeenCalledTimes(0) - }) - - XMLHttpRequestMock.response(true, { - status: 200, - body: '<div id="app">HEY</div>', - }) - const xhr = XMLHttpRequestMock.lastXhr - expect(xhr.send).toHaveBeenCalledTimes(1) - expect(xhr.send).toHaveBeenCalledWith('request body') - expect(xhr.responseType).toBe('document') - expect(xhr.send).toHaveBeenCalledTimes(1) - expect(xhr.open).toHaveBeenCalledWith('POST', url) - - return p - }) - it('Failed', () => { - const url = 'https://example.com/res' - const resolveSpy = jest.fn() - const rejectSpy = jest.fn() - const catchSpy = jest.fn() - - const p = fetchDOM(url, { method: 'post' }) - .then(resolveSpy, rejectSpy) - .catch(catchSpy) - .then(() => { - expect(resolveSpy).toHaveBeenCalledTimes(0) - expect(rejectSpy).toHaveBeenCalledTimes(1) - expect(catchSpy).toHaveBeenCalledTimes(0) - }) - - XMLHttpRequestMock.response(true, { - status: 404 - }) - const xhr = XMLHttpRequestMock.lastXhr - expect(xhr.send).toHaveBeenCalledTimes(1) - expect(xhr.responseType).toBe('document') - expect(xhr.open).toHaveBeenCalledWith('POST', url) - - return p - }) - }) -})
refactor
simplify fetch-dom
65b7327d151cd6dec03531aef6bed5395ea296ce
2018-05-27 12:31:50
CRIMX
feat(dicts): add oald
false
diff --git a/config/fake-env/fake-ajax.js b/config/fake-env/fake-ajax.js index 936df0278..c5a9fd055 100644 --- a/config/fake-env/fake-ajax.js +++ b/config/fake-env/fake-ajax.js @@ -214,6 +214,33 @@ const fakeFetchData = [ text: () => require('raw-loader!../../test/specs/components/dictionaries/websterlearner/response/jumblish.html') }, }, + { + test: { + method: /.*/, + url: /oxfordlearnersdictionaries\.com.*love$/, + }, + response: { + text: () => require('raw-loader!../../test/specs/components/dictionaries/oald/response/love.html') + }, + }, + { + test: { + method: /.*/, + url: /oxfordlearnersdictionaries\.com.*love_2$/, + }, + response: { + text: () => require('raw-loader!../../test/specs/components/dictionaries/oald/response/love_2.html') + }, + }, + { + test: { + method: /.*/, + url: /oxfordlearnersdictionaries\.com.*jumblish$/, + }, + response: { + text: () => require('raw-loader!../../test/specs/components/dictionaries/oald/response/jumblish.html') + }, + }, ] /*-----------------------------------------------*\ diff --git a/src/app-config/dicts.ts b/src/app-config/dicts.ts index c3271cc4d..cb86bb4d2 100644 --- a/src/app-config/dicts.ts +++ b/src/app-config/dicts.ts @@ -279,6 +279,37 @@ export function getALlDicts () { related: true, } }, + oald: { + /** + * Full content page to jump to when user clicks the title. + * %s will be replaced with the current word. + * %z will be replaced with the traditional Chinese version of the current word. + * %h will be replaced with the current word joining with hyphen "-". + */ + page: 'https://www.oxfordlearnersdictionaries.com/definition/english/%h', + /** + * If set to true, the dict start searching automatically. + * Otherwise it'll only start seaching when user clicks the unfold button. + * Default MUST be true and let user decide. + */ + defaultUnfold: true, + /** + * This is the default height when the dict first renders the result. + * If the content height is greater than the preferred height, + * the preferred height is used and a mask with a view-more button is shown. + * Otherwise the content height is used. + */ + preferredHeight: 265, + /** Only start searching if the selection contains the language. */ + selectionLang: { + eng: true, + chs: true, + }, + /** Optional dict custom options. Can only be boolean or number. */ + options: { + related: true, + }, + }, urban: { /** * Full content page to jump to when user clicks the title. diff --git a/src/app-config/index.ts b/src/app-config/index.ts index 1ba34cf22..33eccd5f8 100644 --- a/src/app-config/index.ts +++ b/src/app-config/index.ts @@ -206,7 +206,17 @@ export function appConfigFactory (): AppConfig { }, en: { dict: '', - list: ['bing', 'youdao', 'macmillan', 'longman', 'cobuild', 'urban', 'eudic'], + list: [ + 'bing', + 'youdao', + 'macmillan', + 'longman', + 'cobuild', + 'websterlearner', + 'oald', + 'urban', + 'eudic', + ], accent: 'uk' as ('us' | 'uk') } }, diff --git a/src/components/dictionaries/oald/View.tsx b/src/components/dictionaries/oald/View.tsx new file mode 100644 index 000000000..58d2f216e --- /dev/null +++ b/src/components/dictionaries/oald/View.tsx @@ -0,0 +1,54 @@ +import React from 'react' +import Speaker from '@/components/Speaker' +import { OALDResult, OALDResultLex, OALDResultRelated } from './engine' + +export default class DictOALD extends React.PureComponent<{ result: OALDResult }> { + handleEntryClick = (e: React.MouseEvent<HTMLElement>) => { + const target = e.nativeEvent.target as HTMLSpanElement + if (target.classList && target.classList.contains('heading')) { + (target.parentElement as HTMLDivElement).classList.toggle('is-active') + } + } + + renderLex (result: OALDResultLex) { + return result.items.map(entry => ( + <section key={entry.title} className='dictOALD-Entry' onClick={this.handleEntryClick}> + <header className='dictOALD-Header'> + <div className='webtop-g' dangerouslySetInnerHTML={{ __html: entry.title }} /> + {entry.prons.length > 0 && + <div className='pron-gs ei-g'> + {entry.prons.map(p => ( + <React.Fragment key={p.phsym}> + <span className='pron-g' dangerouslySetInnerHTML={{ __html: p.phsym }} /> + <Speaker src={p.pron} /> + </React.Fragment> + ))} + </div> + } + </header> + <span className='h-g' dangerouslySetInnerHTML={{ __html: entry.defs }} /> + </section> + )) + } + + renderRelated (result: OALDResultRelated) { + return ( + <> + <p>Did you mean:</p> + <ul className='dictOALD-Related' dangerouslySetInnerHTML={{ __html: result.list }} /> + </> + ) + } + + render () { + const { result } = this.props + switch (result.type) { + case 'lex': + return this.renderLex(result) + case 'related': + return this.renderRelated(result) + default: + return null + } + } +} diff --git a/src/components/dictionaries/oald/_locales.json b/src/components/dictionaries/oald/_locales.json new file mode 100644 index 000000000..923596233 --- /dev/null +++ b/src/components/dictionaries/oald/_locales.json @@ -0,0 +1,14 @@ +{ + "name": { + "en": "OALD", + "zh_CN": "OALD", + "zh_TW": "OALD" + }, + "options": { + "related": { + "en": "Show related results", + "zh_CN": "失败时显示备选", + "zh_TW": "失敗時顯示備選" + } + } +} diff --git a/src/components/dictionaries/oald/_style.scss b/src/components/dictionaries/oald/_style.scss new file mode 100644 index 000000000..091765e52 --- /dev/null +++ b/src/components/dictionaries/oald/_style.scss @@ -0,0 +1,3526 @@ +.dictOALD-Entry { + ol { + list-style-type: decimal; + padding-left: 20px + } + + img.icon { + vertical-align: text-bottom; + margin-top: 0; + margin-right: 2px; + margin-left: 0; + margin-bottom: 0 + } + + div.icon { + display: inline; + font-weight: lighter; + font-size: 7pt; + text-transform: uppercase; + color: #FFF; + padding: 0 .6em .2em .6em + } + + div.icon-helpsym { + background-color: transparent; + font-weight: bold; + color: #276E98; + font-variant: small-caps + } + + div.icon-pvsym { + font-weight: lighter; + color: #078d8f; + font-size: 1.38em; + text-indent: -1em + } + + div.icon-oppsym { + color: #C00B19; + background-color: transparent; + font-size: 0.85em; + padding: 0; + text-transform: lowercase + } + + div.icon-idsym { + font-weight: lighter; + color: #35338a; + font-size: 1.46em + } + + div.icon-synsym { + background-color: transparent; + font-weight: normal !important; + color: #C00B19; + text-transform: lowercase; + font-size: 0.85em; + padding: 0 !important + } + + .labelsAbout { + text-align: left; + border: 0px none; + width: 100% + } + + .labelsAbout .pron-usonly:hover { + background-repeat: no-repeat; + background-position: left bottom + } + + .labelsAbout .pron-usonly { + width: 29px; + height: 30px; + border: 0; + background-repeat: no-repeat; + background-position: left top + } + + .sup,sup { + vertical-align: super; + font-size: 65% + } + + .sub { + vertical-align: sub; + font-size: 65% + } + + button.key { + height: 15px; + width: 8px; + padding: 0px; + margin: 0px; + cursor: normal; + padding: 0px; + border: 0px; + margin-right: 5px; + margin-top: 5px; + background-repeat: no-repeat; + vertical-align: top + } + + .block-g { + float: right + } + + .clear { + clear: both; + height: 2px + } + + #entryContent .side { + float: right; + width: 164px; + text-align: center; + margin-bottom: 0px + } + + .ColloPanel,.ThesPanel { + font-size: 80%; + text-align: left; + display: block; + border-radius: 9px 9px 9px 9px; + border-style: solid; + border-color: blue; + margin: 15px; + border-width: 1px; + padding: 3px; + column-count: 3; + column-gap: 0em; + -moz-column-count: 3; + -moz-column-gap: 0em; + -webkit-column-count: 3; + -webkit-column-gap: 0em; + background-color: #FFF + } + + ul.sketch { + margin-top: 0px; + margin-left: -20px + } + + .ColloPanel .xr,.ThesPanel .xr { + font-weight: bold; + font-size: 130%; + display: list-item; + list-style-type: square; + color: #5BA7DA; + margin-left: 20px + } + + .CorpusHeader { + display: block; + padding: 3px; + font-size: 120%; + background-color: #00315A; + color: white; + border-top-left-radius: 9px + } + + .ColloHeader { + display: block; + color: white; + font-weight: bold; + background-color: #5BA7DA; + font-size: 100%; + text-transform: uppercase; + margin-left: 2px; + margin-top: 2px; + padding: 3px + } + + .search-term { + font-weight: bold + } + + #results-container-all ul li { + margin-bottom: 7px + } + + #browse>div { + margin-bottom: 7px + } + + #browse #result ul { + padding: 0 + } + + #browse_lists { + margin-top: 16px + } + + #browse_lists ul { + margin-bottom: 10px + } + + .grey-grad,.idsym-g,.ui-grad dt,.z_idsym { + box-shadow: 0 50px 50px -30px white inset; + background-color: #cccccc; + border: 1px solid #cccccc + } + + .webtop-g h2 { + font-size: 1.62em; + font-weight: bold; + padding: 0; + display: inline-block + } + + .top-container { + background-color: #ecf5ff; + margin-right: -250px; + margin-left: -28px; + margin-bottom: 10px; + padding: 0 250px 0 28px; + clear: both + } + + .btn.prac-pron { + display: none + } + + .oxford3000,.academic { + display: inline-block; + background-size: 100%; + background-repeat: no-repeat; + width: 30px; + height: 30px; + margin: 0 0 -8px; + position: relative; + top: -5px + } + + .oxford3000:hover,.academic:hover { + text-decoration: none + } + + .entry-header .share-this-entry { + margin: 0; + padding-top: 0; + display: table + } + + .entry-header .responsive_entry_center_left { + margin-bottom: 0 !important; + display: table-cell; + float: none + } + + .entry-header .responsive_entry_center_left_premium { + margin-bottom: 0 !important; + display: table-cell; + float: none + } + + .entry-header { + margin: 7px 0; + display: table + } + + .responsive_entry_center p.definition-title,.responsive_entry_center_left_premium p.definition-title { + font-size: 0.85em; + padding-bottom: 0px; + margin-bottom: 0; + display: table-cell; + vertical-align: bottom + } + + .share-this-entry .right-colum { + margin: 0; + padding-top: 0 !important + } + + .share-this-entry .col_middle_left,.share-this-entry .right-colum { + display: table-cell + } + + .social-wrap { + width: 180px; + height: 28px; + padding: 2px 0 + } + + .social-wrap a { + display: inline-block; + width: 24px; + height: 24px; + padding: 0; + margin: 1px 0 0 0; + border: 0; + background: #4577bf; + background-size: auto 100%; + cursor: pointer; + border-radius: 30px + } + + .social-wrap a:hover { + background-color: #0d3880 + } + + #plusone-box { + display: inline-block; + vertical-align: top; + margin: 1px 0 0 1px + } + + .stumbleupon-btn { + background-position: -48px 0 !important + } + + .diigo-btn { + background-position: -72px 0 !important + } + + .email-btn { + background-position: -96px 0 !important + } + + #ox-enlarge { + float: right; + position: relative; + z-index: 10; + clear: both + } + + #ox-enlarge a.topic { + display: block; + text-align: right; + position: relative; + padding: 2px; + margin: 0 0 12px 12px; + } + + #ox-enlarge a.topic:hover { + text-decoration: none; + outline: none; + } + + #ox-enlarge .ox-enlarge-label { + display: none; + } + + .relatedentries { + max-height: 200px; + text-align: left; + color: #8f0610; + } + + .relatedentries ul { + margin: 0; + padding: 0 0 0 10px + } + + .relatedentries a { + color: #000 + } + + #rightcolumn h4.no-rule { + margin-top: 0; + border-bottom: 0 none + } + + .no-rule { + border-bottom: 0; + margin-bottom: 0 + } + + dd { + overflow: hidden; + -webkit-transition: max-height 0.5s; + -moz-transition: max-height 0.5s; + transition: max-height 0.5s; + max-height: 4000px + } + + dd.deep { + max-height: 9000px + } + + .hide+dd,.hide+dd.deep { + max-height: 0 + } + + .ui-grad dt,.ui-grad dd { + margin-top: -1px + } + + .ui-grad ul { + margin-left: 14px; + margin-right: 14px; + padding: 0 + } + + .ui-grad dd { + border: 1px solid #cccccc + } + + .ui-grad dt:first-child { + border-radius: 8px 8px 0 0; + margin-top: 0 + } + + .ui-grad dt { + padding: 5px 6px 5px 6px; + color: #444444 + } + + .ui-grad dt.hide:hover { + cursor: pointer + } + + .ui-grad dt:not(.hide):before { + content: none + } + + .ui-grad dt:not(.hide) { + padding: 6px 14px 5px + } + + .accordion dl { + margin: 0 + } + + .accordion .more { + display: none + } + + .accordion .show .more { + display: block + } + + .accordion dt:before { + vertical-align: baseline; + content: ""; + display: inline-block; + margin-right: 6px; + margin-left: -2px; + margin-bottom: -1px; + width: 13px; + height: 13px + } + + .see-more { + display: block; + padding: 6px; + text-align: center; + border-top: 1px solid #aaaaaa; + color: grey + } + + .list-col a,.list-col span.selected { + display: block; + padding-top: 3px; + padding-bottom: 4px; + font-weight: normal + } + + .list-col { + padding-left: 0 + } + + .list-col .selected { + color: #282828; + padding-left: 7px; + padding-right: 7px; + background-color: #dddddd; + border-radius: 4px; + margin: 3px -7px 4px + } + + .list-col h6 { + border-bottom: 1px solid silver + } + + .topic-explore p { + color: rgba(0,0,0,0.7); + font-size: 1.15em + } + + .topic-explore>h3 { + font-size: 1.31em; + font-weight: bold; + margin: 0 0 7px; + padding: 0 + } + + .topic-explore h4 { + border-top: 1px solid #C0C0C0; + border-bottom: 1px solid #C0C0C0; + padding: 8px 0 + } + + .topic-explore ul { + padding-left: 0px + } + + .topic-explore h6 { + border: 0px none; + margin: 8px 0px 0px 0px + } + + .topic-explore h6 a { + font-size: 1.15em; + font-weight: bold; + color: rgba(0,0,0,0.7) + } + + .list-nested>li { + display: inline-block; + padding-right: 15px + } + + .list-nested-pool>li { + background-color: grey; + border-bottom: 1px solid white + } + + .list-nested-pool ul { + padding: 3px 0 4px; + background: #efefef; + background: white + } + + .wordpool { + margin-top: 14px; + padding-left: 8px + } + + .wordpool li { + display: inline-block; + margin: 0; + padding: 0 14px 7px 0 + } + + .wordpool a,.wordpool span { + font-weight: normal + } + + .wordpool-active span { + font-weight: bold + } + + .section.partner { + margin-top: 2em + } + + .wordlist-page p { + max-width: 700px + } + + .wordlist-info-page { + margin-bottom: 14px + } + + .wordlist-info-page .oxford3000-blue,.wordlist-info-page .academic-blue { + width: 20px; + height: 20px + } + + .wordlist-info-page ul { + padding-left: 20px; + list-style-type: disc; + margin-bottom: 7px + } + + .middle_wrap>h1 { + margin-top: 7px + } + + .open-close dt:hover { + color: #0d3880 + } + + .ui-plain { + max-width: 700px + } + + .ui-plain dl:first-child { + border-top: 1px solid grey + } + + .ui-plain dt { + padding: 7px 7px 7px 21px; + color: #282828; + font-weight: bold; + cursor: pointer + } + + .ui-plain dt:before { + content: ""; + position: absolute; + width: 13px; + height: 24px; + margin: -7px 0 0 -21px + } + + .ui-plain dt.hide:before { + background-position: 0 -50px + } + + .ui-plain dd { + border-bottom: 1px solid silver + } + + .ui-plain dt:before { + position: relative; + margin-right: 8px; + display: inline-block + } + + .topic-desc { + max-width: 750px + } + + .oxford3000-blue,.academic-blue { + display: inline-block; + background-size: 100%; + background-repeat: no-repeat; + width: 30px; + height: 30px; + margin: -8px 0 -5px + } + + .topic-dt .side-selector__left ul ul ul ul li>a { + margin-left: -62px; + padding-left: 40px; + margin-top: 2px; + text-decoration: none; + background-color: #efefef; + background-color: white + } + + .side-selector { + border-radius: 7px; + overflow: hidden; + background-color: #eee; + border: 1px solid #cccccc + } + + .side-selector__left,.side-selector__right { + padding: 0 0; + width: 40%; + float: left + } + + .side-selector__right { + width: 60%; + float: left; + background-color: white + } + + .side-selector__right .sound.audio_play_button { + margin: 0 + } + + .side-selector__left ul ul ul ul li.is-revealed>a { + background-color: #4577bf; + color: white + } + + .side-selector__left .ei-g { + margin-top: 0 + } + + .side-selector__left .top-container { + margin: 0; + padding: 0; + background-color: transparent + } + + .side-selector__left .top-g { + padding: 0 + } + + .side-selector__left .webtop-g { + margin: 0 -7px; + padding: 6px 7px + } + + .side-selector__left .link-right { + padding-top: 7px + } + + #entries-selector { + padding: 7px + } + + #entries-selector ul { + list-style-type: none; + padding: 0 + } + + #entries-selector .wl-select { + padding: 0 7px 0 21px; + margin: -7px; + } + + #entries-selector a,#entries-selector span { + padding: 7px 14px; + margin-bottom: 2px; + display: block; + text-decoration: none; + text-align: center; + border-radius: 7px; + font-weight: bold + } + + #entries-selector a:hover { + background-color: #4577bf; + color: white + } + + #entries-selector .currentpage a,#entries-selector .currentpage span { + background-color: #07255e; + color: white + } + + #entries-selector select { + appearance: none; + border: none; + font-size: 1.15em; + outline: none; + margin: 0; + padding: 8px 15px 9px; + background-color: transparent; + width: 100%; + color: white + } + + .hideoverflow { + overflow: hidden + } + + .outer { + position: relative; + left: 50%; + float: left + } + + .inner { + position: relative; + left: -50%; + float: left + } + + .wl-nav { + border-color: silver; + border: 0 + } + + .wl-nav a,.wl-nav span { + display: inline-block; + padding: 10px 15px; + border-right: 1px solid silver; + color: #444444; + font-weight: normal + } + + .wl-nav li:hover { + box-shadow: 0 -50px 50px -30px white inset; + background-color: #cccccc + } + + .wl-nav li:hover a { + text-decoration: none + } + + .wl-nav li.activepage { + background-color: white + } + + .wl-nav li.activepage:hover { + background-color: white !important; + box-shadow: none + } + + .currentpage a { + color: #890017 + } + + .currentpage a .pos { + font-weight: normal + } + + .paging_links { + padding: 0 + } + + .paging_links li:last-child a { + border-right: 0 + } + + .paging_links .page_range { + font-weight: bolder; + margin-right: 30px; + display: inline-block + } + + .paging_links .page_info { + display: inline-block; + margin-right: 30px + } + + #entrylist1 a { + font-weight: bold + } + + .result-list1 { + padding: 4px 0; + list-style-type: none + } + + .wordlist-oxford3000 li { + padding: 7px + } + + .soundList { + display: inline + } + + .lang-study-page .pron-g { + white-space: normal + } + + .lang-col { + width: 48%; + float: left; + padding-right: 12px + } + + .mid-grad-bottom,.wl-table tr:first-child { + background: #00123c; + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #07255e), color-stop(100%, #00123c)); + background: -webkit-linear-gradient(top, #07255e 0%, #00123c 100%); + background: -moz-linear-gradient(top, #07255e 0%, #00123c 100%); + background: -ms-linear-gradient(top, #07255e 0%, #00123c 100%); + background: linear-gradient(to bottom, #07255e 0%, #00123c 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$blue2', endColorstr='$blue1', GradientType=0) + } + + .pale-grad,.wl-table tr { + background: #ffffff; + background: -moz-linear-gradient(top, white 0%, #eee 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #eee)); + background: -webkit-linear-gradient(top, white 0%, #eee 100%); + background: -o-linear-gradient(top, white 0%, #eee 100%); + background: -ms-linear-gradient(top, white 0%, #eee 100%); + background: linear-gradient(to bottom, white 0%, #eee 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0) + } + + .wl-table .delete-btn a:before { + pointer-events: all + } + + .wl-table .btn.delete-btn:hover a:before { + background-position: -1px bottom + } + + .wl-sub-head { + background: #4577bf; + background: -moz-linear-gradient(top, #4577bf 0%, #345c95 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #4577bf), color-stop(100%, #345c95)); + background: -webkit-linear-gradient(top, #4577bf 0%, #345c95 100%); + background: -o-linear-gradient(top, #4577bf 0%, #345c95 100%); + background: -ms-linear-gradient(top, #4577bf 0%, #345c95 100%); + background: linear-gradient(to bottom, #4577bf 0%, #345c95 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4577bf', endColorstr='#345c95', GradientType=0); + color: #ffffff + } + + .btn.test-btn a,.btn.delete-btn a { + padding-left: 28px + } + + .wl-table { + width: 100%; + margin-top: 10px; + margin-bottom: 12px; + border: 1px solid #cccccc; + border-collapse: separate + } + + .wl-table .wl-col1 { + text-align: left; + font-size: 1.23em + } + + .wl-table tr th { + color: white; + vertical-align: middle + } + + .wl-table th,.wl-table td { + text-align: center; + padding: 12px + } + + .wl-table.wl-edit .wl-col2 { + font-style: italic + } + + .wl-table.wl-edit .wl-col3 { + text-align: left + } + + .wl-table .wl-col1 a { + padding-right: 12px; + text-align: left; + font-size: 1.23em; + font-weight: bold + } + + .entry-word { + font-weight: bold; + color: #4577bf; + margin-left: 10px + } + + .hide-delete-icon { + display: none + } + + .premium .hide-delete-icon { + display: block + } + + h1.my-wordlist-titles { + margin: 7px 0 21px + } + + h2.my-wordlist-titles { + font-size: 2.77em; + color: #4577bf; + font-weight: bold; + padding-left: 0; + margin-top: 6px; + margin-bottom: 24px; + } + + h3.my-wordlist-titles { + font-size: 1.23em; + font-weight: bold; + margin: 0; + padding: 0; + color: #0d3880 + } + + h4.my-wordlist-titles { + font-weight: bold; + margin-bottom: 6px + } + + h5.my-wordlist-titles { + font-size: 1.38em; + margin: 0 0 7px; + font-weight: bold + } + + .mywordlist-container { + padding-left: 15px + } + + .mywordlist-container>.entry>span.h { + display: none + } + + .senseinfo { + margin-bottom: 6px + } + + .senseinfo .sense_check_box { + margin-right: 6px + } + + #wordlist-select { + margin-bottom: 7px + } + + .test__question-count { + margin: -7px -14px 14px; + padding: 5px 12px; + background-color: #4577bf; + color: white + } + + .test__definition { + font-size: 1.69em; + color: #07255e; + max-width: 650px; + font-size: 1.38em + } + + .test__definition__wrap { + margin-top: 14px; + margin-bottom: 14px + } + + .test__definition__wrap .pos { + margin-bottom: 6px; + font-size: 1.15em; + font-weight: normal + } + + .test__definition__wrap p { + display: table-cell; + padding-right: 14px + } + + .test__form,#add-wordlist { + display: table; + width: 100%; + margin-bottom: 0; + vertical-align: top; + padding-bottom: 10px + } + + .test__form .test__answer { + font-size: 1.15em; + width: 350px; + float: left; + margin-bottom: 7px; + margin-right: 14px + } + + .test_submit_testme { + float: left + } + + .test__form input[type='text'] { + border: none; + font-size: 1.23em; + padding: 0 10px; + height: 30px; + border-radius: 6px; + background-color: white; + box-shadow: 2px 2px 5px rgba(0,0,0,0.5) inset; + color: grey; + width: 100% + } + + .test__form #add-wordlist .test__submit { + float: left + } + + .result { + display: table-cell; + vertical-align: middle + } + + .test__attempt,.test__useranswer,.test__skipped { + display: inline-block; + font-size: 2.00em; + font-weight: bold; + width: 100%; + margin-left: -30px; + padding-left: 30px + } + + .test__skipped { + font-size: 1.85em + } + + .test__attempt { + color: #C1272D + } + + .test__useranswer { + color: #037531 + } + + .test__correctanswer { + font-weight: bold; + color: #07255E + } + + .test__incorrect,.test__correct { + width: 24px; + height: 24px; + background: #C1272D; + background-size: 100%; + border-radius: 24px; + border: 2px solid white; + vertical-align: top; + text-indent: -9999px; + display: inline-block; + margin-right: 5px + } + + .test__correct { + background-color: #037531; + } + + .test__skipped,.test__correcthead { + text-transform: capitalize + } + + .test__form .test__answer,.test__form .test__submit,.test__form .test__skip,#check-answer .test__form .test__next,#check-answer .test__form .test__quit { + display: table-cell; + vertical-align: top + } + + .test__form .test__submit,.test__form .test__next { + padding-right: 5px + } + + .test__next,.test__quit { + float: left + } + + .mywordlist-warnings,.error { + display: none; + color: #c73b2a + } + + .mywordlist-warnings#wait,.mywordlist-warnings#test-loading,.mywordlist-warnings#test-saving-score,.mywordlist-warnings#supp { + color: #00123c + } + + .mywordlist-warnings#wait:before,.mywordlist-warnings#test-loading:before,.mywordlist-warnings#test-saving-score:before,.mywordlist-warnings#supp:before { + bottom: -2px; + content: ''; + display: inline-block; + margin-right: 8px; + position: relative + } + + .mywordlist-warnings#wait:before { + content: '' + } + + #pronunciation .responsive_row:first-child { + margin-bottom: 0 + } + + .entry-source { + color: white + } + + h2.entry-word { + font-weight: bold; + color: #4577bf; + font-size: 2.77em; + margin-bottom: 7px; + margin-top: 18px; + display: block + } + + h2 .pos { + margin-bottom: 6px; + font-size: 1.15em; + font-weight: normal + } + + .pron__wrap h3,.pron_row { + max-width: 700px + } + + .pron__wrap h3 { + font-size: 1.38em; + color: #4577bf; + margin-top: 12px; + margin-bottom: 0; + padding-bottom: 3px; + padding-left: 0px; + border-bottom: 1px solid silver + } + + .pron__wrap { + max-width: 700px + } + + .pron__wrap h5 { + margin-top: 12px; + margin-bottom: 0; + padding-bottom: 3px; + padding-left: 0px; + border-bottom: 1px solid silver + } + + .pron_row { + padding: 0; + height: 39px + } + + .pron_row .sound { + vertical-align: middle + } + + .pron_row * { + display: inline-block + } + + .pron_row .pron_button { + border: 1px solid black; + padding: 4px; + margin-right: 15px + } + + .pron_row .pron_button .pron_button_icon { + border: 1px solid black; + width: 30px; + height: 20px + } + + .pron_row .pron_button_wrapper { + padding: 4px; + display: inline-block; + background-color: #00123c; + height: 34px; + margin-left: 7px; + border-radius: 18px; + display: none; + vertical-align: middle; + box-shadow: 0 38px 38px -38px #e0f2fd inset + } + + .pron_row .btn:hover,.pron_row input[type='submit']:hover,.pron_row .btn.inactive,.pron_row input.inactive[type='submit'] { + box-shadow: none; + border-width: 0 + } + + .pron_row .pron_button_record,.pron_row .pron_button_play,.pron_row .pron_button_stop,.pron_row .pron_record_stop,.pron_row .pron_play_stop { + width: 24px; + height: 24px; + display: block; + float: left; + margin-right: 6px; + background-repeat: no-repeat; + background-position: center center; + border-radius: 12px; + background-color: silver + } + + .pron_row .button_is_active { + background-color: #0d3880; + box-shadow: 0 30px 30px -30px #45689f inset + } + + .pron_row .button_is_playing { + background-color: #579a27; + box-shadow: 0 30px 30px -30px #45689f inset + } + + .pron_row .button_is_active.pron_button_record:hover,.pron_row .button_is_active.pron_button_play:hover,.pron_row .button_is_active.pron_button_stop:hover { + background-color: #00123c + } + + .pron_row.active .pron_button_wrapper { + display: inline-block + } + + #pronunciation xr-gs,#pronunciation res-g { + display: none + } + + #topic-list dd ul { + padding-left: 0 + } + + #topic-list dd ul li { + padding-bottom: 7px + } + + #topic-list dd { + border: none; + margin-left: 21px + } + + #topic-list dt { + font-weight: normal + } + + .topic-desc { + margin: 7px 0 7px 0 + } + + .word-list li { + display: inline-block; + padding: 0 14px 7px 0 + } + + .video-page-wrap h4 { + margin: 14px 0 7px + } + + .video-player,.video-player__text { + display: table-cell; + vertical-align: middle + } + + .video-player__text { + padding-right: 7px + } + + .video-player { + padding-right: 14px; + height: 130px; + width: 230px + } + + .video-player iframe { + display: block + } + + .video__wrap { + display: table-row; + width: 100%; + float: left; + margin-bottom: 3px; + background-color: #efefef + } + + .video__wrap p { + margin-bottom: 0 + } + + .video__wrap a { + display: block + } + + .video__wrap:last-child { + margin-bottom: 0 + } + + .video__wrap.full-width { + width: 100%; + display: block; + float: none + } + + .premium-h { + position: relative; + margin-bottom: 12px + } + + .premium-h .h { + position: absolute; + color: #ffffff; + left: 20px; + bottom: 10px + } + + .premium-h-img { + width: 100%; + height: auto + } + + .res-g>.unbox { + background-color: rgba(199,110,6,0.1); + display: block; + margin: 12px 0 18px 0; + position: relative; + overflow: hidden; + border-left: 3px solid #C76E06 + } + + .res-g>.unbox>.heading { + background-color: rgba(199,110,6,0.2); + display: block; + padding: 6px 12px 6px 12px; + font-size: 1.19em; + position: relative; + overflow: hidden + } + + .res-g>.unbox>.body { + display: block; + padding: 12px 18px 12px 18px; + position: relative; + overflow: hidden + } + + .main-container #wotd-box { + max-width: 300px; + margin-left: auto; + margin-right: auto + } + + *,*:before,*:after { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box + } + + .entry { + font-size: 1.15em; + color: #333; + margin-bottom: 15px + } + + .entry a:hover { + font-weight: normal + } + + .sans-italic,.etym_i,.geo,.pos,.reg,.subj,.wfp,.xpos,.webtop-g .pos+.pnc,.collapse .ff,.collapse[title^="AWL Collocations"] .er { + font-style: italic + } + + .sans-rom,.def,.dh,.dtxt,.footer,.frac-g,.gl,.gram,.li,li.sn-g:before,.ndv,.shcut,.st,.td,.use,.xr-g,.wfo .wrap,.wfo pnc.wrap,.vp .prefix,.vp pnc.prefix { + font-weight: normal; + font-style: normal + } + + .sans-bold,.cf,.dhb,.dr,.id,.idm,.if,.pv,.th,.v,.ve,.vp,.wfo,.wfw,.xh,.xw { + font-weight: bold; + font-style: normal + } + + .sans-bolditalic { + font-weight: bold; + font-style: italic + } + + .sans-sc,.sc,.xr-gs .prefix,.xr-gs pnc.prefix { + font-variant: small-caps + } + + .serif-bolditalic,.cl,.x .eb { + font-weight: bold; + font-style: italic + } + + .serif-italic,.wx { + font-style: italic + } + + .serif-rom,.def-qt { + font-weight: normal; + font-style: normal + } + + .italic,.ei { + font-style: italic + } + + .bold,.eb { + font-weight: bold; + font-style: normal + } + + .bolditalic,.ebi { + font-weight: bold; + font-style: italic + } + + .entry-box-style,.un,.collapse { + background-color: rgba(199,110,6,0.1); + display: block; + margin: 12px 0 18px 0; + position: relative; + overflow: hidden + } + + #entryContent:not(.ocoll) .top-container .entry-box-style,#entryContent:not(.ocoll) .top-container .un,#entryContent:not(.ocoll) .top-container .collapse { + background-color: rgba(69,119,191,0.1); + border-left: 3px solid #4577bf + } + + #entryContent:not(.ocoll) .top-container .entry-box-style-heading:hover,#entryContent:not(.ocoll) .top-container .collapse .heading:hover,.collapse #entryContent:not(.ocoll) .top-container .heading:hover,#entryContent:not(.ocoll) .top-container .entry-box-style-heading:active,#entryContent:not(.ocoll) .top-container .collapse .heading:active,.collapse #entryContent:not(.ocoll) .top-container .heading:active,#entryContent:not(.ocoll) .top-container .unbox.is-active .heading,.unbox.is-active #entryContent:not(.ocoll) .top-container .heading,#entryContent:not(.ocoll) .top-container .entry-box-style-heading:focus,#entryContent:not(.ocoll) .top-container .collapse .heading:focus,.collapse #entryContent:not(.ocoll) .top-container .heading:focus { + background-color: rgba(69,119,191,0.2) + } + + #entryContent:not(.ocoll) .top-container .unbox.is-active .heading:before { + background-position: center -92px + } + + .entry-box-style-heading,.collapse .heading,.collapse pnc.heading { + padding: 6px 12px 6px 12px; + margin: -12px -18px -12px -18px; + font-size: 1.19em; + user-select: none; + } + + .entry-box-style-heading:hover,.collapse .heading:hover,.entry-box-style-heading:active,.collapse .heading:active,.unbox.is-active .heading,.unbox.is-active pnc.heading,.entry-box-style-heading:focus,.collapse .heading:focus { + background-color: rgba(199,110,6,0.2) + } + + .blockquote { + background-color: rgba(199,110,6,0.1); + display: block; + padding: 12px 18px 12px 18px; + margin: 18px; + position: relative + } + + .bre,.name { + display: none + } + + .cf { + display: inline + } + + .def { + display: inline + } + + .dr { + font-size: 1.23em + } + + .dr-g { + display: block; + margin-top: 18px; + margin-left: 16px; + position: relative + } + + .dr-g:before { + content: ""; + left: -18px; + position: absolute; + top: 5px; + width: 14px; + height: 14px; + background-size: 14px auto + } + + .dr-gs { + display: block + } + + .eph { + display: inline-block + } + + .esu { + font-size: smaller; + vertical-align: super + } + + .footer { + font-size: 1.00em + } + + .frac-g { + position: relative; + top: -3px + } + + .frac-g:before { + content: '/'; + position: absolute; + left: 4px; + top: -3px + } + + .gram-g { + color: #767676 + } + + .h-g { + margin-bottom: 15px + } + + .hm,pnc.hm,.xhm { + font-size: smaller; + margin-left: 1px; + position: relative; + top: -5.25px + } + + .hm-g { + display: block + } + + .idm { + font-size: 1.23em + } + + .idm-g,.pv-g { + margin: 12px 18px 12px 18px; + display: block + } + + .idm-gs,.pv-gs,.wf-g { + border: 1px solid rgba(199,110,6,0.4); + border-radius: 10px 10px 0 0; + display: block; + margin: 18px 10px 18px 0; + overflow: hidden + } + + .label-g { + color: #767676; + font-weight: normal + } + + li.sn-g:before { + color: #00123c; + padding-right: 6px; + position: absolute; + text-align: right; + left: -8px; + width: 24px + } + + .ndv { + color: #00837d + } + + .pron-g { + white-space: nowrap + } + + .pron-g[geo~=br] .prefix { + color: #07255e + } + + .pron-g[geo~=n_am] .prefix { + color: #8f0610 + } + + .pron-gs { + display: inline + } + + .pv { + display: inline; + font-size: 1.23em + } + + .pvarr:before { + content: ""; + width: 15px; + height: 11px; + background-size: 15px auto; + display: inline-block + } + + .shcut { + font-size: 1.26em; + display: block; + margin-top: 1em; + border-bottom: 1px solid rgba(199,110,6,0.5) + } + + .sn-g { + display: block; + position: relative; + margin-top: 12px + } + + .sn-g[ox3000="y"] .oxford3000 { + background-color: #4577bf; + border-radius: 12px; + width: 20px; + height: 20px; + margin: 0 6px 3px 0; + position: static; + vertical-align: middle + } + + .sn-gs,.res-g { + display: block + } + + .un { + padding: 12px 18px 12px 18px; + text-indent: 0 + } + + .vp { + margin-right: 12px + } + + .vp-g { + display: block + } + + .wf-g { + border-color: rgba(69,119,191,0.4); + margin: 6px 0 6px 0; + padding: 6px 12px 6px 12px; + display: inline-block + } + + .wfw-g { + display: block + } + + .wx { + text-decoration: line-through + } + + .x-g { + display: block; + position: relative; + margin-top: 6px; + margin-left: 1em; + padding-left: 1em; + } + + .x-g:before { + content: "\2022"; + left: 0; + position: absolute; + } + + .x-gs { + display: block + } + + .xr-gs { + display: block; + margin-top: 6px + } + + .z_n { + padding-right: 6px !important + } + + .nbsp,.side-panel>div,.vp-gs>div,.top-g .pos-g,.z_n+.z,.z_gr_br,#ox-enlarge+.z,.h-g+.z,.pron-gs .wrap,li.sn-g>.num,span[hide~="y"],.top-container br { + display: none + } + + .entry-in-other-dict a { + font-weight: normal + } + + .webtop-g .pos { + margin-left: 6px; + } + + .webtop-g a:last-of-type { + margin-right: 4px + } + + .top-g .clear { + margin-top: 6px + } + + .top-g .btn { + margin-bottom: 13px + } + + .top-g .btn:hover:not(.inactive) a:before { + background-position: 0 bottom + } + + .top-g .def { + display: block + } + + .top-g>.pron-gs { + display: block + } + + .top-g .v-gs:not([type~="sym"]) { + display: block + } + + .top-container+.pv-gs,.top-container+.wf-g { + border-width: 0; + margin: -12px 0 0 0; + overflow: auto + } + + .top-container+.pv-gs .pv-g,.top-container+.wf-g .pv-g { + margin: 12px 0 18px 0 + } + + .top-container+.pv-gs .pv,.top-container+.wf-g .pv { + margin-left: 0 + } + + .top-container+.pv-gs>.heading,.top-container+.wf-g>.heading { + display: none + } + + .top-container+.pv-gs .heading,.top-container+.wf-g .heading { + color: #333; + font-size: 1.19em; + padding: 6px 12px 6px 12px + } + + .top-container+.pv-gs .xr-gs,.top-container+.wf-g .xr-gs { + margin-top: 6px + } + + .top-container+.pv-gs .xr-gs:before,.top-container+.wf-g .xr-gs:before { + display: inline + } + + .top-container+.pv-gs .Ref,.top-container+.wf-g .Ref { + display: inline; + margin: 0 + } + + .if-g .pron-gs { + display: inline + } + + ol.h-g,ol.pv-g,ol.idm-g { + list-style-type: none; + padding-left: 0; + counter-reset: num + } + + ol.h-g li.sn-g,ol.pv-g li.sn-g,ol.idm-g li.sn-g { + padding-left: 24px + } + + ol.h-g li.sn-g:before,ol.pv-g li.sn-g:before,ol.idm-g li.sn-g:before { + content: counter(num) " "; + counter-increment: num + } + + ol.h-g>.res-g,ol.h-g .sn-gs>.xr-gs,ol.pv-g>.res-g,ol.pv-g .sn-gs>.xr-gs,ol.idm-g>.res-g,ol.idm-g .sn-gs>.xr-gs { + margin-left: 24px + } + + .def .xr-gs { + display: inline + } + + .def .xr-gs:before { + display: none + } + + .x-g .cf { + margin-right: 6px + } + + .xr-gs:before { + content: ""; + margin-right: 4px; + position: relative; + top: -1px; + width: 13px; + height: 9px; + background-size: 13px auto; + display: inline-block + } + + .xr-gs[xref_type="external"]:before { + background-repeat: no-repeat; + height: 18px; + width: 18px; + background-size: 18px auto; + vertical-align: middle; + margin-right: 8px + } + + .xr-gs[xref_type="external"] .prefix { + font-variant: inherit + } + + .ndv .xh { + font-weight: normal + } + + .sep+.sep { + display: none + } + + .idm-gs>.heading,.idm-gs pnc.heading,.pv-gs>.heading,.pv-gs pnc.heading { + display: block; + font-size: 1.38em; + padding: 12px 18px 0 18px; + color: #C76E06 + } + + .idm-gs>.xr-gs,.pv-gs>.xr-gs { + margin: 12px 0 12px 0 + } + + .idm-gs .un,.pv-gs .un { + margin-left: 18px; + margin-right: 18px + } + + .pv-gs>.xr-gs { + margin-top: 0 + } + + .pv-gs>.xr-gs:before { + display: none + } + + .pv-gs .xr-gs>.heading { + margin-bottom: 6px; + display: block; + font-size: 1.38em; + padding: 12px 18px 0 18px; + color: #C76E06 + } + + .pv-gs>.xr-gs .Ref { + display: block; + margin: 6px 18px + } + + .pv-gs>.xr-gs .Ref .pvarr:before { + content: ""; + width: 15px; + height: 11px; + background-size: 15px auto; + display: inline-block + } + + .idm-g .top-container,.pv-g .top-container { + padding: 0; + margin: 0 0 -6px 0; + background-color: transparent + } + + .idm-g .top-container .clear,.idm-g .top-container .btn,.idm-g .top-container br,.pv-g .top-container .clear,.pv-g .top-container .btn,.pv-g .top-container br { + display: none + } + + .idm-g .v-gs,.pv-g .v-gs { + display: block + } + + .idm-g .idm+.label-g,.pv-g .idm+.label-g { + margin-left: 6px + } + + .wfo .sym_first:after,.wfo pnc.sym_first:after { + content: " " + } + + .blockquote .p { + display: block; + margin: 0 + } + + .blockquote .wrap { + display: none + } + + .blockquote:before,.blockquote:after,.blockquote pnc.wrap_open,.blockquote pnc.wrap_close { + color: #C76E06; + font-size: 6.15em; + position: absolute + } + + .blockquote:before,.blockquote pnc.wrap_open { + left: -20px; + position: absolute; + top: 24px + } + + .blockquote:after,.blockquote pnc.wrap_close { + right: -20px; + bottom: 0 + } + + .blockquote:before { + content: "\201C" + } + + .blockquote:after { + content: "\201D" + } + + .frac-g .num { + font-size: smaller; + position: relative; + top: -5px; + margin-right: 3px + } + + .frac-g .den { + font-size: smaller; + vertical-align: sub + } + + .un .x-gs { + display: inline + } + + .dr-gs .top-container { + background-color: transparent; + margin: 0; + padding: 0 + } + + .dr-gs .clear { + display: none + } + + .dr-gs .sn-g { + margin-top: 6px + } + + .dr-gs .sym_first { + margin-right: 6px + } + + .dr-gs .oxford3000 { + width: 25px; + height: 25px; + top: -2px + } + + .dr-gs .academic { + width: 25px; + height: 25px; + top: -2px + } + + .dr-gs .pos-g { + display: inline + } + + .dr-gs .top-g>span { + margin-right: 4px + } + + .entry[dict~="oaad"] .collapse[title^="Grammar"] .p { + margin-top: 3px; + margin-left: 16px; + position: relative; + display: block + } + + .entry[dict~="oaad"] .collapse[title^="Grammar"] .p:before { + content: ""; + position: absolute; + left: -15px; + top: 9px; + width: 7px; + height: 7px; + background-size: 7px auto + } + + .collapse { + padding: 12px 18px 12px 18px; + border-left: 3px solid #C76E06; + } + + .collapse .heading,.collapse pnc.heading,.collapse .body,.collapse .h1,.collapse .li,.collapse .inline { + display: block + } + + .collapse .heading:hover,.collapse pnc.heading:hover { + cursor: pointer + } + + .collapse .heading:before,.collapse pnc.heading:before { + width: 14px; + height: 14px; + background-size: 100% auto; + background-position: center bottom; + content: "+"; + display: inline-block; + position: relative; + top: 1px + } + + .collapse .body,.collapse .heading+.def { + display: none + } + + .collapse .h1 { + color: #C76E06; + font-size: 1.5em; + margin: 12px 0 6px 0; + font-weight: bold; + display: block + } + + .collapse .h3,.collapse .h2 { + font-size: 1.26em; + margin: 6px 0 3px 0; + font-weight: bold; + display: block; + border-bottom: 1px solid rgba(199,110,6,0.5); + color: #333 + } + + .collapse .li .x-gs { + display: inline + } + + .collapse .x-gs { + margin-bottom: 6px + } + + .collapse .p { + margin: 0; + display: block + } + + .collapse .p .xr-gs { + display: inline; + margin: 0 + } + + .collapse .p .xr-gs[type~="pdf"] { + display: none + } + + .collapse .inline,.collapse ul.inline { + display: block; + font-size: 1.26em; + margin-bottom: 12px + } + + .collapse .inline .li,.collapse ul.inline .li { + display: inline-block; + font-weight: bold + } + + .collapse .inline .li:not(:last-of-type):after,.collapse ul.inline .li:not(:last-of-type):after { + content: ""; + margin-left: 5px; + position: relative; + top: -2px; + width: 6px; + height: 6px; + background-size: 6px auto; + display: inline-block + } + + .collapse .deflist .li,.collapse ul.deflist .li { + margin-top: 6px + } + + .collapse .deflist .li>.eb,.collapse ul.deflist .li>.eb { + color: #C76E06; + font-size: 1.23em + } + + .collapse .bullet,.collapse ul.bullet { + display: block; + margin: 6px 0 12px 0 + } + + .collapse .bullet .li,.collapse ul.bullet .li { + margin-top: 3px; + margin-left: 16px; + position: relative; + display: block + } + + .collapse .bullet .li:before,.collapse ul.bullet .li:before { + content: "\2022"; + position: absolute; + left: -15px; + } + + .collapse .table { + margin: 12px; + display: table + } + + .collapse .th,.collapse .td { + padding: 2px 12px 2px 12px; + border-bottom: 1px solid rgba(199,110,6,0.5); + display: table-cell + } + + .collapse .th { + background-color: rgba(199,110,6,0.2) + } + + .collapse .tr { + display: table-row + } + + .collapse[title^="Wordfinder"] .xr-gs:before { + display: none + } + + .collapse[title^="Extra examples"] .x-gs .x-g { + margin-left: 0; + } + + .collapse[title^="More Like This"] .inline .li { + font-weight: normal; + font-size: 1.15em + } + + .collapse[title^="More Like This"] .sep { + display: none + } + + .collapse[title^="AWL Collocations"] .er { + font-weight: normal + } + + .collapse[title^="AWL Collocations"] .h3 { + border-bottom: 0 + } + + .collapse[title^="AWL Collocations"] .h3 .inline { + margin-bottom: 0; + font-size: 1.15em + } + + .unbox.is-active .heading,.unbox.is-active pnc.heading { + margin-bottom: 12px + } + + .unbox.is-active .heading:hover,.unbox.is-active pnc.heading:hover { + cursor: pointer + } + + .unbox.is-active .body,.unbox.is-active .heading+.def { + display: block + } + + .snippet .collapse { + border-left-color: #A9222D; + background-color: transparent; + } + + .snippet .collapse .shcut { + border-bottom: none + } + + .snippet .collapse .heading { + background-color: rgba(169,34,45,0.1); + } + + .snippet .collapse .heading:hover { + background-color: rgba(169,34,45,0.2) + } + + .snippet .collapse .shcut { + margin-top: 12px; + font-size: 1.1em; + } + + .snippet .collapse .sn-g { + margin-top: 0 + } + + .snippet .collapse .coll-g:before { + content: "\2022"; + font-size: 1.54em; + line-height: 1; + padding-top: 2px; + margin-right: 6px; + display: inline-block; + position: relative; + top: 2px; + color: silver + } + + .snippet .collapse .coll-gs .sep { + display: none + } + + .peu-grammar-home .box { + background: white + } + + .block { + display: block + } + + .bold,.eb,.eb,.title_bold { + font-weight: bold + } + + .boldItalic,.ebi { + font-style: italic; + font-weight: bold + } + + .caption { + font-size: 0.92em; + padding-left: 20px + } + + .commentary { + font-style: normal; + font-weight: normal; + font-variant: normal + } + + .construct { + font-weight: bold + } + + .constructGroup .construct { + font-weight: normal; + display: inline-block; + padding: 3px 8px; + background-color: #c6d9f9; + margin-bottom: .4em + } + + .context { + font-style: normal; + font-weight: normal; + font-variant: normal + } + + .dialogue { + font-style: italic + } + + .dialogue .speaker { + font-style: normal + } + + .equivalent { + font-style: normal; + font-weight: normal; + font-variant: normal + } + + .example { + display: block; + font-style: italic; + padding-left: 12px; + text-indent: -12px + } + + .example * { + text-indent: 0 + } + + .exampleGroup { + padding-left: 20px; + display: block; + position: relative + } + + .exampleGroupSet { + display: block + } + + .example_runon { + margin-left: 6px + } + + .grammarEntry .h { + font-weight: bold + } + + .hang { + min-width: 30px; + display: table-cell + } + + .indent { + display: table-cell + } + + .italic,.ei,.ei { + font-style: italic + } + + .list_keyword { + font-weight: bold; + display: inline-block; + margin-top: 8px + } + + .locution { + display: inline + } + + .locution:not(:last-child) { + margin-right: 6px + } + + .note { + font-size: 0.80em; + } + + .note .a { + font-size: 111.35%; + } + + .notes { + display: block; + margin-top: 11px; + border-left: 4px solid silver; + padding-left: 8px + } + + .notPertinent { + font-style: normal; + font-weight: normal; + font-variant: normal + } + + .pertinent { + font-style: italic + } + + .phons { + font-style: normal + } + + .roman { + font-style: normal + } + + .smallCaps,.esc { + font-variant: small-caps; + font-variant: all-small-caps; + font-size: 1.20em; + text-transform: lowercase + } + + .strikethrough,.estrike { + text-decoration: line-through + } + + .strikethrough .eph,.estrike .eph { + text-decoration: line-through + } + + .strikethrough .noStrike,.estrike .noStrike { + display: inline-block + } + + .subtitle { + font-weight: normal + } + + .subtitle .ebi { + font-weight: normal + } + + .superSectionIntro { + display: block; + margin: 1em 0 + } + + .tabular { + display: block + } + + .title { + color: #0d3880; + display: block; + font-weight: bold; + font-size: 1.20em + } + + .title .subtitle .ei { + font-weight: normal + } + + .underline { + text-decoration: underline + } + + .vocabBox { + background-color: #c6d9f9; + padding: 3px 20px; + margin-bottom: .4em; + margin-top: .4em; + display: inline-block + } + + .grammarEntry .wx-gs { + display: block; + border: 1px solid #0d3880; + padding: 8px; + margin-top: 14px + } + + .grammarEntry .wx-gs .title { + padding-bottom: 8px; + font-weight: bold; + font-size: 1.38em + } + + .grammarEntry .wx-gs .wx { + font-style: normal; + text-decoration: none; + display: block; + padding: 2px 0 2px 26px; + position: relative + } + + .grammarEntry .wx-gs .wx:before { + content: ""; + display: inline-block; + width: 12px; + height: 16px; + position: absolute; + top: 6px; + left: 0; + background-size: 12px 16px + } + + .xh { + font-variant: small-caps + } + + .xref { + color: #0d3880; + white-space: nowrap + } + + .xref:before { + content: ""; + display: inline-block; + position: relative; + border-top: 0.35em solid transparent; + border-bottom: 0.35em solid transparent; + border-left: 0.7em solid #0d3880; + margin-right: 4px; + margin-left: 1px + } + + .grammarEntry .xr-gs .xr-g { + display: block + } + + .grammarEntry .Ref .xr-gs { + display: inline-block + } + + .peu-btns { + padding-top: 10px; + display: block + } + + .peu-btns:after { + content: ""; + display: table; + clear: both + } + + .peu-btns a { + display: block; + position: relative; + min-width: 90px; + padding: 0 12px; + background-color: #004aac; + color: white; + font-variant: normal; + text-transform: lowercase; + font-size: 0.92em; + font-weight: normal; + border-radius: 15px + } + + .peu-btns a:before,.peu-btns a:after { + display: inline-block; + vertical-align: middle; + width: 11px; + height: 30px + } + + .peu-btns a:hover { + background-color: #00123c + } + + .peu-btns .xr-g { + display: block + } + + .peu-btns .xr-g:first-child a { + float: left + } + + .peu-btns .xr-g:first-child a:before { + content: ""; + margin-right: 6px + } + + .peu-btns .xr-g:last-child a { + float: right; + text-align: right + } + + .peu-btns .xr-g:last-child a:after { + content: ""; + background-position: right top; + margin-left: 6px + } + + .peu-btns .xr-g:last-child a:before { + content: none + } + + .page-head,.grammarEntry>.title,.introduction>.title { + font-size: 1.60em; + font-weight: bold; + margin-bottom: 1em + } + + .grammarEntry { + display: block; + clear: both + } + + .grammarEntry>.title[section="yes"] { + font-size: 1.80em; + font-weight: bold; + margin-bottom: 1em + } + + .grammarEntry>.title .hang { + padding-right: 20px + } + + .grammarEntry>.title .indent .notPertinent { + font-weight: inherit + } + + .grammarEntry .breadcrumb { + display: none + } + + .grammarEntry>.breadcrumb { + font-size: 0.80em; + display: block; + margin-top: -10px; + margin-bottom: 4px + } + + .grammarEntry>.breadcrumb:before { + content: "PEU"; + font-weight: bold + } + + .grammarEntry>.breadcrumb .l1 { + padding-left: 23px; + background-size: 14px 15px + } + + .grammarEntry .xr-gs:before,.grammarEntry .institle,.grammarEntry .arl { + display: none + } + + .grammarEntry .example_runon { + display: block; + margin-left: 0 + } + + .grammarEntry .exampleGroup { + padding-left: 12px + } + + .grammarEntry .exampleGroup .hang { + left: 12px + } + + .grammarEntry .exampleGroup .hang+.indent { + padding-left: 10px; + display: block + } + + .grammarEntry .constructGroup { + padding-left: 12px + } + + .author-name { + color: #4d4c4c; + font-size: 1.38em + } + + .peu-home-logo { + display: inline-block; + margin: -10px 0 -10px + } + + .peu-home-un-authorized { + padding-bottom: 20px + } + + .peu-home-un-authorized h1 { + font-size: 2.15em; + margin-top: 0; + margin-bottom: 8px + } + + .peu-home-un-authorized h1:after { + content: ""; + display: inline-block; + width: 26px; + height: 28px; + background-size: 26px 28px; + margin-left: 8px; + margin-top: -4px; + vertical-align: middle + } + + .peu-home-un-authorized #generaltext h2 { + font-size: 1.23em; + margin-top: 24px + } + + .peu-home-un-authorized #generaltext .open-close h2 { + color: #0d3880 + } + + .peu-home-un-authorized #generaltext .open-close h2:first-child { + margin-top: 0 + } + + .peu-home-un-authorized h3 { + font-size: 1.23em; + font-weight: bold; + } + + .peu-home-un-authorized h3+h3 { + margin-top: -7px + } + + .peu-home-un-authorized .peu-quote { + text-align: right; + font-size: 1.08em; + margin: 4px 0 + } + + .peu-home-authorized h3 { + padding-bottom: 0 + } + + .peu-sales-box { + border: 1px solid #8f0610; + padding: 12px 16px 10px; + margin-bottom: 20px; + margin-top: 20px + } + + .peu-sales-box .bgtn-premium { + margin-top: 6px + } + + .grammarEntry[type="interstitial"] .title { + color: #333; + font-weight: bold + } + + .grammarEntry[type="interstitial"]>.title+.section { + margin-bottom: 8px + } + + .grammarEntry[type="interstitial"] .section .title { + display: inline; + } + + .grammarEntry[type="interstitial"] .section { + margin-bottom: 6px + } + + .grammarEntry[type="interstitial"]>.section { + margin-top: 24px + } + + .grammarEntry[type="interstitial"] .subtitle { + font-weight: bold + } + + .grammarEntry[type="interstitial"] .title .indent { + font-size: 1.15em; + font-weight: normal; + display: inline + } + + .grammarEntry[type="interstitial"] .title+.block { + display: inline-block; + padding-left: 18px; + margin-top: 0 + } + + .grammarEntry[type="interstitial"] .title+.block .xr-gs { + display: inline-block; + margin-top: 0 + } + + .section { + display: block + } + + .section>.title { + margin-top: 1em + } + + .section>.section>.title { + font-size: 1.00em; + font-weight: normal + } + + .grammarEntry>.section[section_num]>span:not(.title):not(.pnc),.grammarEntry>.section>.section[section_num]>span:not(.title):not(.pnc) { + margin-left: 30px + } + + .grammarEntry>.section[section_num]+.notes,.grammarEntry>.section>.section[section_num]+.notes { + margin-top: 24px; + margin-left: 30px; + border-left: 12px solid silver + } + + .section>.block,.section>.constructGroup,.section>.notes,.section>.lettered,.section>.bulleted,.section>.numbered { + display: block; + margin-top: .4em + } + + .section .title { + display: table + } + + .section .title .indent,.section .title .indent .ebi { + font-weight: normal + } + + .exampleGroup .hang { + position: absolute; + left: 0 + } + + .example .pertinent { + font-weight: bold + } + + .example .commentary .pertinent { + font-weight: normal + } + + .example .commentary .example .pertinent { + font-weight: bold + } + + .block .example,.commentary .example { + display: inline; + padding-left: 0; + text-indent: 0 + } + + .vocabBox .example { + display: inline + } + + table span { + margin-left: 0 !important + } + + table .exampleGroup,table .example { + padding-left: 0 + } + + table td { + padding: 0 1em 0 0; + vertical-align: top + } + + table .block { + margin: 0 + } + + .frame_all_,.frame_none_,.frame_no_row_,.frame_never_,.frame__,.frame_none_0 { + margin-top: .8em; + margin-bottom: .4em + } + + .frame_all_ th,.frame_none_ th,.frame_no_row_ th,.frame_never_ th,.frame__ th,.frame_none_0 th { + text-align: left; + font-weight: bold + } + + .frame_all_ tr,.frame_no_row_ tr { + border: 1px black solid + } + + .frame_all_ th,.frame_no_row_ th { + padding: 2px 6px + } + + .frame_all_ td,.frame_no_row_ td { + padding: 2px 6px 2px 16px; + text-indent: -10px + } + + .frame_no_row_ tr { + border-width: 0 1px + } + + .frame_no_row_ tr:last-child { + border-bottom-width: 1px + } + + .frame_no_row_ tr:first-child { + border-top-width: 1px; + border-bottom-width: 1px + } + + .frame_none_ th,.frame_none_0 th,.frame__ th { + text-align: left; + padding-right: 15px + } + + .plain { + display: block + } + + .plain .indent { + display: block + } + + .plain .exampleGroup { + padding-left: 20px + } + + .plain .example { + padding-left: 0 + } + + .plain .block { + margin: 0 + } + + .bulleted,.lettered,.numbered { + padding-left: 20px; + position: relative + } + + .bulleted .li:before,.lettered .li:before,.numbered .li:before { + position: absolute; + left: 0; + font-weight: bold + } + + .bulleted .li:before { + content: "\2022" + } + + .lettered { + counter-reset: letter-counter + } + + .lettered .li:before { + content: counter(letter-counter, lower-alpha); + counter-increment: letter-counter + } + + .numbered { + counter-reset: number-counter + } + + .numbered .li:before { + content: counter(number-counter); + counter-increment: number-counter + } + + .numbered .bulleted { + display: block + } + + .numbered .bulleted .li:before { + content: "\2022" !important; + counter-increment: none + } + + .peu-contents-full { + margin-bottom: 10px + } + + .peu-contents-full li a { + padding: 7px 0 7px 25px; + } + + .peu-contents-full ul>li>div>a { + color: #333 + } + + .peu-contents-full ul ul>li>div>a { + color: #004aac; + padding: 4px 0 4px 25px + } + + .peu-contents-full ul ul ul>li>div>a { + color: #333; + padding: 4px 0 4px 25px + } + + .peu-contents-full .section .section[subsection="1"]:not(:first-child) .title:before { + content: "- " + } + + #rightcolumn .toc_header { + border-bottom: 1px solid #cccccc + } + + #rightcolumn .toc_header h4 { + padding-left: 26px; + font-size: 1.15em + } + + #rightcolumn .toc_content { + padding-right: 8px + } + + #rightcolumn .toc_content>a { + margin-top: 8px; + display: inline-block + } + + #rightcolumn .relatedBlock ul ul div a { + padding: 4px; + margin-left: 16px; + color: #004aac + } + + #rightcolumn .relatedBlock ul ul .icon-plus,#rightcolumn .relatedBlock ul ul .icon-minus { + display: none + } + + #rightcolumn .relatedBlock ul ul ul[style] { + display: none !important + } + + .grammarEntry .pron-gs { + border: none; + padding: 0 4px; + vertical-align: top; + margin-top: 0; + display: inline-block + } + + .grammarEntry .pron-gs .sound { + display: block + } + + .lang-study-page h3,.peu-introduction-page h3 { + margin: 14px 0 0 + } + + .peu-link-nav,#browse-letters { + margin-top: 16px + } + + .peu-link-nav:after,#browse-letters:after { + content: ""; + display: table; + clear: both + } + + .peu-link-nav a,#browse-letters a { + display: block; + float: left; + padding: 0 8px; + min-width: 34px; + text-align: center; + margin-right: 8px; + margin-bottom: 8px; + border: 2px solid #cccccc; + border-radius: 8px + } + + .peu-link-nav a:hover,#browse-letters a:hover { + background-color: #ebebeb; + text-decoration: none; + color: black + } + + .definition-wrap { + margin-left: 22px; + text-indent: -22px; + margin-bottom: 8px + } + + .phon-table td { + height: 30px + } + + .phon-table td:first-child { + width: 35px + } + + .story-behind-peu .float-right { + float: right; + margin: 5px 0 10px 10px + } + + .story-behind-peu .float-left { + float: left; + margin: 5px 10px 10px 0 + } + + .story-behind-peu .float-right,.story-behind-peu .float-left { + max-width: 50%; + height: auto + } + + .entry-unauthorised .restrictedLock { + color: #333; + margin-bottom: 18px + } + + .entry-unauthorised .restrictedImg img { + width: 14px + } + + .entry-unauthorised .restrictedLinks table { + margin-bottom: 20px; + position: relative + } + + .entry-unauthorised .restrictedLinks td { + display: block; + float: left; + } + + .entry-unauthorised .restrictedLinks td:first-child { + font-size: 1.38em; + font-weight: bold + } + + .introduction>.title { + margin-bottom: 0 + } + + .introduction>.title .hang { + display: inline-block; + padding-right: 20px; + font-weight: normal + } + + .introduction>.title .indent { + display: inline-block; + font-weight: bold + } + + .introduction>.title .indent .ei,.introduction>.title .indent .notPertinent { + font-weight: bold + } + + .superSectionIntro,.title_contents { + text-transform: uppercase; + color: #333; + font-size: 1.85em; + margin-top: 1em; + margin-bottom: 10px; + display: block; + font-weight: normal + } + + #simple-present-forms__16 tr,#passive-structures-and-verb-forms__23 tr { + border-width: 0 1px 0 1px + } + + #simple-present-forms__16 tr:first-child,#passive-structures-and-verb-forms__23 tr:first-child { + border-width: 1px + } + + #simple-present-forms__16 tr:last-child,#passive-structures-and-verb-forms__23 tr:last-child { + border-width: 0 1px 1px 1px + } + + #abbreviations__164 td,#prefixes-and-suffixes__997 td,#prefixes-and-suffixes__1024 td,#prefixes-and-suffixes__798 td,#special-rules-and-exceptions__724 td { + padding-left: 10px; + text-indent: -10px + } + + #numbers_1__853 { + margin-left: 15px + } + + #numbers_1__803 td>span { + display: block; + padding-left: 10px; + text-indent: -10px + } + + #numbers_1__803 td:first-child { + white-space: nowrap + } + + #headlines__203 .esc { + display: block; + padding-left: 15px + } + + #special-rules-and-exceptions__724 td .ei:nth-child(2),#special-rules-and-exceptions__724 td .ei:nth-child(3) { + display: block; + padding-left: 10px + } + + #special-rules-and-exceptions__724 .example_runon { + padding-left: 10px + } + + #numbers_1__846 td:first-child { + white-space: nowrap + } + + #spelling-of-plurals__30 tr:nth-child(2) td .ebi,#spelling-of-plurals__128 tr:nth-child(2) td .ebi,#if-introduction__45 tr:nth-child(2) td .ebi,#if-introduction__63 tr:nth-child(2) td .ebi,#if-introduction__81 tr:nth-child(2) td .ebi { + padding: 3px 8px; + background-color: #c6d9f9 + } + + #if-introduction__45 tr:nth-child(2) td,#if-introduction__63 tr:nth-child(2) td,#if-introduction__81 tr:nth-child(2) td { + text-align: left + } + + #if-introduction__45 tr:nth-child(2) td .ebi,#if-introduction__45 tr:nth-child(2) td .eb,#if-introduction__63 tr:nth-child(2) td .ebi,#if-introduction__63 tr:nth-child(2) td .eb,#if-introduction__81 tr:nth-child(2) td .ebi,#if-introduction__81 tr:nth-child(2) td .eb { + font-weight: normal + } + + #if-introduction__45 td:first-child,#if-introduction__63 td:first-child,#if-introduction__81 td:first-child { + min-width: 170px + } + + + #formal-and-informal-vocabulary__9 .exampleGroup .context { + width: 150px; + display: inline-block + } + + #capital-letters_1__9 { + counter-reset: letter-counter; + position: relative + } + + #capital-letters_1__9 .section:before { + content: counter(letter-counter, lower-alpha); + counter-increment: letter-counter; + position: absolute; + left: 0; + font-weight: bold + } + + #spelling-and-pronunciation__134 .example { + display: inline-block + } + + #comparative-and-superlative-adjectives__311,#comparative-and-superlative-adjectives__340,#american-and-british-english__212,#american-and-british-english__24 { + border: none + } + + #comparative-and-superlative-adjectives__311 tr,#comparative-and-superlative-adjectives__340 tr,#american-and-british-english__212 tr,#american-and-british-english__24 tr { + border: none + } + + #comparative-and-superlative-adjectives__311 td,#comparative-and-superlative-adjectives__340 td,#american-and-british-english__212 td,#american-and-british-english__24 td { + padding-left: 12px; + text-indent: -12px + } + + #prepositions-before-particular-words-and-expressions__9 .plain { + margin-top: 16px + } + + #prepositions-before-particular-words-and-expressions__9 .plain .indent { + margin-top: 8px + } + + #prepositions-after-particular-words-and-expressions__9 .plain .indent { + margin-top: 8px + } + + #spelling-and-pronunciation__1176 .sound { + display: inline-block + } + + .swb-home-logo { + display: inline-block; + margin: -10px 0 -10px + } + + h2 .oxford3000 { + top: 0 + } + + .unbox .p { + display: block + } + + .unbox .p+.p { + margin-top: 18px + } + + .trans-page .v_alt { + font-weight: bold + } + + .trans-page .prefix_adv,.trans-page .ds,.trans-page .dtxt { + font-style: italic + } + + .trans-page .tx { + display: block; + color: #008900; + font-size: 1.08em + } + + .trans-page .unbox,.trans-page .bf-gs { + border: 1px solid rgba(199,110,6,0.4); + border-radius: 10px 10px 0 0; + display: block; + margin: 18px 0 18px 0; + overflow: hidden; + padding: 9px 18px + } + + .trans-page .unbox { + border-color: #333 + } + + .trans-page .unbox .h1 { + font-size: 1.54em; + padding: 10px 0 6px; + display: block + } + + .trans-page .top-g .unbox { + border: none; + display: inline; + padding: 0; + margin: 0 + } + + .trans-page .idm-gs { + border-color: #C76E06 + } + + .trans-page .idm-gs>.unbox { + margin-left: 18px; + margin-right: 18px + } + + .trans-page .idm-gs>.prefix { + display: block; + font-size: 1.38em; + padding: 12px 18px 0 18px; + color: #C76E06 + } + + .trans-page .bf-gs .top-container { + margin-left: 0; + margin-right: 0; + margin-bottom: 0; + background-color: transparent; + padding: 0 + } + + .trans-page .bf-gs .top-container .top-g .clear { + display: none + } + + .trans-page .bf-gs .prefix { + color: #C76E06 + } + + .schulwoerterbuch_German-English .clear { + display: none + } + + .audio .icon-audio { + background-repeat: no-repeat; + background-position: left top !important; + background-size: 100%; + width: 24px; + height: 24px; + margin-right: 4px; + display: inline-block + } + + .audio .icon-audio:hover { + background-position: left bottom !important + } + + .shcut-red,.snippet .collapse .shcut,.ocoll .shcut,.collapse[title="Collocations"] .shcut,.collapse[title="All Collocations"] .shcut { + text-transform: uppercase; + font-weight: bold; + border-bottom: none; + margin-top: 1em; + color: #A9222D + } + + .ocoll .top-container { + background-color: transparent; + margin-right: 0; + margin-left: 0; + margin-bottom: 0; + padding: 0; + clear: none + } + + .ocoll .num { + display: inline-block; + width: 20px + } + + .ocoll .colldef { + font-size: 1.23em + } + + .ocoll .pos-g+.colldef { + display: block + } + + .ocoll .subentry-g .top-container,.ocoll .subentry-g .top-g { + display: inline + } + + .ocoll .subentry-g .top-g .clear { + display: none + } + + .ocoll .subentry-g { + display: block + } + + .ocoll .subentry-g+.subentry-g { + margin-top: 30px + } + + .ocoll .top-container+.sn-gs>.shcut-g:first-child .shcut { + margin-top: 9px + } + + .ocoll .top-container .v-gs { + display: inline-block + } + + .ocoll .shcut-g { + padding-left: 20px; + display: block + } + + .ocoll .coll_un:before { + content: "(" + } + + .ocoll .coll_un:after { + content: ")" + } + + .ocoll .coll_un[un="note"] { + font-weight: normal + } + + .ocoll .sn-g { + padding-left: 18px; + margin-top: 8px; + margin-bottom: 8px + } + + .ocoll .sn-g.sn-g:before { + content: "\2022"; + color: silver; + font-size: 1.69em; + padding-right: 6px; + position: absolute; + text-align: right; + left: -8px; + width: 24px + } + + .ocoll .coll-gs:not(.x-gs) { + font-weight: bold + } + + .ocoll .x-gs { + margin-top: 2px; + font-weight: normal + } + + .ocoll .x-gs .x-g { + margin-left: 0; + margin-top: 0 + } + + .ocoll .xr-gs { + padding-left: 21px + } + + .ocoll .collapse .coll-gs { + padding-left: 20px; + display: block; + position: relative + } + + .ocoll .collapse .coll-g:before { + content: "\2022"; + color: silver; + font-size: 1.23em; + padding-right: 6px; + position: absolute; + text-align: right; + left: -8px; + width: 24px + } + + .col-home-logo { + display: inline-block; + margin: -10px 0 -10px; + width: 44px; + height: 44px + } + + .eul { + text-decoration: underline + } + + .collapse[title="Collocations"] .shcut,.collapse[title="All Collocations"] .shcut { + color: #333; + margin-top: 12px + } + + .collapse[title="Collocations"] .sn-g,.collapse[title="All Collocations"] .sn-g { + margin-top: 0 + } + + .collapse[title="Collocations"] .colsep,.collapse[title="All Collocations"] .colsep { + color: silver + } + + .prefix+.Ref { + display: inline; + margin: 0 + } + + .audio_play_button, + .responsive_display_inline_on_smartphone, + .oxford3000 { + display: none; + } +} + +.dictOALD-Related { + a { + margin-left: 2em; + color: #16a085; + } +} diff --git a/src/components/dictionaries/oald/engine.ts b/src/components/dictionaries/oald/engine.ts new file mode 100644 index 000000000..169968d0d --- /dev/null +++ b/src/components/dictionaries/oald/engine.ts @@ -0,0 +1,146 @@ +import { fetchDirtyDOM } from '@/_helpers/fetch-dom' +import { reflect } from '@/_helpers/promise-more' +import { HTMLString, getInnerHTMLThunk, handleNoResult, getText } from '../helpers' +import { AppConfig, DictConfigs } from '@/app-config' +import { DictSearchResult } from '@/typings/server' + +const getInnerHTML = getInnerHTMLThunk('https://www.oxfordlearnersdictionaries.com/') + +interface OALDResultItem { + title: HTMLString + prons: Array<{ + phsym: HTMLString + pron: string + }> + defs: HTMLString +} + +export interface OALDResultLex { + type: 'lex' + items: OALDResultItem[] +} + +export interface OALDResultRelated { + type: 'related' + list: HTMLString +} + +export type OALDResult = OALDResultLex | OALDResultRelated + +type OALDSearchResult = DictSearchResult<OALDResult> +type OALDSearchResultLex = DictSearchResult<OALDResultLex> + +export default function search ( + text: string, + config: AppConfig, +): Promise<OALDSearchResult> { + text = text.replace(/[^A-Za-z0-9]+/g, '-') + const options = config.dicts.all.oald.options + + return fetchDirtyDOM('https://www.oxfordlearnersdictionaries.com/definition/english/' + text) + .then(doc => checkResult(doc, text, options)) +} + +function checkResult ( + doc: Document, + text: string, + options: DictConfigs['oald']['options'], +): OALDSearchResult | Promise<OALDSearchResult> { + if (doc.querySelector('#entryContent')) { + return getAllEntries(doc, text) + .then(handleAllDOMs) + } else if (options.related) { + const $alternative = doc.querySelector('.result-list') + if ($alternative) { + return { + result: { + type: 'related', + list: getInnerHTML($alternative) + } + } + } + } + return handleNoResult() +} + +function getAllEntries ( + doc: Document, + text: string, +): Promise<Document[]> { + const wordTester = new RegExp(`/${text}_\\d+$`) + const hrefs = [...doc.querySelectorAll<HTMLAnchorElement>('#relatedentries .list-col a')] + .map($a => $a.getAttribute('href') || '') + .filter(href => wordTester.test(href)) + + if (hrefs.length > 0) { + return reflect(hrefs.map(href => fetchDirtyDOM(href))) + .then(docs => [doc, ...docs.filter(Boolean)]) + } + + return Promise.resolve([doc]) +} + +function handleAllDOMs ( + docs: Document[], +): OALDSearchResultLex | Promise<OALDSearchResultLex> { + const results = docs.map(handleDOM) + .filter((result): result is DictSearchResult<OALDResultItem> => result as any as boolean) + if (results.length > 0) { + let resultWithAudio = results.find(({ audio }) => (audio && audio.uk && audio.us) as any as boolean) + if (!resultWithAudio) { + resultWithAudio = results.find(({ audio }) => (audio && (audio.uk || audio.us)) as any as boolean) + } + const audio = resultWithAudio ? resultWithAudio.audio : undefined + return { + result: { + type: 'lex', + items: results.map(({ result }) => result) + }, + audio, + } + } + return handleNoResult() +} + +function handleDOM ( + doc: Document, +): null | DictSearchResult<OALDResultItem> { + const result: OALDResultItem = { + title: getInnerHTML(doc, '.webtop-g'), + prons: [], + defs: '', + } + + const audio: { us?: string, uk?: string } = {} + + const $entry = doc.querySelector('#entryContent .h-g') + if (!$entry) { return null } + const $topCon = $entry.querySelector('.top-container') + if (!$topCon) { return null } + + const $prons = $topCon.querySelector('.pron-gs') + if ($prons) { + $prons.querySelectorAll('.pron-g').forEach($p => { + const $audio = $p.querySelector<HTMLDivElement>('.audio_play_button') + if (!$audio) { return } + const mp3 = $audio.dataset.srcMp3 + if (!mp3) { return } + + if ($audio.className.includes('pron-uk')) { + audio.uk = mp3 + } else { + audio.us = mp3 + } + + result.prons.push({ phsym: getInnerHTML($p), pron: mp3 }) + }) + } + + $topCon.remove() + result.defs = getInnerHTML($entry) + + if (result.title && result.defs) { + return { result, audio } + } + return null +} diff --git a/src/components/dictionaries/oald/favicon.png b/src/components/dictionaries/oald/favicon.png new file mode 100644 index 000000000..7b53c2ecd Binary files /dev/null and b/src/components/dictionaries/oald/favicon.png differ diff --git a/test/specs/components/dictionaries/oald/engine.spec.ts b/test/specs/components/dictionaries/oald/engine.spec.ts new file mode 100644 index 000000000..ebe61d42a --- /dev/null +++ b/test/specs/components/dictionaries/oald/engine.spec.ts @@ -0,0 +1,55 @@ +import search, { OALDResultLex, OALDResultRelated } from '@/components/dictionaries/oald/engine' +import { appConfigFactory, AppConfigMutable } from '@/app-config' +import fs from 'fs' +import path from 'path' + +describe('Dict/OALD/engine', () => { + beforeAll(() => { + const response = { + love: fs.readFileSync(path.join(__dirname, 'response/love.html'), 'utf8'), + love_2: fs.readFileSync(path.join(__dirname, 'response/love_2.html'), 'utf8'), + jumblish: fs.readFileSync(path.join(__dirname, 'response/jumblish.html'), 'utf8'), + } + + window.fetch = jest.fn((url: string) => { + const key = Object.keys(response).find(keyword => url.endsWith(keyword)) + if (key) { + return Promise.resolve({ + text: () => response[key] + }) + } + return Promise.reject(new Error(`Missing Response file for ${url}`)) + }) + }) + + it('should parse lex result correctly', () => { + return search('love', appConfigFactory()) + .then(searchResult => { + expect(searchResult.audio && typeof searchResult.audio.uk).toBe('string') + expect(searchResult.audio && typeof searchResult.audio.us).toBe('string') + + const result = searchResult.result as OALDResultLex + expect(result.type).toBe('lex') + expect(result.items).toHaveLength(2) + + result.items.forEach(item => { + expect(typeof item.title).toBe('string') + expect(item.title).toBeTruthy() + expect(typeof item.defs).toBe('string') + expect(item.defs).toBeTruthy() + expect(item.prons).toHaveLength(2) + }) + }) + }) + + it('should parse related result correctly', () => { + return search('jumblish', appConfigFactory()) + .then(searchResult => { + expect(searchResult.audio).toBeUndefined() + + const result = searchResult.result as OALDResultRelated + expect(result.type).toBe('related') + expect(typeof result.list).toBe('string') + }) + }) +}) diff --git a/test/specs/components/dictionaries/oald/response/jumblish.html b/test/specs/components/dictionaries/oald/response/jumblish.html new file mode 100644 index 000000000..a1f6640e1 --- /dev/null +++ b/test/specs/components/dictionaries/oald/response/jumblish.html @@ -0,0 +1,558 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>jumblish - Did you spell it correctly? Alternative spellings from Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com </title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta name="description" content="jumblish - Alternative spellings from Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com" /> + <meta name="keywords" content="jumblish, alternative spellings of jumblish, Oxford Advanced Learner&apos;s Dictionary " /> + + +<link rel="canonical" href="https://www.oxfordlearnersdictionaries.com/customPageNotFound" /> + <meta name="robots" content="noindex,follow" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <meta name='viewport' content='width=device-width, initial-scale=1'> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/interface.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/responsive.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/oxford.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/jquery.lightbox-0.5.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/print.css?version=1.6.27" rel="stylesheet" type="text/css" media="print" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/autocomplete.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <script type='text/javascript'> + var googletag = googletag || {}; + googletag.cmd = googletag.cmd || []; + var dfpSlots = {}; + (function() { + var gads = document.createElement('script'); + gads.async = true; + gads.type = 'text/javascript'; + var useSSL = 'https:' == document.location.protocol; + gads.src = (useSSL ? 'https:' : 'http:') +'//www.googletagservices.com/tag/js/gpt.js'; + var node = document.getElementsByTagName('script')[0]; + node.parentNode.insertBefore(gads, node); + })(); + googletag.cmd.push(function() { + var mapping_topslot_a = googletag.sizeMapping() + + .addSize([1203, 0], []) // hd (CSS min-width: 1220) + .addSize([745, 0], [728, 90]) // tablet (CSS min-width: 762) + .addSize([0, 0], [320, 50]) // mobile + .build(); + dfpSlots["topslot_a"] = googletag.defineSlot('/70903302/topslot', [728, 90], 'ad_topslot_a') + .defineSizeMapping(mapping_topslot_a) + .setTargeting('vp', 'top') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_topslot_b = googletag.sizeMapping() + + .addSize([1203, 0], [728, 90]) // hd (CSS min-width: 1220) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["topslot_b"] = googletag.defineSlot('/70903302/topslot', [], 'ad_topslot_b') + .defineSizeMapping(mapping_topslot_b) + .setTargeting('vp', 'top') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_btmslot_a = googletag.sizeMapping() + + .addSize([745, 0], [300, 250]) // tablet (CSS min-width: 762) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["btmslot_a"] = googletag.defineSlot('/70903302/btmslot', [300, 250], 'ad_btmslot_a') + .defineSizeMapping(mapping_btmslot_a) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_btmslot_b = googletag.sizeMapping() + + .addSize([745, 0], []) // tablet (CSS min-width: 762) + .addSize([0, 0], [300, 250]) // mobile + .build(); + dfpSlots["btmslot_b"] = googletag.defineSlot('/70903302/btmslot', [], 'ad_btmslot_b') + .defineSizeMapping(mapping_btmslot_b) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_houseslot1_a = googletag.sizeMapping() + + .addSize([0, 0], [180, 150]) // mobile + .build(); + dfpSlots["houseslot1_a"] = googletag.defineSlot('/70903302/houseslot1', [180, 150], 'ad_houseslot1_a') + .defineSizeMapping(mapping_houseslot1_a) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'right') + .addService(googletag.pubads()); + var mapping_leftslot_a = googletag.sizeMapping() + + .addSize([745, 0], [160, 600]) // tablet (CSS min-width: 762) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["leftslot_a"] = googletag.defineSlot('/70903302/leftslot', [160, 600], 'ad_leftslot_a') + .defineSizeMapping(mapping_leftslot_a) + .setTargeting('vp', 'top') + .setTargeting('hp', 'left') + .addService(googletag.pubads()); + googletag.pubads().setTargeting("old_l", "en"); + googletag.pubads().setTargeting("old_pr", "free"); + googletag.pubads().setTargeting("old_pc", "error"); + + googletag.pubads().setCategoryExclusion('wprod'); googletag.pubads().setCategoryExclusion('error'); + googletag.pubads().enableSingleRequest(); + googletag.pubads().collapseEmptyDivs(true); + googletag.enableServices(); + }); + function getDeviceByResolution() { + var res = null; + if (window.matchMedia("(max-width: 761px)").matches) + res = "mobile"; + else if (window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches) + res = "tablet"; + else if (window.matchMedia("(min-width: 1220px)").matches) + res = "hd"; + else + res = "desktop"; + return res; + } + var curResolution = getDeviceByResolution(); + window.onresize = function() { + var newResolution = getDeviceByResolution(); + if (newResolution != curResolution) { + curResolution = newResolution; + googletag.pubads().refresh(); + } + }; + </script> + <!--[if gte IE 7 ]> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/oxford-ie.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <![endif]--> + <!--[if IE 9]><script type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/matchMedia.js?version=1.6.27"></script><![endif]--> + <link href="https://fonts.googleapis.com/css?family=Open+Sans:700i" rel="stylesheet" type='text/css'> + <link rel="icon" type="image/x-icon" href="https://www.oxfordlearnersdictionaries.com/external/images/favicon.ico?version=1.6.27"/> + <script type='text/javascript'> + var arrayFn = []; + var dictCodesArr = new Array(); + /*english + * OALD9 + * free + * false || true*/ + dictCodesArr["english"] = { + url : 'english', + name : 'English', + description : 'Search OALD', + free: true + }; + /*american_english + * OAAD,OALD9 + * free + * false || true*/ + dictCodesArr["american_english"] = { + url : 'american_english', + name : 'American English', + description : 'Search OAAD', + free: true + }; + /*academic + * OLDAE + * free + * false || false*/ + dictCodesArr["academic"] = { + url : 'academic', + name : 'Academic English', + description : 'Search OLDAE', + free: false + }; + /*collocations + * OCOLL + * free + * false || false*/ + dictCodesArr["collocations"] = { + url : 'collocations', + name : 'Collocations', + description : 'Search Oxford Collocations Dictionary', + free: false + }; + /*practical-english-usage + * PEU + * free + * false || false*/ + dictCodesArr["practical-english-usage"] = { + url : 'practical-english-usage', + name : 'Practical English Usage', + description : 'Search PEU Index', + free: false + }; + /*schulwoerterbuch_German-English + * SWB + * free + * false || false*/ + dictCodesArr["schulwoerterbuch_German-English"] = { + url : 'schulwoerterbuch_German-English', + name : 'German-English', + description : 'Search Das Oxford Schulw\u00F6rterbuch', + free: false + }; + /*schulwoerterbuch_English-German + * SWB + * free + * false || false*/ + dictCodesArr["schulwoerterbuch_English-German"] = { + url : 'schulwoerterbuch_English-German', + name : 'English-German', + description : 'Search Das Oxford Schulw\u00F6rterbuch', + free: false + }; + </script> + +</head> +<body > + <noscript> + <div id="cookieLaw">We use cookies to enhance your experience on our website, including to provide targeted advertising and track usage. By continuing to use our website, you are agreeing to our use of cookies. You can change your cookie settings at any time. <a href='https://global.oup.com/cookiepolicy/?siteid=oaadonline' target='_blank'>Find out more</a></div> + </noscript> + <div id="ox-container"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<div id="ox-header" class=""> + <div class="responsive_row flush-below top"> + <div class="responsive_container responsive_display_on_smartphone"> + <div class="menu_button"></div> + </div> + <div class="nav responsive_container main_nav"> + <ul class="menu"> + <li><a href="https://www.oxfordlearnersdictionaries.com/">Dictionaries</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/grammar/">Grammar & usage</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/">About</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/faq/">FAQs</a></li> + </ul> + <div class="menu logout"> + <ul> + <li><a href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">Redeem a code</a></li> + <li><a class="top-toolbar-off" href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">My account</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">Log in</a></li> + </ul> + </div> + </div> +<a class='go-to-top responsive_display_on_smartphone' href='#wrap' title='back to top'>Back to Top</a> +</div> +<div class="responsive_container "> + <div class="old-logo-title responsive_hide_on_smartphone"><a class="old-logo-title" href="https://www.oxfordlearnersdictionaries.com/"></a></div> + <div class="responsive_display_on_smartphone"><a class="old-logo-title" href="https://www.oxfordlearnersdictionaries.com/"></a></div> + <div class="mainsearch responsive_row"> + <form id="search-form" method="get" action="https://www.oxfordlearnersdictionaries.com/search/english/direct/"> + <div class="dictionarySelector"> <span id="select_div"> + <div>English</div> + </span> + <select id="dictionary-selector"> <option value="english">English</option> + <option value="american_english">American English</option> + <option value="academic">Academic English</option> + <option value="collocations">Collocations</option> + <option value="practical-english-usage">Practical English Usage</option> + <option value="schulwoerterbuch_German-English">German-English</option> + <option value="schulwoerterbuch_English-German">English-German</option> + </select> + <div class="csm"> + <a data-value="english" >English</a> + <a data-value="american_english" >American English</a> + <a data-value="academic" ) locked="true" >Academic English</a> + <a data-value="collocations" ) locked="true" >Collocations</a> + <a data-value="practical-english-usage" ) locked="true" >Practical English Usage</a> + <a data-value="schulwoerterbuch_German-English" ) locked="true" >German-English</a> + <a data-value="schulwoerterbuch_English-German" ) locked="true" >English-German</a> + <div class="notch1"></div> + <div class="notch2"></div> + </div> +</div> + <div class="searchfield"> + <input type="text" id="q" name="q" + class="searchfield_input"/> + <a id="keyboard_icon" class="oup_icons responsive_hide_on_smartphone responsive_hide_on_tablet"></a> + <div id="keyboard_letters"></div> + </div> + <div class="inputSuggestions" style=""></div> + <div id="search-btn" class="oup_icons"> + <input type="submit" value="" /> + </div> + </form> + </div> <div class="responsive_hide_on_hd responsive_center_on_smartphone" id="leaderboardOthers"> + <div id='ad_topslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_topslot_a'); }); + </script> + </div> + </div> + <div class="responsive_row"> + <div class="responsive_entry_left"> + <div id='ad_leftslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_leftslot_a'); }); + </script> + </div> + </div> + + <div class="responsive_entry_center"> + <div class="responsive_display_on_hd" id="leaderboardHD"> + <div id='ad_topslot_b' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_topslot_b'); }); + </script> + </div> + </div> + <div class="responsive_entry_center_wrap"> + + + <div id="ox-wrapper" class="responsive_entry_center_left"> + <div id="main_column" class="responsive_row"> + <div id="main-container" class="main-container"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<div class="results"> + <h1 style="font-size:24px; font-weight:bold; margin-bottom: 12px;">jumblish</h1> + <p>Word not found in the dictionary</p> +</div> + + <div id="didyoumean">Did you mean:</div> + <ul class="result-list"> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=jumbles" class="dym-link">jumbles</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=jumbling" class="dym-link">jumbling</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=publish" class="dym-link">publish</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=bullish" class="dym-link">bullish</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=bumbles" class="dym-link">bumbles</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=bumbling" class="dym-link">bumbling</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=demolish" class="dym-link">demolish</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=fumbles" class="dym-link">fumbles</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=fumbling" class="dym-link">fumbling</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/search/english/?q=humbles" class="dym-link">humbles</a></li> + </ul><br/> + + <div class="browse-words"> + <p>You can also browse words beginning with <span style="font-weight:bold; ">j</span></p> + <ul> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/browse/english/j/john-adams/" title="John Adams...John Quincy Adams"><DATA class="hwd">John Adams</DATA>...<DATA class="hwd">John Quincy Adams</DATA></a> + </li> + </ul><br/> + </div> + +<div class="link-to-homepage"> + <p>Find more information about this website at: <a href="https://www.oxfordlearnersdictionaries.com/" title="Dictionary homepage">www.oxfordlearnersdictionaries.com</a>.</p> +</div> + + </div> + + <div class="responsive_hide_on_smartphone responsive_center" id="btmOthers"> + <div id='ad_btmslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_btmslot_a'); }); + </script> + </div> + </div> + </div> + </div> + <div id="rightcolumn" class="responsive_entry_center_right"> + + + + + + <div class='responsive_center_on_smartphone'> + <div id='ad_houseslot1_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_houseslot1_a'); }); + </script> + </div> + </div> + + + + + +<div class="responsive_display_on_smartphone responsive_center_on_smartphone" id="btmSmartphone"> + <div id='ad_btmslot_b' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_btmslot_b'); }); + </script> + </div> + </div> </div> + </div> + + </div> + + </div> + </div> + <div id="ox-footer" class="responsive_row oup-footer"> +<div class="responsive_container"> + + <div class="responsive_footer_top"> + <div class="responsive_center_on_smartphone"> + <div class="btn icon-left social-facebook"><a href="https://www.facebook.com/oupeltglobal">Find us on Facebook</a></div> + <div class="btn icon-left social-twitter"><a href="https://twitter.com/OUPELTGlobal">Follow us on Twitter</a></div> + <ul class='links'> + <li><a href="https://elt.oup.com/" onclick="return ! window.open(this.href);">OUP English Language Teaching</a></li> + <li><a href="https://www.oxfordlearnersbookshelf.com/home/homePage.html" onclick="return ! window.open(this.href);">Oxford Learner&apos;s Bookshelf</a></li> + </ul> + </div> + </div> + <div class="responsive_footer_bottom"> + <div class="responsive_center_on_smartphone"> + <a href="https://global.oup.com/" onclick="return ! window.open(this.href);" class="oup-logo" title="Oxford University Press"><img src="https://www.oxfordlearnersdictionaries.com/external/images/footer/logo-oup.png" title="Oxford University Press"/></a> + <div class="responsive_footer_bottom_wrap"> + <ul class='links'> + <li><a href="https://www.oxfordlearnersdictionaries.com/search_widget_info">Search Box</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/browse/">Browse Dictionaries & Grammar</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/contact-us">Contact Us</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/legal-notice">Legal Notice</a></li> + <li><a href="https://global.oup.com/privacy" onclick="return ! window.open(this.href);">Privacy Policy</a></li> + <li><a href="https://global.oup.com/cookiepolicy" onclick="return ! window.open(this.href);">Cookie Policy</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/terms-and-conditions">Terms & Conditions</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/system-requirements">System Requirements</a></li> + <li><a href="https://elt.oup.com/accessibility" onclick="return ! window.open(this.href);">Accessibility</a></li> + </ul> + <p class="copyright">&copy; 2018 Oxford University Press</p> + </div> + <div class="versionSelector"> + <select name="lang" id="headerVersion" title="Select language"> + <option + selected="selected" name="uk" + value="https://www.oxfordlearnersdictionaries.com/definition/english/jumblish">English (UK)</option> + <option + name="us" + value="https://www.oxfordlearnersdictionaries.com/us/definition/english/jumblish">English (US)</option> + </select> + </div> + </div> + </div> + +</div> +</div> + + + + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/common.js?version=1.6.27"></script> + <script language="javascript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/doubleclick.js?version=1.6.27"></script> + + <script language="javascript" type="text/javascript"> + + $(document).ready(function() { setupDoubleClick('https://www.oxfordlearnersdictionaries.com/', 'english', false, 'main-container', null, null, null); }); + $('img.over').each(function(){ + var t=$(this); + var src1= t.attr('src'); // initial src + var newSrc = src1.substring(0, src1.lastIndexOf('.')); // let's get file name without extension + t.hover(function(){ + $(this).attr('src', newSrc+ '-over.' + /[^.]+$/.exec(src1)); //last part is for extension + }, function(){ + $(this).attr('src', newSrc + '.' + /[^.]+$/.exec(src1)); //removing '-over' from the name + }); + }); + </script> + <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> + + <script language="javascript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/responsive.js?version=1.6.27"></script> + <script type='text/javascript'> + $(document).ready(function() { + for(var i = 0; i<arrayFn.length;i++){ + arrayFn[i].call(); + } + }); + </script> + <script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-13175707-1', + { + 'siteSpeedSampleRate': 10 + }); + ga('send', 'pageview'); +</script> + + <script type="text/javascript">_qoptions={ qacct:"p-cfSla1Cke_iBQ" };</script> + <script type="text/javascript" src="https://secure.quantserve.com/quant.js"></script> + <noscript><img src="https://pixel.quantserve.com/pixel/p-cfSla1Cke_iBQ.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></noscript> + +</body> +</html> diff --git a/test/specs/components/dictionaries/oald/response/love.html b/test/specs/components/dictionaries/oald/response/love.html new file mode 100644 index 000000000..17748e7d3 --- /dev/null +++ b/test/specs/components/dictionaries/oald/response/love.html @@ -0,0 +1,861 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>love_1 noun - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta name="description" content="Definition of love_1 noun in Oxford Advanced Learner&apos;s Dictionary. Meaning, pronunciation, picture, example sentences, grammar, usage notes, synonyms and more." /> + <meta name="keywords" content="love_1 noun, online dictionary, Oxford Advanced Learner&apos;s Dictionary, love_1 definition, define love_1, definition of love_1, love_1 pronunciation, pronounce love_1, love_1 meaning, love_1 examples, love_1 synonyms, picture, love_1 grammar" /> + + +<link rel="canonical" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" /> + <link rel="alternate" hreflang="en" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" /> + <link rel="alternate" hreflang="en-US" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_1" /> + <link rel="alternate" hreflang="en-MX" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_1" /> + <link rel="alternate" hreflang="en-PH" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_1" /> + <link rel="alternate" hreflang="en-BR" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_1" /> + <link rel="alternate" hreflang="en-CO" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_1" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <meta name='viewport' content='width=device-width, initial-scale=1'> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/interface.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/responsive.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/oxford.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/jquery.lightbox-0.5.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/print.css?version=1.6.27" rel="stylesheet" type="text/css" media="print" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/autocomplete.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <script type='text/javascript'> + var googletag = googletag || {}; + googletag.cmd = googletag.cmd || []; + var dfpSlots = {}; + (function() { + var gads = document.createElement('script'); + gads.async = true; + gads.type = 'text/javascript'; + var useSSL = 'https:' == document.location.protocol; + gads.src = (useSSL ? 'https:' : 'http:') +'//www.googletagservices.com/tag/js/gpt.js'; + var node = document.getElementsByTagName('script')[0]; + node.parentNode.insertBefore(gads, node); + })(); + googletag.cmd.push(function() { + var mapping_topslot_a = googletag.sizeMapping() + + .addSize([1203, 0], []) // hd (CSS min-width: 1220) + .addSize([745, 0], [728, 90]) // tablet (CSS min-width: 762) + .addSize([0, 0], [320, 50]) // mobile + .build(); + dfpSlots["topslot_a"] = googletag.defineSlot('/70903302/topslot', [728, 90], 'ad_topslot_a') + .defineSizeMapping(mapping_topslot_a) + .setTargeting('vp', 'top') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_topslot_b = googletag.sizeMapping() + + .addSize([1203, 0], [728, 90]) // hd (CSS min-width: 1220) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["topslot_b"] = googletag.defineSlot('/70903302/topslot', [], 'ad_topslot_b') + .defineSizeMapping(mapping_topslot_b) + .setTargeting('vp', 'top') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_btmslot_a = googletag.sizeMapping() + + .addSize([745, 0], [300, 250]) // tablet (CSS min-width: 762) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["btmslot_a"] = googletag.defineSlot('/70903302/btmslot', [300, 250], 'ad_btmslot_a') + .defineSizeMapping(mapping_btmslot_a) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_btmslot_b = googletag.sizeMapping() + + .addSize([745, 0], []) // tablet (CSS min-width: 762) + .addSize([0, 0], [300, 250]) // mobile + .build(); + dfpSlots["btmslot_b"] = googletag.defineSlot('/70903302/btmslot', [], 'ad_btmslot_b') + .defineSizeMapping(mapping_btmslot_b) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_houseslot1_a = googletag.sizeMapping() + + .addSize([0, 0], [180, 150]) // mobile + .build(); + dfpSlots["houseslot1_a"] = googletag.defineSlot('/70903302/houseslot1', [180, 150], 'ad_houseslot1_a') + .defineSizeMapping(mapping_houseslot1_a) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'right') + .addService(googletag.pubads()); + var mapping_leftslot_a = googletag.sizeMapping() + + .addSize([745, 0], [160, 600]) // tablet (CSS min-width: 762) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["leftslot_a"] = googletag.defineSlot('/70903302/leftslot', [160, 600], 'ad_leftslot_a') + .defineSizeMapping(mapping_leftslot_a) + .setTargeting('vp', 'top') + .setTargeting('hp', 'left') + .addService(googletag.pubads()); + googletag.pubads().setTargeting("old_l", "en"); + googletag.pubads().setTargeting("old_pr", "free"); + googletag.pubads().setTargeting("old_pc", "dictionary"); + googletag.pubads().setTargeting("old_dc", "english"); + googletag.pubads().setTargeting("old_ei", "love_1"); + + googletag.pubads().setCategoryExclusion('wprod'); googletag.pubads().setCategoryExclusion('lcp'); + googletag.pubads().enableSingleRequest(); + googletag.pubads().collapseEmptyDivs(false); + googletag.enableServices(); + }); + function getDeviceByResolution() { + var res = null; + if (window.matchMedia("(max-width: 761px)").matches) + res = "mobile"; + else if (window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches) + res = "tablet"; + else if (window.matchMedia("(min-width: 1220px)").matches) + res = "hd"; + else + res = "desktop"; + return res; + } + var curResolution = getDeviceByResolution(); + window.onresize = function() { + var newResolution = getDeviceByResolution(); + if (newResolution != curResolution) { + curResolution = newResolution; + googletag.pubads().refresh(); + } + }; + </script> + <!--[if gte IE 7 ]> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/oxford-ie.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <![endif]--> + <!--[if IE 9]><script type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/matchMedia.js?version=1.6.27"></script><![endif]--> + <link href="https://fonts.googleapis.com/css?family=Open+Sans:700i" rel="stylesheet" type='text/css'> + <link rel="icon" type="image/x-icon" href="https://www.oxfordlearnersdictionaries.com/external/images/favicon.ico?version=1.6.27"/> + <script type='text/javascript'> + var arrayFn = []; + var dictCodesArr = new Array(); + /*english + * OALD9 + * free + * false || true*/ + dictCodesArr["english"] = { + url : 'english', + name : 'English', + description : 'Search OALD', + free: true + }; + /*american_english + * OAAD,OALD9 + * free + * false || true*/ + dictCodesArr["american_english"] = { + url : 'american_english', + name : 'American English', + description : 'Search OAAD', + free: true + }; + /*academic + * OLDAE + * free + * false || false*/ + dictCodesArr["academic"] = { + url : 'academic', + name : 'Academic English', + description : 'Search OLDAE', + free: false + }; + /*collocations + * OCOLL + * free + * false || false*/ + dictCodesArr["collocations"] = { + url : 'collocations', + name : 'Collocations', + description : 'Search Oxford Collocations Dictionary', + free: false + }; + /*practical-english-usage + * PEU + * free + * false || false*/ + dictCodesArr["practical-english-usage"] = { + url : 'practical-english-usage', + name : 'Practical English Usage', + description : 'Search PEU Index', + free: false + }; + /*schulwoerterbuch_German-English + * SWB + * free + * false || false*/ + dictCodesArr["schulwoerterbuch_German-English"] = { + url : 'schulwoerterbuch_German-English', + name : 'German-English', + description : 'Search Das Oxford Schulw\u00F6rterbuch', + free: false + }; + /*schulwoerterbuch_English-German + * SWB + * free + * false || false*/ + dictCodesArr["schulwoerterbuch_English-German"] = { + url : 'schulwoerterbuch_English-German', + name : 'English-German', + description : 'Search Das Oxford Schulw\u00F6rterbuch', + free: false + }; + </script> + +</head> +<body > + <noscript> + <div id="cookieLaw">We use cookies to enhance your experience on our website, including to provide targeted advertising and track usage. By continuing to use our website, you are agreeing to our use of cookies. You can change your cookie settings at any time. <a href='https://global.oup.com/cookiepolicy/?siteid=oaadonline' target='_blank'>Find out more</a></div> + </noscript> + <div id="ox-container"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<div id="ox-header" class=""> + <div class="responsive_row flush-below top"> + <div class="responsive_container responsive_display_on_smartphone"> + <div class="menu_button"></div> + </div> + <div class="nav responsive_container main_nav"> + <ul class="menu"> + <li><a href="https://www.oxfordlearnersdictionaries.com/">Dictionaries</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/grammar/">Grammar & usage</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/">About</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/faq/">FAQs</a></li> + </ul> + <div class="menu logout"> + <ul> + <li><a href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">Redeem a code</a></li> + <li><a class="top-toolbar-off" href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">My account</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">Log in</a></li> + </ul> + </div> + </div> +<a class='go-to-top responsive_display_on_smartphone' href='#wrap' title='back to top'>Back to Top</a> +</div> +<div class="responsive_container "> + <div class="old-logo-title responsive_hide_on_smartphone"><a class="old-logo-title" href="https://www.oxfordlearnersdictionaries.com/"></a></div> + <div class="responsive_display_on_smartphone"><a class="old-logo-title" href="https://www.oxfordlearnersdictionaries.com/"></a></div> + <div class="mainsearch responsive_row"> + <form id="search-form" method="get" action="https://www.oxfordlearnersdictionaries.com/search/english/direct/"> + <div class="dictionarySelector"> <span id="select_div"> + <div>English</div> + </span> + <select id="dictionary-selector"> <option value="english">English</option> + <option value="american_english">American English</option> + <option value="academic">Academic English</option> + <option value="collocations">Collocations</option> + <option value="practical-english-usage">Practical English Usage</option> + <option value="schulwoerterbuch_German-English">German-English</option> + <option value="schulwoerterbuch_English-German">English-German</option> + </select> + <div class="csm"> + <a data-value="english" >English</a> + <a data-value="american_english" >American English</a> + <a data-value="academic" ) locked="true" >Academic English</a> + <a data-value="collocations" ) locked="true" >Collocations</a> + <a data-value="practical-english-usage" ) locked="true" >Practical English Usage</a> + <a data-value="schulwoerterbuch_German-English" ) locked="true" >German-English</a> + <a data-value="schulwoerterbuch_English-German" ) locked="true" >English-German</a> + <div class="notch1"></div> + <div class="notch2"></div> + </div> +</div> + <div class="searchfield"> + <input type="text" id="q" name="q" + class="searchfield_input"/> + <a id="keyboard_icon" class="oup_icons responsive_hide_on_smartphone responsive_hide_on_tablet"></a> + <div id="keyboard_letters"></div> + </div> + <div class="inputSuggestions" style=""></div> + <div id="search-btn" class="oup_icons"> + <input type="submit" value="" /> + </div> + </form> + </div> <div class="responsive_hide_on_hd responsive_center_on_smartphone" id="leaderboardOthers"> + <div id='ad_topslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_topslot_a'); }); + </script> + </div> + </div> + <div class="responsive_row"> + <div class="responsive_entry_left"> + <div id='ad_leftslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_leftslot_a'); }); + </script> + </div> + </div> + + <div class="responsive_entry_center"> + <div class="responsive_display_on_hd" id="leaderboardHD"> + <div id='ad_topslot_b' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_topslot_b'); }); + </script> + </div> + </div> + <div class="responsive_entry_center_wrap"> + + <div class="entry-header"> + <div class="responsive_entry_center_left"> + + <p class="definition-title">Definition of <em>love noun</em> from the Oxford Advanced Learner&apos;s Dictionary</p> + </div> + <div class="responsive_entry_center_right responsive_hide_on_smartphone share-this-entry"> <div class="social-wrap"> + <span id="plusone-box"><g:plusone size="normal" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" count="false"></g:plusone></span> + <a href="https://www.facebook.com/sharer.php?u=https://www.oxfordlearnersdictionaries.com/definition/english/love_1&t=love_1 noun - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com" target="_blank" class="facebook-btn" alt="share this entry on Facebook" title="share this entry on Facebook" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'facebook', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="https://twitter.com/home?status=Add+This:+https://www.oxfordlearnersdictionaries.com/definition/english/love_1" target="_blank" class="twitter-btn" alt="tweet this entry" title="tweet this entry" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'twitter', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="https://www.stumbleupon.com/submit?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_1" target="_blank" class="stumbleupon-btn" alt="share this entry on StumbleUpon" title="share this entry on StumbleUpon" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'stumbleupon', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="https://www.diigo.com/post?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_1" target="_blank" class="diigo-btn" alt="share this entry on Diigo" title="share this entry on Diigo" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'diigo', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="mailto:?subject=love_1 noun - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com&body=https://www.oxfordlearnersdictionaries.com/definition/english/love_1" alt="email this entry" title="email this entry" class="email-btn"></a> + </div> +</div> + </div> + + <div id="ox-wrapper" class="responsive_entry_center_left"> + <div id="main_column" class="responsive_row"> + <div id="main-container" class="main-container"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<script language="javascript" type="text/javascript"> + var contextId= (location.hash != "" ? location.hash : null); + // global variable that contains the path to external files + // and used by the lightbox script + var lightboxImageLoading = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-ico-loading.gif?version=1.6.27"; + var lightboxImageBtnPrev = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-btn-prev.gif?version=1.6.27"; + var lightboxImageBtnNext = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-btn-next.gif?version=1.6.27"; + var lightboxImageBtnClose = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-btn-close.gif?version=1.6.27"; + var lightboxImageBlank = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-blank.gif?version=1.6.27"; + if (document.readyState != 'loading'){ + initEntry('See more', 'See less'); + } else if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', function(){initEntry('See more', 'See less');}); + } else { + document.attachEvent('onreadystatechange', function() { + if (document.readyState != 'loading') + initEntry('See more', 'See less'); + }); + } +</script> + <div id="entryContent" class="oald"><div class="entry" sum="2618" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3352" id="love_1"><ol class="h-g" id="love_1__1" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3341"><div class="top-container"><div class="top-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3350" id="love_1__2"> + <div class="webtop-g"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a><span class="z"> </span><h2 class="h">love</h2><span class="z"> </span><span class="pos">noun</span></div><span class="pos-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-333f" id="love_1__4"><span class="pos" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-333e" id="love_1__5">noun</span></span> <div class="pron-gs ei-g" eid="love_1__6"><span class="pron-g" id="love_1__7" geo="br" trans="ald8"><span class="prefix"><span class="blue">BrE</span></span> <span class="phon" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2321" eid="love_1__8"><span class="bre">BrE</span><span class="separator">/</span><span class="wrap">/</span>lʌv<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-uk icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron/l/lov/love_/love__gb_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron_ogg/l/lov/love_/love__gb_1.ogg" title=" pronunciation English" style="cursor: pointer" valign="top"> </div></span><span class="sep">;</span> <span class="pron-g" geo="n_am" id="love_1__9" trans="ald8"><span class="prefix"><span class="red">NAmE</span></span> <span class="phon" eid="love_1__10" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-231e"><span class="name">NAmE</span><span class="separator">/</span><span class="wrap">/</span>lʌv<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-us icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/us_pron/l/lov/love_/love__us_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/us_pron_ogg/l/lov/love_/love__us_1.ogg" title=" pronunciation American" style="cursor: pointer" valign="top"> </div></span></div><span class="res-g" hide="y" psg="top_topics"> <span class="xr-gs" xref_type="internal"><a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/tennis/love_1" title="Topic Tennis"><span class="xr-g" resource="topicdict"><span class="xh">Tennis</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/romance/love_2" title="Topic Romance"><span class="xr-g" resource="topicdict"><span class="xh">Romance</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/love/love_3" title="Topic Love"><span class="xr-g" resource="topicdict"><span class="xh">Love</span></span></a></span></span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__16" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3336"> <span class="shcut" id="love_1__17" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3335">affection</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3334" ox3000="y" id="love_1__18"><span class="num">1 </span><span class="sym_first"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a></span><span class="gram-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3331" id="love_1__19"><span class="wrap">[</span><span class="gram" id="love_1__20" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3330" gram="u">uncountable</span><span class="wrap">]</span></span> <span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-332f" id="love_1__21">a strong feeling of deep affection for somebody/something, especially a member of your family or a friend</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-332e" id="love_1__22"><span class="x-g" id="love_1__23" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-332d"> <span class="x" id="love_1__24" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-332c">a mother’s love for her children</span></span><span class="x-g" id="love_1__25" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-332b"> <span class="x" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-332a" id="love_1__26">love of your country</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3329" id="love_1__27"> <span class="rx-g" resource="recx" id="love_1__28" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3328"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.58ed" id="love_1__29">He seems incapable of love.</span></span></span></span><span class="snippet"><span class="collapse" title="Oxford Collocations Dictionary"><span class="unbox" unbox="colloc_snip"> <span class="heading">Oxford Collocations Dictionary</span><span class="body"><span class="shcut-g"> <span class="shcut">adjective</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">all-consuming</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">burning</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deep</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">verb + love</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">feel</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">have</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">experience</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + verb</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">bloom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">blossom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">grow</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + noun</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">affair</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">triangle</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">life</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">preposition</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">for <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">out of <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">in <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">phrases</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">an act of love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deeply in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">madly in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="xr-gs" xref_type="external"> <span class="prefix">See</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/collocations/love_1" title="full entry definition in Collocations +&#10; "><span class="xr-g" resource="collocations" dpsref="uc0ec231edbf4e81b.423ca8c8.15b1ad2ed6a.-6738"><span class="xh">full entry</span></span></a></span></span></span></span></span> <span class="xr-gs" xref_type="internal"><span class="prefix">See related entries:</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/romance/love_2" title="Topic Romance"><span class="xr-g" resource="topicdict"><span class="xh">Romance</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/love/love_3" title="Topic Love"><span class="xr-g" resource="topicdict"><span class="xh">Love</span></span></a></span></li></span><span class="sn-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3327" id="love_1__34"> <span class="shcut" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3326" id="love_1__35">romantic</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3325" id="love_1__36" ox3000="y"><span class="num">2 </span><span class="sym_first"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a></span><span class="gram-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3323" id="love_1__37"><span class="wrap">[</span><span class="gram" id="love_1__38" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3322" gram="u">uncountable</span><span class="wrap">]</span></span> <span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3321" id="love_1__39">a strong feeling of affection for somebody that you are sexually attracted to</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3320" id="love_1__40"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-331f" id="love_1__41"> <span class="x" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-331e" id="love_1__42">a <span class="cl"><strong>love song/story</strong></span></span></span><span class="x-g" id="love_1__44" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-331c"> <span class="rx-g" id="love_1__45" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-331b"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.58f0" id="love_1__46">We're <span class="cl"><strong>in love</strong></span>!</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-331a" id="love_1__50"> <span class="rx-g" id="love_1__51" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3319"><span class="x" id="love_1__52" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.58f4">She was <span class="cl"><strong>in love with him</strong></span>.</span></span></span><span class="x-g" id="love_1__56" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3318"> <span class="rx-g" resource="recx" id="love_1__57" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3317"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.58f8" id="love_1__58">They <span class="cl"><strong>fell in love</strong></span> with each other.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3316" id="love_1__62"> <span class="rx-g" resource="recx" id="love_1__63" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3315"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.58fc" id="love_1__64">It was <span class="cl"><strong>love at first sight</strong></span> <span class="gl" id="love_1__66" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.58fe"><span class="wrap">(</span><span class="prefix">=</span> they were attracted to each other the first time they met<span class="wrap">)</span></span>.</span></span></span><span class="x-g" id="love_1__69" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3314"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3313" id="love_1__70" resource="recx"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5901" id="love_1__71">They're <span class="cl"><strong>madly in love</strong></span>.</span></span></span><span class="x-g" id="love_1__75" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3312"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3311" id="love_1__76" resource="recx"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5905" id="love_1__77">Their love grew with the years.</span></span></span></span><span class="collapse" title="Wordfinder"><span class="unbox" dpsid="u4cdebea65f7df6b4.1491c942.1444cef3a6c.-6c97" id="love_1__80" unbox="wordfinder"> <span class="heading">Wordfinder</span><span class="body" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd9" id="love_1__81"><span class="h1" id="love_1__82" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd8">love</span><span class="p" id="love_1__83" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd7"><span class="xr-gs" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd6" id="love_1__84" xref_type="internal"><a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/affair" title="affair definition"><span class="xr-g" id="love_1__85" dpsref="u4cdebea65f7df6b4.743b4102.13cbab9c8f4.69fc" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd5" dpsresource="ALD9"><span class="xh" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd4" id="love_1__86">affair</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/date_1" title="date definition"><span class="xr-g" dpsresource="ALD9" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd2" id="love_1__87" dpsref="u4cdebea65f7df6b4.743b4102.13cbabc708f.-34e4"><span class="xh" id="love_1__88" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fd1">date</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/go-out-with" title="go out with somebody definition"><span class="xr-g" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fce" dpsref="u4cdebea65f7df6b4.743b4102.13cbabe3564.a4e" id="love_1__89" dpsresource="ALD9"><span class="xw" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fcd" id="love_1__90">go out with somebody</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/jealous" title="jealous definition"><span class="xr-g" dpsresource="ALD9" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fcb" id="love_1__91" dpsref="u4cdebea65f7df6b4.743b4102.13cbabf992f.-755d"><span class="xh" id="love_1__92" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fca">jealous</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" title="love definition"><span class="xr-g" dpsresource="ALD9" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fc8" id="love_1__93" dpsref="u4cdebea65f7df6b4.743b4102.13cbac01393.-3325"><span class="xh" id="love_1__94" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fc7">love</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/marriage" title="marriage definition"><span class="xr-g" dpsresource="ALD9" id="love_1__95" dpsref="u4cdebea65f7df6b4.743b4102.13cbac01393.311e" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fc4"><span class="xh" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fc3" id="love_1__96">marriage</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/partner_1" title="partner definition"><span class="xr-g" dpsref="u4cdebea65f7df6b4.743b4102.13cbac21463.-588a" id="love_1__97" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fc2" dpsresource="ALD9"><span class="xh" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fc1" id="love_1__98">partner</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/passionate" title="passionate definition"><span class="xr-g" dpsresource="ALD9" dpsref="u4cdebea65f7df6b4.743b4102.13cbac21463.-5065" id="love_1__99" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fbe"><span class="xh" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fbd" id="love_1__100">passionate</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/relationship" title="relationship definition"><span class="xr-g" id="love_1__101" dpsref="u4cdebea65f7df6b4.743b4102.13cbac3027d.48d2" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fbb" dpsresource="ALD9"><span class="xh" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fba" id="love_1__102">relationship</span></span></a><span class="sep">,</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/romantic_1" title="romantic definition"><span class="xr-g" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fb8" dpsref="u4cdebea65f7df6b4.743b4102.13cbac3647b.-d13" id="love_1__103" dpsresource="ALD9"><span class="xh" id="love_1__104" dpsid="ufd9718d478e0e1e5.1567090e.15d132d18cf.-fb7">romantic</span></span></a></span></span></span></span></span><span class="snippet"><span class="collapse" title="Oxford Collocations Dictionary"><span class="unbox" unbox="colloc_snip"> <span class="heading">Oxford Collocations Dictionary</span><span class="body"><span class="shcut-g"> <span class="shcut">adjective</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">all-consuming</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">burning</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deep</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">verb + love</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">feel</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">have</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">experience</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + verb</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">bloom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">blossom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">grow</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + noun</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">affair</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">triangle</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">life</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">preposition</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">for <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">out of <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">in <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">phrases</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">an act of love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deeply in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">madly in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="xr-gs" xref_type="external"> <span class="prefix">See</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/collocations/love_1" title="full entry definition in Collocations +&#10; "><span class="xr-g" resource="collocations" dpsref="uc0ec231edbf4e81b.423ca8c8.15b1ad2ed6a.-6738"><span class="xh">full entry</span></span></a></span></span></span></span></span> <span class="xr-gs" xref_type="internal"><span class="prefix">See related entries:</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/love/love_3" title="Topic Love"><span class="xr-g" resource="topicdict"><span class="xh">Love</span></span></a></span></li></span><span class="sn-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-330d" id="love_1__106"> <span class="shcut" id="love_1__107" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-330c">enjoyment</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-330b" ox3000="y" id="love_1__108"><span class="num">3 </span><span class="sym_first"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a></span><span class="gram-g" id="love_1__109" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-330a"><span class="wrap">[</span><span class="gram" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3309" gram="u" id="love_1__110">uncountable</span><span class="sep">,</span> <span class="gram" id="love_1__111" gram="sing" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3308">singular</span><span class="wrap">]</span></span> <span class="def" id="love_1__112" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3307">the strong feeling of enjoyment that something gives you</span><span class="x-gs" id="love_1__113" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3306"><span class="x-g" id="love_1__114" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3305"> <span class="x" id="love_1__115" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3304">a <span class="cl"><strong>love of</strong></span> learning</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3302" id="love_1__117"> <span class="rx-g" id="love_1__118" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3301"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5908" id="love_1__119">He's <span class="cl"><strong>in love with</strong></span> his work.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3300" id="love_1__123"> <span class="rx-g" id="love_1__124" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ff"><span class="x" id="love_1__125" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.590c">I <span class="cl"><strong>fell in love with</strong></span> the house.</span></span></span></span><span class="snippet"><span class="collapse" title="Oxford Collocations Dictionary"><span class="unbox" unbox="colloc_snip"> <span class="heading">Oxford Collocations Dictionary</span><span class="body"><span class="shcut-g"> <span class="shcut">adjective</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">all-consuming</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">burning</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deep</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">verb + love</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">feel</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">have</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">experience</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + verb</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">bloom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">blossom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">grow</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + noun</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">affair</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">triangle</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">life</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">preposition</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">for <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">out of <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">in <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">phrases</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">an act of love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deeply in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">madly in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="xr-gs" xref_type="external"> <span class="prefix">See</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/collocations/love_1" title="full entry definition in Collocations +&#10; "><span class="xr-g" dpsref="uc0ec231edbf4e81b.423ca8c8.15b1ad2ed6a.-6738" resource="collocations"><span class="xh">full entry</span></span></a></span></span></span></span></span></li></span><span class="sn-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32fe" id="love_1__129"> <span class="shcut" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32fd" id="love_1__130">somebody/something you like</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32fc" id="love_1__131" ox3000="y"><span class="num">4 </span><span class="sym_first"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a></span><span class="gram-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32fb" id="love_1__132"><span class="wrap">[</span><span class="gram" gram="c" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32fa" id="love_1__133">countable</span><span class="wrap">]</span></span> <span class="def" id="love_1__134" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f9">a person, a thing or an activity that you like very much</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f8" id="love_1__135"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f7" id="love_1__136"> <span class="rx-g" id="love_1__137" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f6"><span class="x" id="love_1__138" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5910">Take care, my love.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f5" id="love_1__141"> <span class="rx-g" id="love_1__142" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f4"><span class="x" id="love_1__143" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5913">He was <span class="cl"><strong>the love of my life</strong></span> <span class="gl" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5915" id="love_1__145"><span class="wrap">(</span><span class="prefix">=</span> the person I loved most<span class="wrap">)</span></span>.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f3" id="love_1__148"> <span class="rx-g" id="love_1__149" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f2"><span class="x" id="love_1__150" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5918">I like most sports but tennis is my <span class="cl"><strong>first love</strong></span>.</span></span></span></span><span class="snippet"><span class="collapse" title="Oxford Collocations Dictionary"><span class="unbox" unbox="colloc_snip"> <span class="heading">Oxford Collocations Dictionary</span><span class="body"><span class="shcut-g"> <span class="shcut">adjective</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">all-consuming</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">burning</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deep</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">verb + love</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">feel</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">have</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">experience</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + verb</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">bloom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">blossom</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">grow</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">love + noun</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">affair</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">triangle</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">life</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">preposition</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">for <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">out of <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">in <span class="exp">love</span></span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="shcut-g"> <span class="shcut">phrases</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">an act of love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deeply in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">madly in love</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="xr-gs" xref_type="external"> <span class="prefix">See</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/collocations/love_1" title="full entry definition in Collocations +&#10; "><span class="xr-g" dpsref="uc0ec231edbf4e81b.423ca8c8.15b1ad2ed6a.-6738" resource="collocations"><span class="xh">full entry</span></span></a></span></span></span></span></span></li></span><span class="sn-gs" id="love_1__154" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f1"> <span class="shcut" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32f0" id="love_1__155">friendly name</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ef" id="love_1__156"><span class="num">5</span><span class="gram-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ee" id="love_1__157"><span class="wrap">[</span><span class="gram" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ed" gram="c" id="love_1__158">countable</span><span class="wrap">]</span></span> <span class="label-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ec" id="love_1__159"><span class="wrap">(</span><span class="geo" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32eb" id="love_1__160" geo="br">British English</span><span class="sep">,</span> <span class="reg" id="love_1__161" reg="infml" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ea">informal</span><span class="wrap">)</span></span> <span class="def" id="love_1__162" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e9">a word used as a friendly way of addressing somebody</span><span class="x-gs" id="love_1__163" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e8"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e7" id="love_1__164"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e6" resource="recx" id="love_1__165"><span class="x" id="love_1__166" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.591c">Can I help you, love?</span></span></span></span> <span class="xr-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e5" id="love_1__169" xref_type="internal"><span class="prefix">compare</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/duck_1" title="duck definition"><span class="xr-g" id="love_1__170" dpsref="u4cdebea65f7df6b4.743b4102.13cbabce420.2e4d" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e4" dpsresource="ALD9"><span class="xh" id="love_1__171" dpsid="u4cdebea65f7df6b4.743b4102.13cce79fcd6.61a8">duck</span></span></a></span></li></span><span class="sn-gs" id="love_1__172" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e2"> <span class="shcut" id="love_1__173" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e1">in tennis</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32e0" id="love_1__174"><span class="num">6</span><span class="gram-g" id="love_1__175" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32de"><span class="wrap">[</span><span class="gram" gram="u" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32dd" id="love_1__176">uncountable</span><span class="wrap">]</span></span> <span class="def" id="love_1__177" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32dc">a score of zero (points or games)</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32db" id="love_1__178"><span class="x-g" id="love_1__179" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32da"> <span class="x" id="love_1__180" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d9">40–love!</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d8" id="love_1__181"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a1" psg="RECXbreadcrumbtrail_11348" id="love_1__182"><span class="x" id="love_1__183" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35aa">She won the first set <span class="cl"><strong>six–love/six games to love</strong></span>.</span></span></span></span> <span class="xr-gs" xref_type="internal"><span class="prefix">See related entries:</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/tennis/love_1" title="Topic Tennis"><span class="xr-g" resource="topicdict"><span class="xh">Tennis</span></span></a></span></li></span><span class="res-g"><span class="collapse" title="Word Origin"><span class="unbox" id="love_1__188" unbox="wordorigin"> <span class="heading">Word Origin</span><span class="body" id="love_1__189"><span class="p" id="love_1__190">Old English <span class="ei" id="love_1__191">lufu</span>, of Germanic origin; from an Indo-European root shared by Sanskrit <span class="ei" psg="{tag=ff}" id="love_1__192">lubhyati</span> ‘desires’, Latin <span class="ei" id="love_1__193" psg="{tag=ff}">libet</span> ‘it is pleasing’, <span class="ei" psg="{tag=ff}" id="love_1__194">libido</span> ‘desire’, also by the noun <span class="eb" id="love_1__195" psg="{tag=xh}">leave</span> and <span class="eb" id="love_1__196" psg="{tag=xh}">lief</span>.</span></span></span></span><span class="collapse" title="Extra examples"><span class="unbox" unbox="Extra examples"><span class="heading">Extra examples</span><span class="body"><span class="x-gs" id="love_1__197" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3233"><span class="x-g" id="love_1__198" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3234"> <span class="x" id="love_1__199" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3235">At last she had found true love.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3236" id="love_1__200"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3237" id="love_1__201">Can true love prevail?</span></span><span class="x-g" id="love_1__202" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3238"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3239" id="love_1__203">Do you believe in love at first sight?</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.323a" id="love_1__204"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.323b" id="love_1__205">Does she doubt my love for her?</span></span><span class="x-g" id="love_1__206" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.323c"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.323d" id="love_1__207">From John, she received the love she had never received from her father.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.323e" id="love_1__208"> <span class="x" id="love_1__209" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.323f">He developed a lifelong love of music.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3240" id="love_1__210"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3241" id="love_1__211">He did not know how to express his love for her.</span></span><span class="x-g" id="love_1__212" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3242"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3243" id="love_1__213">He didn’t return her love.</span></span><span class="x-g" id="love_1__214" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3244"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3245" id="love_1__215">He fell in love with one of his students.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3246" id="love_1__216"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3247" id="love_1__217">He had a great love of life.</span></span><span class="x-g" id="love_1__218" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3248"> <span class="x" id="love_1__219" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3249">He had an abiding love of the English countryside.</span></span><span class="x-g" id="love_1__220" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.324a"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.324b" id="love_1__221">He had never known true love until now.</span></span><span class="x-g" id="love_1__222" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.324c"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.324d" id="love_1__223">He wanted to make love to her.</span></span><span class="x-g" id="love_1__224" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.324e"> <span class="x" id="love_1__225" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.324f">He would do almost anything to prove his love for her.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3250" id="love_1__226"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3251" id="love_1__227">His wealth enabled him to indulge his love of fast cars.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3252" id="love_1__228"> <span class="x" id="love_1__229" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3253">I couldn’t hide my love for her any longer.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3254" id="love_1__230"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3255" id="love_1__231">I did it for love!</span></span><span class="x-g" id="love_1__232" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3256"> <span class="x" id="love_1__233" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3257">I don’t deserve his love.</span></span><span class="x-g" id="love_1__234" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3258"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3259" id="love_1__235">I like most sports but tennis is my first love.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.325a" id="love_1__236"> <span class="x" id="love_1__237" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.325b">I was madly in love with her.</span></span><span class="x-g" id="love_1__238" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.325c"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.325d" id="love_1__239">In his music dramas, love conquers all.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.325e" id="love_1__240"> <span class="x" id="love_1__241" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.325f">It gave me the opportunity to pursue my love of music.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3260" id="love_1__242"> <span class="x" id="love_1__243" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3261">Love blossomed between the two of them</span></span><span class="x-g" id="love_1__244" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3262"> <span class="x" id="love_1__245" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3263">She felt no love for him.</span></span><span class="x-g" id="love_1__246" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3264"> <span class="x" id="love_1__247" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3265">She has earned the love and respect of many people.</span></span><span class="x-g" id="love_1__248" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3266"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3267" id="love_1__249">She plays his love interest in the film.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3268" id="love_1__250"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3269" id="love_1__251">She was the love of his life.</span></span><span class="x-g" id="love_1__252" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.326a"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.326b" id="love_1__253">Soul Survivors is a story of lost love.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.326c" id="love_1__254"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.326d" id="love_1__255">The poem is a celebration of married love.</span></span><span class="x-g" id="love_1__256" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.326e"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.326f" id="love_1__257">They fell head over heels in love.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3270" id="love_1__258"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3271" id="love_1__259">They lavish love on Selah, their cat.</span></span><span class="x-g" id="love_1__260" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3272"> <span class="x" id="love_1__261" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3273">They publicly declared their love for each other.</span></span><span class="x-g" id="love_1__262" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3274"> <span class="x" id="love_1__263" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3275">They share a love of music.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3276" id="love_1__264"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3277" id="love_1__265">They were into free love and avoided commitment.</span></span><span class="x-g" id="love_1__266" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3278"> <span class="x" id="love_1__267" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3279">We are very much in love.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.327a" id="love_1__268"> <span class="x" id="love_1__269" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.327b">We want to foster a love of learning in all children.</span></span><span class="x-g" id="love_1__270" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.327c"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.327d" id="love_1__271">You have my undying love.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.327e" id="love_1__272"> <span class="x" id="love_1__273" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.327f">a party with family and friends to celebrate their love</span></span><span class="x-g" id="love_1__274" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3280"> <span class="x" id="love_1__275" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3281">a play about thwarted love</span></span><span class="x-g" id="love_1__276" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3282"> <span class="x" id="love_1__277" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3283">a sad tale of unrequited love</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3284" id="love_1__278"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3285" id="love_1__279">her deep love for him</span></span><span class="x-g" id="love_1__280" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3286"> <span class="x" id="love_1__281" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3287">the cult of courtly love in the 12th century</span></span><span class="x-g" id="love_1__282" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3288"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3289" id="love_1__283">the love between parent and child</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.328a" id="love_1__284"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.328b" id="love_1__285">It was love at first sight.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.328c" id="love_1__286"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.328d" id="love_1__287">People say there is nothing greater than a mother’s love for her children.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.328e" id="love_1__288"> <span class="x" id="love_1__289" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.328f">She was madly/​deeply in love with him.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3290" id="love_1__290"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3291" id="love_1__291">a love song/​story</span></span></span></span></span></span></span><span class="idm-gs" id="love_1__292" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d5"><span class="heading">Idioms</span> <span class="idm-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e0b" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF1" id="love_1__293" sk="allsfairinloveandwar"><div class="top-container"><div class="top-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e0c" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF2" id="love_1__294"><span class="idm" id="love_1__295" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF3" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e0d">all’s fair in love and war</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF4" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e0e" id="love_1__296"><span class="sn-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e0f" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF5" id="love_1__297"><span class="label-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e10" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF6" id="love_1__298"><span class="wrap">(</span><span class="reg" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF7" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e11" reg="saying" id="love_1__299">saying</span><span class="wrap">)</span></span> <span class="def" id="love_1__300" dupedid="u4cdebea65f7df6b4.743b4102.13cbabd5a4a.4e12" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF8">in some situations any type of behaviour is acceptable to get what you want</span></span></span></span> <span class="idm-g" id="love_1__301" sk="cupboardlove" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6699" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF1"><div class="top-container"><div class="top-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF2" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6698" id="love_1__302"><span class="idm" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF3" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6697" id="love_1__303">cupboard love</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6696" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF4" id="love_1__304"><span class="sn-g" id="love_1__305" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF5" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6695"><span class="label-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6694" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF6" id="love_1__306"><span class="wrap">(</span><span class="geo" id="love_1__307" geo="br" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF7" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6693">British English</span><span class="wrap">)</span></span> <span class="def" id="love_1__308" dupedid="u4cdebea65f7df6b4.743b4102.13cbabc708f.-6692" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF8">affection that somebody, especially a child, shows towards somebody else in order to get something</span></span></span></span> <span class="idm-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d4" id="love_1__309" sk="forlove"><div class="top-container"><div class="top-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d3" id="love_1__310"><span class="idm-l" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d2" id="love_1__311"><span class="idm" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d1" id="love_1__312">(just) for love</span><span class="sep">,</span> <span class="idm" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32d0" id="love_1__313">(just) for the love of something</span></span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__314" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32cf"><span class="sn-g" id="love_1__315" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ce"><span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32cd" id="love_1__316">without receiving payment or any other reward</span><span class="x-gs" id="love_1__317" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32cc"><span class="x-g" id="love_1__318" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32cb"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ca" id="love_1__319" resource="recx"><span class="x" id="love_1__320" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.591f">They're all volunteers, working for the love of it.</span></span></span></span></span></span></span> <span class="idm-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c9" sk="forloveofgod" id="love_1__323"><div class="top-container"><div class="top-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c8" id="love_1__324"><span class="idm" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c7" id="love_1__325">for the love of God</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__326" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c6"><span class="sn-g" id="love_1__327" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c5"><span class="label-g" id="love_1__328" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c4"><span class="wrap">(</span><span class="reg" reg="oldfash" id="love_1__329" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c3">old-fashioned</span><span class="sep">,</span> <span class="reg" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c2" id="love_1__330" reg="infml">informal</span><span class="wrap">)</span></span> <span class="def" id="love_1__331" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c1">used when you are expressing anger and the fact that you are impatient</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32c0" id="love_1__332"><span class="x-g" id="love_1__333" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32bf"> <span class="rx-g" resource="recx" id="love_1__334" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32be"><span class="x" id="love_1__335" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5922">For the love of God, tell me what he said!</span></span></span></span></span></span></span> <span class="idm-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32bd" id="love_1__338" sk="giveloveto"><div class="top-container"><div class="top-g" id="love_1__339" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32bc"><span class="idm" id="love_1__340" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32bb">give/send my love to somebody</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__341" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ba"><span class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b9" id="love_1__342"><span class="label-g" id="love_1__343" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b8"><span class="wrap">(</span><span class="reg" reg="infml" id="love_1__344" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b7">informal</span><span class="wrap">)</span></span> <span class="def" id="love_1__345" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b6">used to send good wishes to somebody</span><span class="x-gs" id="love_1__346" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b5"><span class="x-g" id="love_1__347" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b4"> <span class="rx-g" id="love_1__348" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b3"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5925" id="love_1__349">Give my love to Mary when you see her.</span></span></span><span class="x-g" id="love_1__352" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b2"> <span class="rx-g" id="love_1__353" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b1"><span class="x" id="love_1__354" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5928">Bob sends his love.</span></span></span></span></span></span></span> <span class="idm-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF1" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d65" id="love_1__357" sk="headoverheelsinlove"><div class="top-container"><div class="top-g" id="love_1__358" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d64" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF2"><span class="idm" id="love_1__359" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d63" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF3">head over heels in love</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__360" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d62" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF4"><span class="sn-g" id="love_1__361" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF5" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d61"><span class="def" id="love_1__362" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d60" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF6">loving somebody very much</span><span class="x-gs" id="love_1__363" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF7" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d5f"><span class="x-g" id="love_1__364" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF8" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d5e"> <span class="rx-g" id="love_1__365" resource="recx" dupedid="u4cdebea65f7df6b4.743b4102.13cbabeaa27.-2d5d" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF9"><span class="x" dupedid="u4cdebea65f7df6b4.d396464.14cb3ae3417.1915" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF10" id="love_1__366">He's fallen head over heels in love with his boss.</span></span></span></span></span></span></span> <span class="idm-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7c6" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF1" sk="labouroflove" id="love_1__369"><div class="top-container"><div class="top-g" id="love_1__370" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF2" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7c5"><span class="idm" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7c4" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF3" id="love_1__371">a labour of love</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__372" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF4" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7c3"><span class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF5" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7c2" id="love_1__373"><span class="def" id="love_1__374" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF6" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7c1">a hard task that you do because you want to, not because it is necessary</span><span class="x-gs" id="love_1__375" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF7" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7c0"><span class="x-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.-7bf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF8" id="love_1__376"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF9" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.2b75" psg="RECXbreadcrumbtrail_10718" id="love_1__377"><span class="x" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-327f-FF10" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.2b85" id="love_1__378">Writing the book was a labour of love.</span></span></span></span></span></span></span> <span class="idm-g" id="love_1__381" sk="lovefrom" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32b0"><div class="top-container"><div class="top-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32af" id="love_1__382"><span class="idm-l" id="love_1__383" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ae"><span class="idm" id="love_1__384" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ad">love from</span><span class="sep">,</span> <span class="idm" id="love_1__385" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ac">lots of love (from)</span></span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__386" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32ab"><span class="sn-g" id="love_1__387" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32aa"><span class="label-g" id="love_1__388" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a9"><span class="wrap">(</span><span class="reg" id="love_1__389" reg="infml" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a8">informal</span><span class="wrap">)</span></span> <span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a7" id="love_1__390">used at the end of a letter to a friend or to somebody you love, followed by your name</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a6" id="love_1__391"><span class="x-g" id="love_1__392" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a5"> <span class="x" id="love_1__393" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a4">Lots of love, Jenny</span></span></span></span></span></span> <span class="idm-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a3" sk="loveisblind" id="love_1__394"><div class="top-container"><div class="top-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a2" id="love_1__395"><span class="idm" id="love_1__396" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a1">love is blind</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-32a0" id="love_1__397"><span class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-329f" id="love_1__398"><span class="label-g" id="love_1__399" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-329e"><span class="wrap">(</span><span class="reg" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-329d" id="love_1__400" reg="saying">saying</span><span class="wrap">)</span></span> <span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-329c" id="love_1__401">when you love somebody, you cannot see their faults</span></span></span></span> <span class="idm-g" sk="makelove" id="love_1__402" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-329b"><div class="top-container"><div class="top-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-329a" id="love_1__403"><span class="idm" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3299" id="love_1__404">make love (to somebody)</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__405" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3298"><span class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3297" id="love_1__406"><span class="def" id="love_1__407" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3296">to have sex</span><span class="x-gs" id="love_1__408" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3295"><span class="x-g" id="love_1__409" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3294"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3293" resource="recx" id="love_1__410"><span class="x" id="love_1__411" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.592b">It was the first time they had made love.</span></span></span></span></span></span></span> <span class="idm-g" id="love_1__414" sk="notforloveormoney" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3292"><div class="top-container"><div class="top-g" id="love_1__415" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3291"><span class="idm" id="love_1__416" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3290">not for love or/nor money</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__417" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-328f"><span class="sn-g" id="love_1__418" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-328e"><span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-328d" id="love_1__419">if you say you cannot do something <span class="eb" id="love_1__420" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-328c">for love nor money</span>, you mean it is completely impossible to do it</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-328b" id="love_1__421"><span class="x-g" id="love_1__422" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-328a"> <span class="rx-g" resource="recx" id="love_1__423" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3289"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.592e" id="love_1__424">We couldn't find a taxi for love nor money.</span></span></span></span></span></span></span> <span class="idm-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3288" sk="thereslittlelovelostbetweenandb" id="love_1__427"><div class="top-container"><div class="top-g" id="love_1__428" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3287"><span class="idm" id="love_1__429" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3286">there’s little/no love lost between A and B</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_1__430" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3285"><span class="sn-g" id="love_1__431" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3284"><span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3283" id="love_1__432">they do not like each other</span><span class="x-gs" id="love_1__433" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3282"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3281" id="love_1__434"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3280" id="love_1__435" resource="recx"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5931" id="love_1__436">There's no love lost between her and her in-laws.</span></span></span></span></span></span></span></span></ol><span class="dictlinks"><span class="xr-gs" xref_type="external"><span class="prefix">See </span><a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/academic/love1" title="love definition in Academic English +&#10; "><span class="xr-g" resource="oldae"><span class="xh">love</span></span></a><span class="suffix"> in the Oxford Learner's Dictionary of Academic English</span></span><span class="xr-gs" xref_type="external"><span class="prefix">See </span><a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/american_english/love_1" title="love definition in American English +&#10; "><span class="xr-g" resource="oaad"><span class="xh">love</span></span></a><span class="suffix"> in the Oxford Advanced American Dictionary</span></span></span><div class="pron-link">Check pronunciation: <a href="https://www.oxfordlearnersdictionaries.com/pronunciation/english/love_1">love</a></div></div> +</div> +<div class="responsive_row responsive_display_on_smartphone"> + <div class="responsive_entry_center_right"> <div class="social-wrap"> + <span id="plusone-box"><g:plusone size="normal" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" count="false"></g:plusone></span> + <a href="https://www.facebook.com/sharer.php?u=https://www.oxfordlearnersdictionaries.com/definition/english/love_1&t=love_1 noun - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com" target="_blank" class="facebook-btn" alt="share this entry on Facebook" title="share this entry on Facebook" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'facebook', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="https://twitter.com/home?status=Add+This:+https://www.oxfordlearnersdictionaries.com/definition/english/love_1" target="_blank" class="twitter-btn" alt="tweet this entry" title="tweet this entry" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'twitter', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="https://www.stumbleupon.com/submit?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_1" target="_blank" class="stumbleupon-btn" alt="share this entry on StumbleUpon" title="share this entry on StumbleUpon" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'stumbleupon', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="https://www.diigo.com/post?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_1" target="_blank" class="diigo-btn" alt="share this entry on Diigo" title="share this entry on Diigo" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'diigo', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_1', null, true]);"></a> + <a href="mailto:?subject=love_1 noun - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com&body=https://www.oxfordlearnersdictionaries.com/definition/english/love_1" alt="email this entry" title="email this entry" class="email-btn"></a> + </div> +</div> +</div> + + </div> + + <div class="responsive_hide_on_smartphone responsive_center" id="btmOthers"> + <div id='ad_btmslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_btmslot_a'); }); + </script> + </div> + </div> + </div> + </div> + <div id="rightcolumn" class="responsive_entry_center_right"> + +<div class="responsive_row"> +<div class="premium-box premium_english" id="otherLinksBox"> + <script type="text/javascript"> + var otherLinksFold = (document.cookie.indexOf("otherLinksFold") != -1); + if(otherLinksFold) { + var element = document.getElementById("otherLinksBox"); + element.className += ' data-fold'; + } + </script> + <div class="premium-title"> + <i class="premium-box-toggle icon"></i> + Other Links + </div> + <ul class="otherLinks"> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/get-premium/iwriter">iWriter</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/get-premium/ispeaker">iSpeaker</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/mywordlist/">My Wordlists</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/get-premium/resources">Resources</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/wordlist/">Wordlists</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/">Oxford 3000</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/english/pronunciation_english">Pronunciation</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/topic/">Topics</a></li> + </ul> + </div></div> + <div id="relatedentries" class="responsive_row"> + <h4 class="no-rule">Other results</h4> + <dl class="accordion ui-grad"> + <dt>All matches</dt> + <dd> + <ul class="list-col"> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2" title="love verb definition"><span class='arl1'>love <pos>verb</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-in" title="love-in noun definition"><span class='arl6'>love-in <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/free-love" title="free love noun definition"><span class='arl6'>free love <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-bite" title="love bite noun definition"><span class='arl6'>love bite <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-life" title="love life noun definition"><span class='arl6'>love life <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-nest" title="love nest noun definition"><span class='arl6'>love nest <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-seat" title="love seat noun definition"><span class='arl6'>love seat <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/self-love" title="self-love noun definition"><span class='arl6'>self-love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-child" title="love child noun definition"><span class='arl6'>love child <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-match" title="love match noun definition"><span class='arl6'>love match <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/puppy-love" title="puppy love noun definition"><span class='arl6'>puppy love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/tough-love" title="tough love noun definition"><span class='arl6'>tough love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/courtly-love" title="courtly love noun definition"><span class='arl6'>courtly love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-affair" title="love affair noun definition"><span class='arl6'>love affair <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-handles" title="love handles noun definition"><span class='arl6'>love handles <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-letter" title="love letter noun definition"><span class='arl6'>love letter <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/i-love-lucy" title="I Love Lucy definition"><span class='arl6'>I Love Lucy</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-interest" title="love interest noun definition"><span class='arl6'>love interest <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-triangle" title="love triangle noun definition"><span class='arl6'>love triangle <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/tug-of-love" title="tug of love noun definition"><span class='arl6'>tug of love <pos>noun</pos></span></a> + </li> + </ul> + <a class="see-more" >See more</a> + </dd> + <dt>Idioms</dt> + <dd> + <ul class="list-col"> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/blind_1#blind_1__159" title="Definition of love is blind in English"><span class='arl8'>love is blind</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/cupboard#cupboard__77" title="Definition of cupboard love in English"><span class='arl8'>cupboard love</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/labour_1#labour_1__277" title="Definition of a labour of love in English"><span class='arl8'>a labour of love</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/god#god__242" title="Definition of for the love of God in English"><span class='arl8'>for the love of God</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/head_1#head_1__980" title="Definition of head over heels in love in English"><span class='arl8'>head over heels in love</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2#love_2__390" title="Definition of love you and leave you in English"><span class='arl8'>love you and leave you</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/fair_1#fair_1__344" title="Definition of all’s fair in love and war in English"><span class='arl8'>all’s fair in love and war</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/lost#lost__211" title="Definition of there’s little/no love lost between A and B in English"><span class='arl8'>there’s little/no love lost between A and B</span></a> + </li> + </ul> + <a class="see-more">See more</a> + </dd> + </dl> + </div> + + <div class='responsive_center_on_smartphone'> + <div id='ad_houseslot1_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_houseslot1_a'); }); + </script> + </div> + </div> <div class="responsive_row nearby"> + <h4>Nearby words</h4> + <ul class="list-col"> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/lovable" title="Definition of lovable adjective in English"><DATA class="hwd">lovable <pos>adjective</pos></DATA></a> + </li> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/lovage" title="Definition of lovage noun in English"><DATA class="hwd">lovage <pos>noun</pos></DATA></a> + </li> + <li> + <span> + <a class='selected' href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" title="Definition of love noun in English"><DATA class="hwd">love <pos>noun</pos></DATA></a> + </span> </li> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2" title="Definition of love verb in English"><DATA class="hwd">love <pos>verb</pos></DATA></a> + </li> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-affair" title="Definition of love affair noun in English"><DATA class="hwd">love affair <pos>noun</pos></DATA></a> + </li> + </ul> + </div> + + + <div class="responsive_row topic"> + <h4>Explore our topics</h4> + <ul class='list-col'> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/animal_homes">Animals</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/attractiveness">Body and appearance</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/business_deals">Business</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/accessories">Clothes and fashion</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/committing_crime">Crime and law</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/art_equipment">Culture</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/access_to_education">Education</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/death">Family and life stages</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/in_the_kitchen">Food and drink</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/diet">Health</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/architectural_features">Houses and buildings</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/language_skills">Language</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/american_football">Leisure</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/animal_farming">Nature</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/anger">Personality and emotions</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/elections">Religion and politics</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/cost_and_payment">Retail</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/devices">Science</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/helping_others">Social issues</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/computer_hardware">Technology</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/celebrity_news">The media</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/aircraft">Travel and tourism</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/protest">War and conflict</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/describing_jobs">Work</a> + </li> + </ul> + </div> + + + + + + + + + + +<div class="responsive_display_on_smartphone responsive_center_on_smartphone" id="btmSmartphone"> + <div id='ad_btmslot_b' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_btmslot_b'); }); + </script> + </div> + </div> </div> + </div> + + </div> + + </div> + </div> + <div id="ox-footer" class="responsive_row oup-footer"> +<div class="responsive_container"> + + <div class="responsive_footer_top"> + <div class="responsive_center_on_smartphone"> + <div class="btn icon-left social-facebook"><a href="https://www.facebook.com/oupeltglobal">Find us on Facebook</a></div> + <div class="btn icon-left social-twitter"><a href="https://twitter.com/OUPELTGlobal">Follow us on Twitter</a></div> + <ul class='links'> + <li><a href="https://elt.oup.com/" onclick="return ! window.open(this.href);">OUP English Language Teaching</a></li> + <li><a href="https://www.oxfordlearnersbookshelf.com/home/homePage.html" onclick="return ! window.open(this.href);">Oxford Learner&apos;s Bookshelf</a></li> + </ul> + </div> + </div> + <div class="responsive_footer_bottom"> + <div class="responsive_center_on_smartphone"> + <a href="https://global.oup.com/" onclick="return ! window.open(this.href);" class="oup-logo" title="Oxford University Press"><img src="https://www.oxfordlearnersdictionaries.com/external/images/footer/logo-oup.png" title="Oxford University Press"/></a> + <div class="responsive_footer_bottom_wrap"> + <ul class='links'> + <li><a href="https://www.oxfordlearnersdictionaries.com/search_widget_info">Search Box</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/browse/">Browse Dictionaries & Grammar</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/contact-us">Contact Us</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/legal-notice">Legal Notice</a></li> + <li><a href="https://global.oup.com/privacy" onclick="return ! window.open(this.href);">Privacy Policy</a></li> + <li><a href="https://global.oup.com/cookiepolicy" onclick="return ! window.open(this.href);">Cookie Policy</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/terms-and-conditions">Terms & Conditions</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/system-requirements">System Requirements</a></li> + <li><a href="https://elt.oup.com/accessibility" onclick="return ! window.open(this.href);">Accessibility</a></li> + </ul> + <p class="copyright">&copy; 2018 Oxford University Press</p> + </div> + <div class="versionSelector"> + <select name="lang" id="headerVersion" title="Select language"> + <option + selected="selected" name="uk" + value="https://www.oxfordlearnersdictionaries.com/definition/english/love_1">English (UK)</option> + <option + name="us" + value="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_1">English (US)</option> + </select> + </div> + </div> + </div> + +</div> +</div> + + + + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/common.js?version=1.6.27"></script> + <script language="javascript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/doubleclick.js?version=1.6.27"></script> + + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/oxford.js?version=1.6.27"></script> + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/entry.js?version=1.6.27"></script> + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/jquery.lightbox-0.5.min.js?version=1.6.27"></script> + <script language="javascript" type="text/javascript"> + + $(document).ready(function() { setupDoubleClick('https://www.oxfordlearnersdictionaries.com/', 'english', false, 'main-container', null, null, null); }); + $('img.over').each(function(){ + var t=$(this); + var src1= t.attr('src'); // initial src + var newSrc = src1.substring(0, src1.lastIndexOf('.')); // let's get file name without extension + t.hover(function(){ + $(this).attr('src', newSrc+ '-over.' + /[^.]+$/.exec(src1)); //last part is for extension + }, function(){ + $(this).attr('src', newSrc + '.' + /[^.]+$/.exec(src1)); //removing '-over' from the name + }); + }); + </script> + <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> + + <script language="javascript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/responsive.js?version=1.6.27"></script> + <script type='text/javascript'> + $(document).ready(function() { + for(var i = 0; i<arrayFn.length;i++){ + arrayFn[i].call(); + } + }); + </script> + <script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-13175707-1', + { + 'siteSpeedSampleRate': 10 + }); + ga('send', 'pageview'); +</script> + + <script type="text/javascript">_qoptions={ qacct:"p-cfSla1Cke_iBQ" };</script> + <script type="text/javascript" src="https://secure.quantserve.com/quant.js"></script> + <noscript><img src="https://pixel.quantserve.com/pixel/p-cfSla1Cke_iBQ.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></noscript> + +</body> +</html> diff --git a/test/specs/components/dictionaries/oald/response/love_2.html b/test/specs/components/dictionaries/oald/response/love_2.html new file mode 100644 index 000000000..274812786 --- /dev/null +++ b/test/specs/components/dictionaries/oald/response/love_2.html @@ -0,0 +1,866 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>love_2 verb - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta name="description" content="Definition of love_2 verb in Oxford Advanced Learner&apos;s Dictionary. Meaning, pronunciation, picture, example sentences, grammar, usage notes, synonyms and more." /> + <meta name="keywords" content="love_2 verb, online dictionary, Oxford Advanced Learner&apos;s Dictionary, love_2 definition, define love_2, definition of love_2, love_2 pronunciation, pronounce love_2, love_2 meaning, love_2 examples, love_2 synonyms, picture, love_2 grammar" /> + + +<link rel="canonical" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2" /> + <link rel="alternate" hreflang="en" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2" /> + <link rel="alternate" hreflang="en-US" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_2" /> + <link rel="alternate" hreflang="en-MX" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_2" /> + <link rel="alternate" hreflang="en-PH" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_2" /> + <link rel="alternate" hreflang="en-BR" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_2" /> + <link rel="alternate" hreflang="en-CO" href="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_2" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <meta name='viewport' content='width=device-width, initial-scale=1'> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/interface.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/responsive.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/oxford.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/jquery.lightbox-0.5.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/print.css?version=1.6.27" rel="stylesheet" type="text/css" media="print" /> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/autocomplete.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <script type='text/javascript'> + var googletag = googletag || {}; + googletag.cmd = googletag.cmd || []; + var dfpSlots = {}; + (function() { + var gads = document.createElement('script'); + gads.async = true; + gads.type = 'text/javascript'; + var useSSL = 'https:' == document.location.protocol; + gads.src = (useSSL ? 'https:' : 'http:') +'//www.googletagservices.com/tag/js/gpt.js'; + var node = document.getElementsByTagName('script')[0]; + node.parentNode.insertBefore(gads, node); + })(); + googletag.cmd.push(function() { + var mapping_topslot_a = googletag.sizeMapping() + + .addSize([1203, 0], []) // hd (CSS min-width: 1220) + .addSize([745, 0], [728, 90]) // tablet (CSS min-width: 762) + .addSize([0, 0], [320, 50]) // mobile + .build(); + dfpSlots["topslot_a"] = googletag.defineSlot('/70903302/topslot', [728, 90], 'ad_topslot_a') + .defineSizeMapping(mapping_topslot_a) + .setTargeting('vp', 'top') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_topslot_b = googletag.sizeMapping() + + .addSize([1203, 0], [728, 90]) // hd (CSS min-width: 1220) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["topslot_b"] = googletag.defineSlot('/70903302/topslot', [], 'ad_topslot_b') + .defineSizeMapping(mapping_topslot_b) + .setTargeting('vp', 'top') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_btmslot_a = googletag.sizeMapping() + + .addSize([745, 0], [300, 250]) // tablet (CSS min-width: 762) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["btmslot_a"] = googletag.defineSlot('/70903302/btmslot', [300, 250], 'ad_btmslot_a') + .defineSizeMapping(mapping_btmslot_a) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_btmslot_b = googletag.sizeMapping() + + .addSize([745, 0], []) // tablet (CSS min-width: 762) + .addSize([0, 0], [300, 250]) // mobile + .build(); + dfpSlots["btmslot_b"] = googletag.defineSlot('/70903302/btmslot', [], 'ad_btmslot_b') + .defineSizeMapping(mapping_btmslot_b) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'center') + .addService(googletag.pubads()); + var mapping_houseslot1_a = googletag.sizeMapping() + + .addSize([0, 0], [180, 150]) // mobile + .build(); + dfpSlots["houseslot1_a"] = googletag.defineSlot('/70903302/houseslot1', [180, 150], 'ad_houseslot1_a') + .defineSizeMapping(mapping_houseslot1_a) + .setTargeting('vp', 'btm') + .setTargeting('hp', 'right') + .addService(googletag.pubads()); + var mapping_leftslot_a = googletag.sizeMapping() + + .addSize([745, 0], [160, 600]) // tablet (CSS min-width: 762) + .addSize([0, 0], []) // mobile + .build(); + dfpSlots["leftslot_a"] = googletag.defineSlot('/70903302/leftslot', [160, 600], 'ad_leftslot_a') + .defineSizeMapping(mapping_leftslot_a) + .setTargeting('vp', 'top') + .setTargeting('hp', 'left') + .addService(googletag.pubads()); + googletag.pubads().setTargeting("old_l", "en"); + googletag.pubads().setTargeting("old_pr", "free"); + googletag.pubads().setTargeting("old_pc", "dictionary"); + googletag.pubads().setTargeting("old_dc", "english"); + googletag.pubads().setTargeting("old_ei", "love_2"); + + googletag.pubads().setCategoryExclusion('wprod'); googletag.pubads().setCategoryExclusion('lcp'); + googletag.pubads().enableSingleRequest(); + googletag.pubads().collapseEmptyDivs(false); + googletag.enableServices(); + }); + function getDeviceByResolution() { + var res = null; + if (window.matchMedia("(max-width: 761px)").matches) + res = "mobile"; + else if (window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches) + res = "tablet"; + else if (window.matchMedia("(min-width: 1220px)").matches) + res = "hd"; + else + res = "desktop"; + return res; + } + var curResolution = getDeviceByResolution(); + window.onresize = function() { + var newResolution = getDeviceByResolution(); + if (newResolution != curResolution) { + curResolution = newResolution; + googletag.pubads().refresh(); + } + }; + </script> + <!--[if gte IE 7 ]> + <link href="https://www.oxfordlearnersdictionaries.com/external/styles/oxford-ie.css?version=1.6.27" rel="stylesheet" type="text/css" /> + <![endif]--> + <!--[if IE 9]><script type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/matchMedia.js?version=1.6.27"></script><![endif]--> + <link href="https://fonts.googleapis.com/css?family=Open+Sans:700i" rel="stylesheet" type='text/css'> + <link rel="icon" type="image/x-icon" href="https://www.oxfordlearnersdictionaries.com/external/images/favicon.ico?version=1.6.27"/> + <script type='text/javascript'> + var arrayFn = []; + var dictCodesArr = new Array(); + /*english + * OALD9 + * free + * false || true*/ + dictCodesArr["english"] = { + url : 'english', + name : 'English', + description : 'Search OALD', + free: true + }; + /*american_english + * OAAD,OALD9 + * free + * false || true*/ + dictCodesArr["american_english"] = { + url : 'american_english', + name : 'American English', + description : 'Search OAAD', + free: true + }; + /*academic + * OLDAE + * free + * false || false*/ + dictCodesArr["academic"] = { + url : 'academic', + name : 'Academic English', + description : 'Search OLDAE', + free: false + }; + /*collocations + * OCOLL + * free + * false || false*/ + dictCodesArr["collocations"] = { + url : 'collocations', + name : 'Collocations', + description : 'Search Oxford Collocations Dictionary', + free: false + }; + /*practical-english-usage + * PEU + * free + * false || false*/ + dictCodesArr["practical-english-usage"] = { + url : 'practical-english-usage', + name : 'Practical English Usage', + description : 'Search PEU Index', + free: false + }; + /*schulwoerterbuch_German-English + * SWB + * free + * false || false*/ + dictCodesArr["schulwoerterbuch_German-English"] = { + url : 'schulwoerterbuch_German-English', + name : 'German-English', + description : 'Search Das Oxford Schulw\u00F6rterbuch', + free: false + }; + /*schulwoerterbuch_English-German + * SWB + * free + * false || false*/ + dictCodesArr["schulwoerterbuch_English-German"] = { + url : 'schulwoerterbuch_English-German', + name : 'English-German', + description : 'Search Das Oxford Schulw\u00F6rterbuch', + free: false + }; + </script> + +</head> +<body > + <noscript> + <div id="cookieLaw">We use cookies to enhance your experience on our website, including to provide targeted advertising and track usage. By continuing to use our website, you are agreeing to our use of cookies. You can change your cookie settings at any time. <a href='https://global.oup.com/cookiepolicy/?siteid=oaadonline' target='_blank'>Find out more</a></div> + </noscript> + <div id="ox-container"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<div id="ox-header" class=""> + <div class="responsive_row flush-below top"> + <div class="responsive_container responsive_display_on_smartphone"> + <div class="menu_button"></div> + </div> + <div class="nav responsive_container main_nav"> + <ul class="menu"> + <li><a href="https://www.oxfordlearnersdictionaries.com/">Dictionaries</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/grammar/">Grammar & usage</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/">About</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/faq/">FAQs</a></li> + </ul> + <div class="menu logout"> + <ul> + <li><a href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">Redeem a code</a></li> + <li><a class="top-toolbar-off" href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">My account</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/account/checkCookie?preUrl=/account/login">Log in</a></li> + </ul> + </div> + </div> +<a class='go-to-top responsive_display_on_smartphone' href='#wrap' title='back to top'>Back to Top</a> +</div> +<div class="responsive_container "> + <div class="old-logo-title responsive_hide_on_smartphone"><a class="old-logo-title" href="https://www.oxfordlearnersdictionaries.com/"></a></div> + <div class="responsive_display_on_smartphone"><a class="old-logo-title" href="https://www.oxfordlearnersdictionaries.com/"></a></div> + <div class="mainsearch responsive_row"> + <form id="search-form" method="get" action="https://www.oxfordlearnersdictionaries.com/search/english/direct/"> + <div class="dictionarySelector"> <span id="select_div"> + <div>English</div> + </span> + <select id="dictionary-selector"> <option value="english">English</option> + <option value="american_english">American English</option> + <option value="academic">Academic English</option> + <option value="collocations">Collocations</option> + <option value="practical-english-usage">Practical English Usage</option> + <option value="schulwoerterbuch_German-English">German-English</option> + <option value="schulwoerterbuch_English-German">English-German</option> + </select> + <div class="csm"> + <a data-value="english" >English</a> + <a data-value="american_english" >American English</a> + <a data-value="academic" ) locked="true" >Academic English</a> + <a data-value="collocations" ) locked="true" >Collocations</a> + <a data-value="practical-english-usage" ) locked="true" >Practical English Usage</a> + <a data-value="schulwoerterbuch_German-English" ) locked="true" >German-English</a> + <a data-value="schulwoerterbuch_English-German" ) locked="true" >English-German</a> + <div class="notch1"></div> + <div class="notch2"></div> + </div> +</div> + <div class="searchfield"> + <input type="text" id="q" name="q" + class="searchfield_input"/> + <a id="keyboard_icon" class="oup_icons responsive_hide_on_smartphone responsive_hide_on_tablet"></a> + <div id="keyboard_letters"></div> + </div> + <div class="inputSuggestions" style=""></div> + <div id="search-btn" class="oup_icons"> + <input type="submit" value="" /> + </div> + </form> + </div> <div class="responsive_hide_on_hd responsive_center_on_smartphone" id="leaderboardOthers"> + <div id='ad_topslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_topslot_a'); }); + </script> + </div> + </div> + <div class="responsive_row"> + <div class="responsive_entry_left"> + <div id='ad_leftslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_leftslot_a'); }); + </script> + </div> + </div> + + <div class="responsive_entry_center"> + <div class="responsive_display_on_hd" id="leaderboardHD"> + <div id='ad_topslot_b' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_topslot_b'); }); + </script> + </div> + </div> + <div class="responsive_entry_center_wrap"> + + <div class="entry-header"> + <div class="responsive_entry_center_left"> + + <p class="definition-title">Definition of <em>love verb</em> from the Oxford Advanced Learner&apos;s Dictionary</p> + </div> + <div class="responsive_entry_center_right responsive_hide_on_smartphone share-this-entry"> <div class="social-wrap"> + <span id="plusone-box"><g:plusone size="normal" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2" count="false"></g:plusone></span> + <a href="https://www.facebook.com/sharer.php?u=https://www.oxfordlearnersdictionaries.com/definition/english/love_2&t=love_2 verb - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com" target="_blank" class="facebook-btn" alt="share this entry on Facebook" title="share this entry on Facebook" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'facebook', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="https://twitter.com/home?status=Add+This:+https://www.oxfordlearnersdictionaries.com/definition/english/love_2" target="_blank" class="twitter-btn" alt="tweet this entry" title="tweet this entry" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'twitter', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="https://www.stumbleupon.com/submit?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_2" target="_blank" class="stumbleupon-btn" alt="share this entry on StumbleUpon" title="share this entry on StumbleUpon" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'stumbleupon', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="https://www.diigo.com/post?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_2" target="_blank" class="diigo-btn" alt="share this entry on Diigo" title="share this entry on Diigo" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'diigo', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="mailto:?subject=love_2 verb - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com&body=https://www.oxfordlearnersdictionaries.com/definition/english/love_2" alt="email this entry" title="email this entry" class="email-btn"></a> + </div> +</div> + </div> + + <div id="ox-wrapper" class="responsive_entry_center_left"> + <div id="main_column" class="responsive_row"> + <div id="main-container" class="main-container"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<script language="javascript" type="text/javascript"> + var contextId= (location.hash != "" ? location.hash : null); + // global variable that contains the path to external files + // and used by the lightbox script + var lightboxImageLoading = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-ico-loading.gif?version=1.6.27"; + var lightboxImageBtnPrev = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-btn-prev.gif?version=1.6.27"; + var lightboxImageBtnNext = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-btn-next.gif?version=1.6.27"; + var lightboxImageBtnClose = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-btn-close.gif?version=1.6.27"; + var lightboxImageBlank = "https://www.oxfordlearnersdictionaries.com/external/images/lightbox-blank.gif?version=1.6.27"; + if (document.readyState != 'loading'){ + initEntry('See more', 'See less'); + } else if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', function(){initEntry('See more', 'See less');}); + } else { + document.attachEvent('onreadystatechange', function() { + if (document.readyState != 'loading') + initEntry('See more', 'See less'); + }); + } +</script> + <div id="entryContent" class="oald"><div class="entry" sum="1576" type="denested" dpsid="ufd9718d478e0e1e5.1567090e.15d132a10fe.5313" sk="love::2" id="love_2"><ol class="h-g" id="love_2__1" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-326f"><div class="top-container"><div class="top-g" id="love_2__2" dpsid="ufd9718d478e0e1e5.1567090e.15d132a10fe.5315"> + <div class="webtop-g"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a><span class="z"> </span><h2 class="h">love</h2><span class="z"> </span><span class="pos">verb</span></div><span class="pos-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-326d" id="love_2__4"><span class="pos" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-326c" id="love_2__5">verb</span></span> <div class="pron-gs ei-g" eid="love_2__6"><span class="pron-g" trans="ald8" geo="br" id="love_2__7"><span class="prefix"><span class="blue">BrE</span></span> <span class="phon" eid="love_2__8" dpsid="u87edc89808edd67c.29752a59.160daa4653b.e1"><span class="bre">BrE</span><span class="separator">/</span><span class="wrap">/</span>lʌv<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-uk icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron/l/lov/love_/love__gb_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron_ogg/l/lov/love_/love__gb_1.ogg" title=" pronunciation English" style="cursor: pointer" valign="top"> </div></span><span class="sep">;</span> <span class="pron-g" trans="ald8" geo="n_am" id="love_2__9"><span class="prefix"><span class="red">NAmE</span></span> <span class="phon" eid="love_2__10" dpsid="u87edc89808edd67c.29752a59.160daa4653b.e4"><span class="name">NAmE</span><span class="separator">/</span><span class="wrap">/</span>lʌv<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-us icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/us_pron/l/lov/love_/love__us_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/us_pron_ogg/l/lov/love_/love__us_1.ogg" title=" pronunciation American" style="cursor: pointer" valign="top"> </div></span></div><span class="collapse" title="Verb Forms"><span class="unbox" unbox="verbforms" dpsref="u4cdebea65f7df6b4.32994981.14e72d38a4e.-2d46" id="love_2__11" psg="u4cdebea65f7df6b4.743b4102.13cbac01393.-326a" dpsresource="VERB_FORMS" dpsid="u4cdebea65f7df6b4.52a0ebc2.14e966d023b.34b7"><span class="heading">Verb Forms</span><span class="body"><span class="vp-g" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-234f" form="root" id="love_2__12"><span class="vp" id="love_2__13" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-234e"> <span class="prefix">present simple I / you / we / they</span> love</span> <div class="pron-gs ei-g" eid="love_2__14" verbform="y"><span class="pron-g" trans="ald8" geo="br" id="love_2__15"><span class="prefix"><span class="blue">BrE</span></span> <span class="phon" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-234b" eid="love_2__16"><span class="bre">BrE</span><span class="separator">/</span><span class="wrap">/</span>lʌv<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-uk icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron/l/lov/love_/love__gb_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron_ogg/l/lov/love_/love__gb_1.ogg" title=" pronunciation English" style="cursor: pointer" valign="top"> </div></span><span class="sep">;</span> <span class="pron-g" id="love_2__17" geo="n_am" trans="ald8"><span class="prefix"><span class="red">NAmE</span></span> <span class="phon" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2348" eid="love_2__18"><span class="name">NAmE</span><span class="separator">/</span><span class="wrap">/</span>lʌv<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-us icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/us_pron/l/lov/love_/love__us_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/us_pron_ogg/l/lov/love_/love__us_1.ogg" title=" pronunciation American" style="cursor: pointer" valign="top"> </div></span></div></span><span class="vp-g" form="thirdps" id="love_2__19" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2346"><span class="vp" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2345" id="love_2__20"> <span class="prefix">he / she / it</span> loves</span> <div class="pron-gs ei-g" eid="love_2__21" verbform="y"><span class="pron-g" geo="br" id="love_2__22" trans="ald8"><span class="prefix"><span class="blue">BrE</span></span> <span class="phon" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2342" eid="love_2__23"><span class="bre">BrE</span><span class="separator">/</span><span class="wrap">/</span>lʌvz<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-uk icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron/l/lov/loves/loves__gb_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron_ogg/l/lov/loves/loves__gb_1.ogg" title=" pronunciation English" style="cursor: pointer" valign="top"> </div></span><span class="sep">;</span> <span class="pron-g" id="love_2__24" geo="n_am" trans="ald8"><span class="prefix"><span class="red">NAmE</span></span> <span class="phon" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-233f" eid="love_2__25"><span class="name">NAmE</span><span class="separator">/</span><span class="wrap">/</span>lʌvz<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-us icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/us_pron/l/lov/loves/loves__us_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/us_pron_ogg/l/lov/loves/loves__us_1.ogg" title=" pronunciation American" style="cursor: pointer" valign="top"> </div></span></div></span><span class="vp-g" form="past" id="love_2__26" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-233d"><span class="vp" id="love_2__27" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-233c"> <span class="prefix">past simple</span> loved</span> <div class="pron-gs ei-g" eid="love_2__28" verbform="y"><span class="pron-g" trans="ald8" geo="br" id="love_2__29"><span class="prefix"><span class="blue">BrE</span></span> <span class="phon" eid="love_2__30" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2339"><span class="bre">BrE</span><span class="separator">/</span><span class="wrap">/</span>lʌvd<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-uk icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron/l/lov/loved/loved__gb_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron_ogg/l/lov/loved/loved__gb_1.ogg" title=" pronunciation English" style="cursor: pointer" valign="top"> </div></span><span class="sep">;</span> <span class="pron-g" trans="ald8" geo="n_am" id="love_2__31"><span class="prefix"><span class="red">NAmE</span></span> <span class="phon" eid="love_2__32" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2336"><span class="name">NAmE</span><span class="separator">/</span><span class="wrap">/</span>lʌvd<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-us icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/us_pron/l/lov/loved/loved__us_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/us_pron_ogg/l/lov/loved/loved__us_1.ogg" title=" pronunciation American" style="cursor: pointer" valign="top"> </div></span></div></span><span class="vp-g" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2334" form="pastpart" id="love_2__33"><span class="vp" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2333" id="love_2__34"> <span class="prefix">past participle</span> loved</span> <div class="pron-gs ei-g" eid="love_2__35" verbform="y"><span class="pron-g" id="love_2__36" geo="br" trans="ald8"><span class="prefix"><span class="blue">BrE</span></span> <span class="phon" eid="love_2__37" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2330"><span class="bre">BrE</span><span class="separator">/</span><span class="wrap">/</span>lʌvd<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-uk icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron/l/lov/loved/loved__gb_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron_ogg/l/lov/loved/loved__gb_1.ogg" title=" pronunciation English" style="cursor: pointer" valign="top"> </div></span><span class="sep">;</span> <span class="pron-g" trans="ald8" id="love_2__38" geo="n_am"><span class="prefix"><span class="red">NAmE</span></span> <span class="phon" eid="love_2__39" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-232d"><span class="name">NAmE</span><span class="separator">/</span><span class="wrap">/</span>lʌvd<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-us icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/us_pron/l/lov/loved/loved__us_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/us_pron_ogg/l/lov/loved/loved__us_1.ogg" title=" pronunciation American" style="cursor: pointer" valign="top"> </div></span></div></span><span class="vp-g" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-232b" form="prespart" id="love_2__40"><span class="vp" id="love_2__41" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-232a"> <span class="prefix">-ing form</span> loving</span> <div class="pron-gs ei-g" eid="love_2__42" verbform="y"><span class="pron-g" geo="br" id="love_2__43" trans="ald8"><span class="prefix"><span class="blue">BrE</span></span> <span class="phon" eid="love_2__44" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2327"><span class="bre">BrE</span><span class="separator">/</span><span class="wrap">/</span>ˈlʌvɪŋ<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-uk icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron/l/lov/lovin/loving__gb_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/uk_pron_ogg/l/lov/lovin/loving__gb_1.ogg" title=" pronunciation English" style="cursor: pointer" valign="top"> </div></span><span class="sep">;</span> <span class="pron-g" id="love_2__45" geo="n_am" trans="ald8"><span class="prefix"><span class="red">NAmE</span></span> <span class="phon" dpsid="u7f89d943e98abfe7.-4db24fac.16164a1d90d.-2324" eid="love_2__46"><span class="name">NAmE</span><span class="separator">/</span><span class="wrap">/</span>ˈlʌvɪŋ<span class="wrap">/</span><span class="separator">/</span></span><div class="sound audio_play_button pron-us icon-audio" data-src-mp3="https://www.oxfordlearnersdictionaries.com/media/english/us_pron/l/lov/lovin/loving__us_1.mp3" data-src-ogg="https://www.oxfordlearnersdictionaries.com/media/english/us_pron_ogg/l/lov/lovin/loving__us_1.ogg" title=" pronunciation American" style="cursor: pointer" valign="top"> </div></span></div></span></span></span></span><span class="res-g" hide="y" psg="top_topics"> <span class="xr-gs" xref_type="internal"><a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/love/love_4" title="Topic Love"><span class="xr-g" resource="topicdict"><span class="xh">Love</span></span></a></span></span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" id="love_2__47" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-324f"> <span class="shcut" id="love_2__48" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-324e">feel affection</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-324d" ox3000="y" id="love_2__49"><span class="num">1 </span><span class="sym_first"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a></span><span class="cf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-324b" id="love_2__50"><span class="exp" id="love_2__51" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-324a">love</span> somebody/something</span> <span class="use" id="love_2__52" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3249"><span class="wrap">(</span>not used in the progressive tenses<span class="wrap">)</span></span> <span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3248" id="love_2__53">to have very strong feelings of affection for somebody</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3247" id="love_2__54"><span class="x-g" id="love_2__55" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3246"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3245" resource="recx" id="love_2__56"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5934" id="love_2__57">I love you.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3244" id="love_2__60"> <span class="rx-g" resource="recx" id="love_2__61" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3243"><span class="x" id="love_2__62" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5937">If you love each other, why not get married?</span></span></span><span class="x-g" id="love_2__65" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3242"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3241" id="love_2__66" resource="recx"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.593a" id="love_2__67">Her much-loved brother lay dying of AIDS.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3240" id="love_2__70"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-323f" resource="recx" id="love_2__71"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.593d" id="love_2__72">He had become a well-loved member of staff.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-323e" id="love_2__75"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-323d" id="love_2__76" resource="recx"><span class="x" id="love_2__77" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5940">Relatives need time to grieve over <span class="cl"><strong>loved ones</strong></span> they have lost.</span></span></span><span class="x-g" id="love_2__81" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-323c"> <span class="x" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-323b" id="love_2__82">to love your country</span></span></span><span class="collapse" title="Synonyms"><span class="unbox" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31eb" unbox="synonyms" id="love_2__83"> <span class="heading">Synonyms</span><span class="body" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ea" id="love_2__84"><span class="h1" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e9" id="love_2__85">love</span><span class="inline" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e8" id="love_2__86"><span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e7" id="love_2__87">like</span> <span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e6" id="love_2__88">be fond of somebody</span> <span class="li" id="love_2__89" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e5">adore</span> <span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e4" id="love_2__90">be devoted to somebody</span> <span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e3" id="love_2__91">care for somebody</span> <span class="li" id="love_2__92" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e2">dote on somebody</span></span><span class="p" id="love_2__93" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e1">These words all mean to have feelings of love or affection for somebody.</span><span class="deflist" id="love_2__94" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31e0"><span class="li" id="love_2__95" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31df"><span class="eb" id="love_2__96" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31de">love</span> to have strong feelings of affection for somebody:<span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31dd" id="love_2__97"><span class="x-g" id="love_2__98" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31dc"><span class="rx-g" id="love_2__99" psg="RECXbreadcrumbtrail_11349" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a2"><span class="x" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35ae" id="love_2__100">I love you.</span></span></span></span></span><span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31da" id="love_2__103"><span class="eb" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d9" id="love_2__104">like</span> to find somebody pleasant and enjoy being with them:<span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d8" id="love_2__105"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d7" id="love_2__106"><span class="rx-g" id="love_2__107" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a3" psg="RECXbreadcrumbtrail_11350"><span class="x" id="love_2__108" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35b1">She’s nice. I like her.</span></span></span></span></span><span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d5" id="love_2__111"><span class="eb" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d4" id="love_2__112">be fond of somebody</span> to feel affection for somebody, especially somebody you have known for a long time:<span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d3" id="love_2__113"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d2" id="love_2__114"><span class="rx-g" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a4" psg="RECXbreadcrumbtrail_11351" id="love_2__115"><span class="x" id="love_2__116" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35b4">I’ve always been very fond of your mother.</span></span></span></span></span><span class="li" id="love_2__119" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31d0"><span class="eb" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31cf" id="love_2__120">adore</span> to love somebody very much:<span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ce" id="love_2__121"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31cd" id="love_2__122"><span class="rx-g" id="love_2__123" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a5" psg="RECXbreadcrumbtrail_11352"><span class="x" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35b7" id="love_2__124">It’s obvious that she adores him.</span></span></span></span></span><span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31cb" id="love_2__127"><span class="eb" id="love_2__128" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ca">be devoted to somebody</span> to love somebody very much and be loyal to them:<span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c9" id="love_2__129"><span class="x-g" id="love_2__130" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c8"><span class="rx-g" psg="RECXbreadcrumbtrail_11353" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a6" id="love_2__131"><span class="x" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35ba" id="love_2__132">They are devoted to their children.</span></span></span></span></span><span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c6" id="love_2__135"><span class="eb" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c5" id="love_2__136">care for somebody</span> to love somebody, especially in a way that is based on strong affection or a feeling of wanting to protect them, rather than sex:<span class="x-gs" id="love_2__137" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c4"><span class="x-g" id="love_2__138" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c3"><span class="rx-g" id="love_2__139" psg="RECXbreadcrumbtrail_11354" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a7"><span class="x" id="love_2__140" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35bd">He cared for her more than she realized.</span></span></span></span> <span class="un" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c1" un="note" id="love_2__143"><span class="eb" id="love_2__144" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31c0">Care for somebody</span> is often used when somebody has not told anyone about their feelings or is just starting to be aware of them. It is also used when somebody wishes that somebody loved them, or doubts that somebody does:<span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31bf" id="love_2__145"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31be" id="love_2__146"><span class="rx-g" psg="RECXbreadcrumbtrail_11355" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a8" id="love_2__147"><span class="x" id="love_2__148" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35c0">If he really cared for you, he wouldn’t behave like that.</span></span></span></span></span></span><span class="li" id="love_2__151" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31bc"><span class="eb" id="love_2__152" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31bb">dote on somebody</span> to feel and show great love for somebody, ignoring their faults:<span class="x-gs" id="love_2__153" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ba"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b9" id="love_2__154"><span class="rx-g" id="love_2__155" psg="RECXbreadcrumbtrail_11356" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35a9"><span class="x" dpsid="u4cdebea65f7df6b4.7cee736d.14df79e4188.35c3" id="love_2__156">He dotes on his children.</span></span></span></span></span></span><span class="h3" id="love_2__159" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b7">Patterns</span><span class="bullet" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b6" id="love_2__160"><span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b5" id="love_2__161"> to <span class="eb" id="love_2__162" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b4">really</span> love/​like/​adore/​care for/​dote on somebody</span><span class="li" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b3" id="love_2__163"> to be <span class="eb" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b2" id="love_2__164">really/​genuinely</span> fond of/​devoted to somebody</span><span class="li" id="love_2__165" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b1"> to love/​like/​care for somebody <span class="eb" id="love_2__166" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31b0">very much</span></span></span></span></span></span><span class="snippet"><span class="collapse" title="Oxford Collocations Dictionary"><span class="unbox" unbox="colloc_snip"> <span class="heading">Oxford Collocations Dictionary</span><span class="body"><span class="shcut-g"> <span class="shcut">adverb</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">dearly</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deeply</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">passionately</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="xr-gs" xref_type="external"> <span class="prefix">See</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/collocations/love_2" title="full entry definition in Collocations +&#10; "><span class="xr-g" resource="collocations" dpsref="uc0ec231edbf4e81b.423ca8c8.15b1ad2ed6a.-6461"><span class="xh">full entry</span></span></a></span></span></span></span></span> <span class="xr-gs" xref_type="internal"><span class="prefix">See related entries:</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/love/love_4" title="Topic Love"><span class="xr-g" resource="topicdict"><span class="xh">Love</span></span></a></span></li></span><span class="sn-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-323a" id="love_2__168"> <span class="shcut" id="love_2__169" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3239">like/enjoy</span><li class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3238" ox3000="y" id="love_2__170"><span class="num">2 </span><span class="sym_first"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a></span><span class="def" id="love_2__171" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3236">to like or enjoy something very much</span> <span class="xr-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3235" id="love_2__172" xref_type="internal"><span class="prefix">synonym</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/english/adore" title="adore definition"><span class="xr-g" dpsresource="ALD9" dpsref="u4cdebea65f7df6b4.743b4102.13cbab9c8f4.5a8b" id="love_2__173" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3234"><span class="xh" dpsid="u4cdebea65f7df6b4.743b4102.13cce79fcd6.61eb" id="love_2__174">adore</span></span></a></span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3232" id="love_2__175"><span class="x-g" id="love_2__176" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3231"> <span class="cf" id="love_2__177" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3230"><span class="exp" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-322f" id="love_2__178">love</span> something</span> <span class="rx-g" resource="recx" id="love_2__179" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-322e"><span class="x" id="love_2__180" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5944">I really love summer evenings.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-322d" id="love_2__183"> <span class="rx-g" id="love_2__184" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-322c"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5947" id="love_2__185"><span class="cl"><strong>I just love it when</strong></span> you bring me presents!</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-322b" id="love_2__189"> <span class="rx-g" resource="recx" id="love_2__190" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-322a"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.594b" id="love_2__191">He <span class="cl"><strong>loved the way</strong></span> she smiled.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3229" id="love_2__195"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3228" id="love_2__196" resource="recx"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.594f" id="love_2__197">I <span class="cl"><strong>love it</strong></span> in Spain <span class="gl" id="love_2__199" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5951"><span class="wrap">(</span><span class="prefix">=</span> I like the life there<span class="wrap">)</span></span>.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3227" id="love_2__202"> <span class="rx-g" id="love_2__203" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3226"><span class="x" id="love_2__204" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5954">It was one of his best-loved songs.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3225" id="love_2__207"> <span class="label-g" id="love_2__208" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3224"><span class="wrap">(</span><span class="reg" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3223" reg="iron" id="love_2__209">ironic</span><span class="wrap">)</span></span> <span class="rx-g" resource="recx" id="love_2__210" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3222"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5957" id="love_2__211"><span class="cl"><strong>You're going to love this.</strong></span> They've changed their minds again.</span></span></span><span class="x-g" id="love_2__215" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-321c"> <span class="cf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3221" id="love_2__216"><span class="exp" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3220" id="love_2__217">love</span> doing something</span> <span class="label-g" id="love_2__218" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-321f"><span class="wrap">(</span><span class="geo" geo="br" id="love_2__219" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-321e">especially in British English</span><span class="wrap">)</span></span> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-321b" id="love_2__220" resource="recx"><span class="x" id="love_2__221" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.595b">My dad loves going to football games.</span></span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3215" id="love_2__224"> <span class="cf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-321a" id="love_2__225"><span class="exp" id="love_2__226" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3219">love</span> to do something</span> <span class="label-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3218" id="love_2__227"><span class="wrap">(</span><span class="geo" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3217" id="love_2__228" geo="n_am">especially North American English</span><span class="wrap">)</span></span> <span class="rx-g" resource="recx" id="love_2__229" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3214"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.595e" id="love_2__230">I love to go out dancing.</span></span></span><span class="x-g" id="love_2__233" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3213"> <span class="cf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3212" id="love_2__234"><span class="exp" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3211" id="love_2__235">love</span> somebody/something to do something</span> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3210" id="love_2__236" resource="recx"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5961" id="love_2__237">He loved her to sing to him.</span></span></span></span><span class="collapse" title="Synonyms"><span class="unbox" id="love_2__240" unbox="synonyms" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a18"> <span class="heading">Synonyms</span><span class="body" id="love_2__241" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a19"><span class="h1" id="love_2__242" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a1a">like</span><span class="inline" id="love_2__243" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a1b"><span class="li" id="love_2__244" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a1c">love</span> <span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a1d" id="love_2__245">be fond of</span> <span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a1e" id="love_2__246">be keen on something</span> <span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a1f" id="love_2__247">adore</span></span><span class="p" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a20" id="love_2__248">These words all mean to find something pleasant, attractive or satisfactory, or to enjoy something.</span><span class="deflist" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a21" id="love_2__249"><span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a22" id="love_2__250"><span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a23" id="love_2__251">like</span> to find something pleasant, attractive or satisfactory; to enjoy something:<span class="x-gs" id="love_2__252" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a24"><span class="x-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a25" id="love_2__253"><span class="rx-g" psg="RECXbreadcrumbtrail_11086" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.3179" id="love_2__254"><span class="x" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.3185" id="love_2__255">Do you like their new house?</span></span></span> <span class="x-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a27" id="love_2__258"><span class="rx-g" psg="RECXbreadcrumbtrail_11087" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.317a" id="love_2__259"><span class="x" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.3188" id="love_2__260">I like to see them enjoying themselves.</span></span></span></span></span><span class="li" id="love_2__263" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a29"><span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a2a" id="love_2__264">love</span> to like or enjoy something very much:<span class="x-gs" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a2b" id="love_2__265"><span class="x-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a2c" id="love_2__266"><span class="rx-g" psg="RECXbreadcrumbtrail_11088" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.317b" id="love_2__267"><span class="x" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.318b" id="love_2__268">He loved the way she smiled.</span></span></span></span></span><span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a2e" id="love_2__271"><span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a2f" id="love_2__272">be fond of something</span> to like or enjoy something, especially something you have liked or enjoyed for a long time:<span class="x-gs" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a30" id="love_2__273"><span class="x-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a31" id="love_2__274"><span class="rx-g" psg="RECXbreadcrumbtrail_11089" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.317c" id="love_2__275"><span class="x" id="love_2__276" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.318e">We were fond of the house and didn’t want to leave.</span></span></span></span></span><span class="li" id="love_2__279" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a33"><span class="eb" id="love_2__280" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a34">be keen on something</span> (<span class="label-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a35" id="love_2__281" pnc="n"><span class="geo" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a36" geo="br" id="love_2__282">British English</span></span><span class="ei" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a37" id="love_2__283">informal</span>) (often used in negative statements) to like or enjoy something:<span class="x-gs" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a38" id="love_2__284"><span class="x-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a39" id="love_2__285"><span class="rx-g" id="love_2__286" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.317d" psg="RECXbreadcrumbtrail_11090"><span class="x" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.3191" id="love_2__287">I’m not keen on spicy food.</span></span></span> <span class="x-g" id="love_2__290" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a3b"><span class="rx-g" psg="RECXbreadcrumbtrail_11091" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.317e" id="love_2__291"><span class="x" id="love_2__292" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.3194">She’s not keen on being told what to do.</span></span></span></span></span><span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a3d" id="love_2__295"><span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a3e" id="love_2__296">adore</span> (<span class="ei" id="love_2__297" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a3f">informal</span>) to like or enjoy something very much:<span class="x-gs" id="love_2__298" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a40"><span class="x-g" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a41" id="love_2__299"><span class="rx-g" psg="RECXbreadcrumbtrail_11092" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.317f" id="love_2__300"><span class="x" dupedid="u4cdebea65f7df6b4.7cee736d.14df79e4188.3197" id="love_2__301">She adores working with children.</span></span></span></span></span></span><span class="h3" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a43" id="love_2__304">love or adore?</span><span class="bullet" id="love_2__305" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a44"><span class="li" id="love_2__306" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a45"> <span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a46" id="love_2__307">Adore</span> is more informal than <span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a47" id="love_2__308">love</span>, and is used to express a stronger feeling.</span></span><span class="h3" id="love_2__309" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a48">Patterns</span><span class="bullet" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a49" id="love_2__310"><span class="li" id="love_2__311" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a4a"> to like/​love/​be fond of/​be keen on/​adore <span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a4b" id="love_2__312">doing something</span></span><span class="li" id="love_2__313" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a4c"> to like/​love <span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a4d" id="love_2__314">to do something</span></span><span class="li" id="love_2__315" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a4e"> to like/​love something <span class="eb" id="love_2__316" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a4f">very much</span></span><span class="li" id="love_2__317" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a50"> <span class="eb" id="love_2__318" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a51">I</span> like/​love/​adore <span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a52" id="love_2__319">it</span> here/​there/​when…</span><span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a53" id="love_2__320"> to like/​love/​adore <span class="eb" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a54" id="love_2__321">the way</span> somebody does something</span><span class="li" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a55" id="love_2__322"> to <span class="eb" id="love_2__323" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a56">really</span> like/​love/​adore somebody/​something</span><span class="li" id="love_2__324" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a57"> to be <span class="eb" id="love_2__325" dupedid="u4cdebea65f7df6b4.743b4102.13cbabf992f.7a58">really</span> fond of/​keen on something</span></span></span></span></span><span class="snippet"><span class="collapse" title="Oxford Collocations Dictionary"><span class="unbox" unbox="colloc_snip"> <span class="heading">Oxford Collocations Dictionary</span><span class="body"><span class="shcut-g"> <span class="shcut">adverb</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">dearly</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deeply</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">passionately</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="xr-gs" xref_type="external"> <span class="prefix">See</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/collocations/love_2" title="full entry definition in Collocations +&#10; "><span class="xr-g" resource="collocations" dpsref="uc0ec231edbf4e81b.423ca8c8.15b1ad2ed6a.-6461"><span class="xh">full entry</span></span></a></span></span></span></span></span> <span class="xr-gs" xref_type="internal"><span class="prefix">See related entries:</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/topic/love/love_4" title="Topic Love"><span class="xr-g" resource="topicdict"><span class="xh">Love</span></span></a></span></li><li class="sn-g" ox3000="y" id="love_2__327" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-320c"><span class="num">3 </span><span class="sym_first"> + <a class="oxford3000" href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/"> </a></span><span class="v-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-320b" type="alt" id="love_2__328"><span class="v-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-320a" id="love_2__329"><span class="v"><strong>would love</strong></span></span></span> <span class="def" id="love_2__331" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3208">used to say that you would very much like something</span><span class="x-gs" id="love_2__332" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3207"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3206" id="love_2__333"> <span class="cf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3205" id="love_2__334"><span class="exp" id="love_2__335" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3204">love</span> to do something</span> <span class="rx-g" resource="recx" id="love_2__336" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3203"><span class="x" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5964" id="love_2__337">Come on Rory, the kids would love to hear you sing.</span></span></span><span class="x-g" id="love_2__340" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3202"> <span class="rx-g" id="love_2__341" resource="recx" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3201"><span class="x" id="love_2__342" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5967">I haven't been to Brazil, but I'd love to go.</span></span></span><span class="x-g" id="love_2__345" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-3200"> <span class="cf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ff" id="love_2__346"><span class="exp" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31fe" id="love_2__347">love</span> somebody/something to do something</span> <span class="rx-g" resource="recx" id="love_2__348" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31fd"><span class="x" id="love_2__349" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.596a">I'd love her to come and live with us.</span></span></span><span class="x-g" id="love_2__352" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31fc"> <span class="cf" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31fb" id="love_2__353"><span class="exp" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31fa" id="love_2__354">love</span> something</span> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f9" resource="recx" id="love_2__355"><span class="x" dialog="y" id="love_2__356" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.596d">‘Cigarette?’ ‘I'd love one, but I've just given up.’</span></span></span></span><span class="snippet"><span class="collapse" title="Oxford Collocations Dictionary"><span class="unbox" unbox="colloc_snip"> <span class="heading">Oxford Collocations Dictionary</span><span class="body"><span class="shcut-g"> <span class="shcut">adverb</span><span class="unsn-g"><span class="coll-gs"><span class="coll-g"><span class="coll">dearly</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">deeply</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">passionately</span></span><span class="sep">,</span> <span class="coll-g"><span class="coll">…</span></span></span></span></span><span class="xr-gs" xref_type="external"> <span class="prefix">See</span> <a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/collocations/love_2" title="full entry definition in Collocations +&#10; "><span class="xr-g" dpsref="uc0ec231edbf4e81b.423ca8c8.15b1ad2ed6a.-6461" resource="collocations"><span class="xh">full entry</span></span></a></span></span></span></span></span></li></span><span class="res-g"><span class="collapse" title="Word Origin"><span class="unbox" id="love_2__359" unbox="wordorigin"> <span class="heading">Word Origin</span><span class="body" id="love_2__360"><span class="p" id="love_2__361">Old English <span class="ei" id="love_2__362">lufu</span>, of Germanic origin; from an Indo-European root shared by Sanskrit <span class="ei" psg="{tag=ff}" id="love_2__363">lubhyati</span> ‘desires’, Latin <span class="ei" psg="{tag=ff}" id="love_2__364">libet</span> ‘it is pleasing’, <span class="ei" id="love_2__365" psg="{tag=ff}">libido</span> ‘desire’, also by the noun <span class="eb" id="love_2__366" psg="{tag=xh}">leave</span> and <span class="eb" psg="{tag=xh}" id="love_2__367">lief</span>.</span></span></span></span><span class="collapse" title="Extra examples"><span class="unbox" unbox="Extra examples"><span class="heading">Extra examples</span><span class="body"><span class="x-gs" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3298" id="love_2__368"><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.3299" id="love_2__369"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.329a" id="love_2__370">Flowers are universally loved.</span></span><span class="x-g" id="love_2__371" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.329b"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.329c" id="love_2__372">He loved his wife dearly.</span></span><span class="x-g" id="love_2__373" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.329d"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.329e" id="love_2__374">He wanted to be unconditionally loved.</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.329f" id="love_2__375"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a0" id="love_2__376">I absolutely love your shoes!</span></span><span class="x-g" id="love_2__377" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a1"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a2" id="love_2__378">I personally love the song.</span></span><span class="x-g" id="love_2__379" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a3"> <span class="x" id="love_2__380" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a4">She simply loved being involved.</span></span><span class="x-g" id="love_2__381" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a5"> <span class="x" id="love_2__382" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a6">He had become a well-loved and respected member the team.</span></span><span class="x-g" id="love_2__383" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a7"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a8" id="love_2__384">I just love it when you bring me presents!</span></span><span class="x-g" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32a9" id="love_2__385"> <span class="x" id="love_2__386" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32aa">I’m loving every minute of this.</span></span><span class="x-g" id="love_2__387" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32ab"> <span class="x" dpsid="u4cdebea65f7df6b4.-4777033c.144219f65b1.32ac" id="love_2__388">You’re going to love this. They’ve changed their minds again.</span></span></span></span></span></span></span><span class="idm-gs" id="love_2__389" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f8"><span class="heading">Idioms</span> <span class="idm-g" id="love_2__390" sk="loveyouandleaveyou" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f7"><div class="top-container"><div class="top-g" id="love_2__391" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f6"><span class="idm" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f5" id="love_2__392">love you and leave you</span><div class="clear"> </div> + <div class="btn icon-left-colapse wl-add"><a id="add-to-mywordlist-link" href="https://www.oxfordlearnersdictionaries.com/mywordlist/">Add to my wordlist</a></div><a class="responsive_display_inline_on_smartphone link-right" href="#relatedentries">jump to other results</a><br/></div></div><span class="sn-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f4" id="love_2__393"><span class="sn-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f3" id="love_2__394"><span class="label-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f2" id="love_2__395"><span class="wrap">(</span><span class="reg" reg="infml" id="love_2__396" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f1">informal</span><span class="sep">,</span> <span class="reg" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31f0" reg="humor" id="love_2__397">humorous</span><span class="wrap">)</span></span> <span class="def" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ef" id="love_2__398">used to say that you must go, although you would like to stay longer</span><span class="x-gs" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ee" id="love_2__399"><span class="x-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ed" id="love_2__400"> <span class="rx-g" dpsid="u4cdebea65f7df6b4.743b4102.13cbac01393.-31ec" resource="recx" id="love_2__401"><span class="x" id="love_2__402" dpsid="u4cdebea65f7df6b4.d396464.14cb3b2f8c8.5970">Well, time to love you and leave you.</span></span></span></span></span></span></span></span></ol><span class="dictlinks"><span class="xr-gs" xref_type="external"><span class="prefix">See </span><a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/academic/love2" title="love definition in Academic English +&#10; "><span class="xr-g" resource="oldae"><span class="xh">love</span></span></a><span class="suffix"> in the Oxford Learner's Dictionary of Academic English</span></span><span class="xr-gs" xref_type="external"><span class="prefix">See </span><a class="Ref" href="https://www.oxfordlearnersdictionaries.com/definition/american_english/love_2" title="love definition in American English +&#10; "><span class="xr-g" resource="oaad"><span class="xh">love</span></span></a><span class="suffix"> in the Oxford Advanced American Dictionary</span></span></span><div class="pron-link">Check pronunciation: <a href="https://www.oxfordlearnersdictionaries.com/pronunciation/english/love_2">love</a></div></div> +</div> +<div class="responsive_row responsive_display_on_smartphone"> + <div class="responsive_entry_center_right"> <div class="social-wrap"> + <span id="plusone-box"><g:plusone size="normal" href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2" count="false"></g:plusone></span> + <a href="https://www.facebook.com/sharer.php?u=https://www.oxfordlearnersdictionaries.com/definition/english/love_2&t=love_2 verb - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com" target="_blank" class="facebook-btn" alt="share this entry on Facebook" title="share this entry on Facebook" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'facebook', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="https://twitter.com/home?status=Add+This:+https://www.oxfordlearnersdictionaries.com/definition/english/love_2" target="_blank" class="twitter-btn" alt="tweet this entry" title="tweet this entry" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'twitter', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="https://www.stumbleupon.com/submit?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_2" target="_blank" class="stumbleupon-btn" alt="share this entry on StumbleUpon" title="share this entry on StumbleUpon" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'stumbleupon', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="https://www.diigo.com/post?url=https://www.oxfordlearnersdictionaries.com/definition/english/love_2" target="_blank" class="diigo-btn" alt="share this entry on Diigo" title="share this entry on Diigo" onclick="_gaq.push(['_trackEvent', 'share_this_entry', 'diigo', 'https://www.oxfordlearnersdictionaries.com/definition/english/love_2', null, true]);"></a> + <a href="mailto:?subject=love_2 verb - Definition, pictures, pronunciation and usage notes | Oxford Advanced Learner&apos;s Dictionary at OxfordLearnersDictionaries.com&body=https://www.oxfordlearnersdictionaries.com/definition/english/love_2" alt="email this entry" title="email this entry" class="email-btn"></a> + </div> +</div> +</div> + + </div> + + <div class="responsive_hide_on_smartphone responsive_center" id="btmOthers"> + <div id='ad_btmslot_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_btmslot_a'); }); + </script> + </div> + </div> + </div> + </div> + <div id="rightcolumn" class="responsive_entry_center_right"> + +<div class="responsive_row"> +<div class="premium-box premium_english" id="otherLinksBox"> + <script type="text/javascript"> + var otherLinksFold = (document.cookie.indexOf("otherLinksFold") != -1); + if(otherLinksFold) { + var element = document.getElementById("otherLinksBox"); + element.className += ' data-fold'; + } + </script> + <div class="premium-title"> + <i class="premium-box-toggle icon"></i> + Other Links + </div> + <ul class="otherLinks"> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/get-premium/iwriter">iWriter</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/get-premium/ispeaker">iSpeaker</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/mywordlist/">My Wordlists</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/get-premium/resources">Resources</a><i class="locked" ></i></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/wordlist/">Wordlists</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/wordlist/english/oxford3000/">Oxford 3000</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/about/english/pronunciation_english">Pronunciation</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/topic/">Topics</a></li> + </ul> + </div></div> + <div id="relatedentries" class="responsive_row"> + <h4 class="no-rule">Other results</h4> + <dl class="accordion ui-grad"> + <dt>All matches</dt> + <dd> + <ul class="list-col"> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" title="love noun definition"><span class='arl1'>love <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-in" title="love-in noun definition"><span class='arl6'>love-in <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/free-love" title="free love noun definition"><span class='arl6'>free love <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-bite" title="love bite noun definition"><span class='arl6'>love bite <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-life" title="love life noun definition"><span class='arl6'>love life <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-nest" title="love nest noun definition"><span class='arl6'>love nest <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-seat" title="love seat noun definition"><span class='arl6'>love seat <pos>noun</pos></span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/self-love" title="self-love noun definition"><span class='arl6'>self-love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-child" title="love child noun definition"><span class='arl6'>love child <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-match" title="love match noun definition"><span class='arl6'>love match <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/puppy-love" title="puppy love noun definition"><span class='arl6'>puppy love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/tough-love" title="tough love noun definition"><span class='arl6'>tough love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/courtly-love" title="courtly love noun definition"><span class='arl6'>courtly love <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-affair" title="love affair noun definition"><span class='arl6'>love affair <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-handles" title="love handles noun definition"><span class='arl6'>love handles <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-letter" title="love letter noun definition"><span class='arl6'>love letter <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/i-love-lucy" title="I Love Lucy definition"><span class='arl6'>I Love Lucy</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-interest" title="love interest noun definition"><span class='arl6'>love interest <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-triangle" title="love triangle noun definition"><span class='arl6'>love triangle <pos>noun</pos></span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/tug-of-love" title="tug of love noun definition"><span class='arl6'>tug of love <pos>noun</pos></span></a> + </li> + </ul> + <a class="see-more" >See more</a> + </dd> + <dt>Idioms</dt> + <dd> + <ul class="list-col"> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1#love_1__381" title="Definition of love from in English"><span class='arl8'>love from</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/blind_1#blind_1__159" title="Definition of love is blind in English"><span class='arl8'>love is blind</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/cupboard#cupboard__77" title="Definition of cupboard love in English"><span class='arl8'>cupboard love</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1#love_1__309" title="Definition of (just) for love in English"><span class='arl8'>(just) for love</span></a> + </li> + <li > + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/labour_1#labour_1__277" title="Definition of a labour of love in English"><span class='arl8'>a labour of love</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/god#god__242" title="Definition of for the love of God in English"><span class='arl8'>for the love of God</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1#love_1__381" title="Definition of lots of love (from) in English"><span class='arl8'>lots of love (from)</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/head_1#head_1__980" title="Definition of head over heels in love in English"><span class='arl8'>head over heels in love</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1#love_1__402" title="Definition of make love (to somebody) in English"><span class='arl8'>make love (to somebody)</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/fair_1#fair_1__344" title="Definition of all’s fair in love and war in English"><span class='arl8'>all’s fair in love and war</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1#love_1__338" title="Definition of give/send my love to somebody in English"><span class='arl8'>give/send my love to somebody</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1#love_1__414" title="Definition of not for love or/nor money in English"><span class='arl8'>not for love or/nor money</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1#love_1__309" title="Definition of (just) for the love of something in English"><span class='arl8'>(just) for the love of something</span></a> + </li> + <li class='more'> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/lost#lost__211" title="Definition of there’s little/no love lost between A and B in English"><span class='arl8'>there’s little/no love lost between A and B</span></a> + </li> + </ul> + <a class="see-more">See more</a> + </dd> + </dl> + </div> + + <div class='responsive_center_on_smartphone'> + <div id='ad_houseslot1_a' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_houseslot1_a'); }); + </script> + </div> + </div> <div class="responsive_row nearby"> + <h4>Nearby words</h4> + <ul class="list-col"> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/lovage" title="Definition of lovage noun in English"><DATA class="hwd">lovage <pos>noun</pos></DATA></a> + </li> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love_1" title="Definition of love noun in English"><DATA class="hwd">love <pos>noun</pos></DATA></a> + </li> + <li> + <span> + <a class='selected' href="https://www.oxfordlearnersdictionaries.com/definition/english/love_2" title="Definition of love verb in English"><DATA class="hwd">love <pos>verb</pos></DATA></a> + </span> </li> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/love-affair" title="Definition of love affair noun in English"><DATA class="hwd">love affair <pos>noun</pos></DATA></a> + </li> + <li> + <a href="https://www.oxfordlearnersdictionaries.com/definition/english/lovebird" title="Definition of lovebird noun in English"><DATA class="hwd">lovebird <pos>noun</pos></DATA></a> + </li> + </ul> + </div> + + + <div class="responsive_row topic"> + <h4>Explore our topics</h4> + <ul class='list-col'> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/animal_homes">Animals</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/attractiveness">Body and appearance</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/business_deals">Business</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/accessories">Clothes and fashion</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/committing_crime">Crime and law</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/art_equipment">Culture</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/access_to_education">Education</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/death">Family and life stages</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/in_the_kitchen">Food and drink</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/diet">Health</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/architectural_features">Houses and buildings</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/language_skills">Language</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/american_football">Leisure</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/animal_farming">Nature</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/anger">Personality and emotions</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/elections">Religion and politics</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/cost_and_payment">Retail</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/devices">Science</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/helping_others">Social issues</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/computer_hardware">Technology</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/celebrity_news">The media</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/aircraft">Travel and tourism</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/protest">War and conflict</a> + </li> + + <li> + <a href="https://www.oxfordlearnersdictionaries.com/topic/describing_jobs">Work</a> + </li> + </ul> + </div> + + + + + + + + + + +<div class="responsive_display_on_smartphone responsive_center_on_smartphone" id="btmSmartphone"> + <div id='ad_btmslot_b' class='am-default'> + <script type='text/javascript'> + googletag.cmd.push(function() { googletag.display('ad_btmslot_b'); }); + </script> + </div> + </div> </div> + </div> + + </div> + + </div> + </div> + <div id="ox-footer" class="responsive_row oup-footer"> +<div class="responsive_container"> + + <div class="responsive_footer_top"> + <div class="responsive_center_on_smartphone"> + <div class="btn icon-left social-facebook"><a href="https://www.facebook.com/oupeltglobal">Find us on Facebook</a></div> + <div class="btn icon-left social-twitter"><a href="https://twitter.com/OUPELTGlobal">Follow us on Twitter</a></div> + <ul class='links'> + <li><a href="https://elt.oup.com/" onclick="return ! window.open(this.href);">OUP English Language Teaching</a></li> + <li><a href="https://www.oxfordlearnersbookshelf.com/home/homePage.html" onclick="return ! window.open(this.href);">Oxford Learner&apos;s Bookshelf</a></li> + </ul> + </div> + </div> + <div class="responsive_footer_bottom"> + <div class="responsive_center_on_smartphone"> + <a href="https://global.oup.com/" onclick="return ! window.open(this.href);" class="oup-logo" title="Oxford University Press"><img src="https://www.oxfordlearnersdictionaries.com/external/images/footer/logo-oup.png" title="Oxford University Press"/></a> + <div class="responsive_footer_bottom_wrap"> + <ul class='links'> + <li><a href="https://www.oxfordlearnersdictionaries.com/search_widget_info">Search Box</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/browse/">Browse Dictionaries & Grammar</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/contact-us">Contact Us</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/legal-notice">Legal Notice</a></li> + <li><a href="https://global.oup.com/privacy" onclick="return ! window.open(this.href);">Privacy Policy</a></li> + <li><a href="https://global.oup.com/cookiepolicy" onclick="return ! window.open(this.href);">Cookie Policy</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/terms-and-conditions">Terms & Conditions</a></li> + <li><a href="https://www.oxfordlearnersdictionaries.com/system-requirements">System Requirements</a></li> + <li><a href="https://elt.oup.com/accessibility" onclick="return ! window.open(this.href);">Accessibility</a></li> + </ul> + <p class="copyright">&copy; 2018 Oxford University Press</p> + </div> + <div class="versionSelector"> + <select name="lang" id="headerVersion" title="Select language"> + <option + selected="selected" name="uk" + value="https://www.oxfordlearnersdictionaries.com/definition/english/love_2">English (UK)</option> + <option + name="us" + value="https://www.oxfordlearnersdictionaries.com/us/definition/english/love_2">English (US)</option> + </select> + </div> + </div> + </div> + +</div> +</div> + + + + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/common.js?version=1.6.27"></script> + <script language="javascript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/doubleclick.js?version=1.6.27"></script> + + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/oxford.js?version=1.6.27"></script> + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/entry.js?version=1.6.27"></script> + <script language="JavaScript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/jquery.lightbox-0.5.min.js?version=1.6.27"></script> + <script language="javascript" type="text/javascript"> + + $(document).ready(function() { setupDoubleClick('https://www.oxfordlearnersdictionaries.com/', 'english', false, 'main-container', null, null, null); }); + $('img.over').each(function(){ + var t=$(this); + var src1= t.attr('src'); // initial src + var newSrc = src1.substring(0, src1.lastIndexOf('.')); // let's get file name without extension + t.hover(function(){ + $(this).attr('src', newSrc+ '-over.' + /[^.]+$/.exec(src1)); //last part is for extension + }, function(){ + $(this).attr('src', newSrc + '.' + /[^.]+$/.exec(src1)); //removing '-over' from the name + }); + }); + </script> + <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> + + <script language="javascript" type="text/javascript" src="https://www.oxfordlearnersdictionaries.com/external/scripts/responsive.js?version=1.6.27"></script> + <script type='text/javascript'> + $(document).ready(function() { + for(var i = 0; i<arrayFn.length;i++){ + arrayFn[i].call(); + } + }); + </script> + <script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-13175707-1', + { + 'siteSpeedSampleRate': 10 + }); + ga('send', 'pageview'); +</script> + + <script type="text/javascript">_qoptions={ qacct:"p-cfSla1Cke_iBQ" };</script> + <script type="text/javascript" src="https://secure.quantserve.com/quant.js"></script> + <noscript><img src="https://pixel.quantserve.com/pixel/p-cfSla1Cke_iBQ.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></noscript> + +</body> +</html>
feat
add oald
6f11d4688fb21e369abdf314dcdc3030b520a66f
2018-08-28 13:30:40
CRIMX
refactor(dicts): update dict names
false
diff --git a/src/components/dictionaries/cobuild/_locales.json b/src/components/dictionaries/cobuild/_locales.json index 1eea4bc76..6d414d8c7 100644 --- a/src/components/dictionaries/cobuild/_locales.json +++ b/src/components/dictionaries/cobuild/_locales.json @@ -1,8 +1,8 @@ { "name": { "en": "COBUILD", - "zh_CN": "COBUILD", - "zh_TW": "COBUILD" + "zh_CN": "柯林斯高阶英语学习词典", + "zh_TW": "柯林斯高階英語學習詞典" }, "options": { "sentence": { diff --git a/src/components/dictionaries/oald/_locales.json b/src/components/dictionaries/oald/_locales.json index 923596233..979f56591 100644 --- a/src/components/dictionaries/oald/_locales.json +++ b/src/components/dictionaries/oald/_locales.json @@ -1,8 +1,8 @@ { "name": { "en": "OALD", - "zh_CN": "OALD", - "zh_TW": "OALD" + "zh_CN": "牛津高阶英语词典", + "zh_TW": "牛津高階英語詞典" }, "options": { "related": {
refactor
update dict names
e05354530900e7a9c51b1c9c60675ccc8ded8f3b
2019-04-17 20:40:59
CRIMX
chore(release): 6.28.1
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index e9c9e75a8..c5e916bbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.28.1"></a> +## [6.28.1](https://github.com/crimx/ext-saladict/compare/v6.28.0...v6.28.1) (2019-04-17) + + +### Bug Fixes + +* add z-index to google page translate elements ([38b08e5](https://github.com/crimx/ext-saladict/commit/38b08e5)) + + + <a name="6.28.0"></a> # [6.28.0](https://github.com/crimx/ext-saladict/compare/v6.27.8...v6.28.0) (2019-04-17) diff --git a/package.json b/package.json index 6be0add28..e2a2d9d94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.28.0", + "version": "6.28.1", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.28.1
38b08e56bffe6b717396d56808f941686ff87d83
2019-04-17 20:40:33
CRIMX
fix: add z-index to google page translate elements
false
diff --git a/public/static/google-page-trans.js b/public/static/google-page-trans.js index 28cdee81e..8ca0c06eb 100644 --- a/public/static/google-page-trans.js +++ b/public/static/google-page-trans.js @@ -68,5 +68,18 @@ ;(document.head || document.body).appendChild($main); }()); `; + + const $style = document.createElement('style'); + $style.innerHTML = ` + #google_translate_element { + position: relative; + z-index: 2147483647; + } + .goog-te-banner-frame { + z-index: 2147483647; + } + `; + ;(document.head || document.body).appendChild($script); + ;(document.head || document.body).appendChild($style); }());
fix
add z-index to google page translate elements
9e8c3f0415be233056933c4724e0f4f9a7b65ff0
2019-03-18 18:18:41
CRIMX
fix(dicts): disable passive wheel events on lastest Chrome
false
diff --git a/src/components/dictionaries/cobuild/View.tsx b/src/components/dictionaries/cobuild/View.tsx index 1b3c3bf87..064e6e15b 100644 --- a/src/components/dictionaries/cobuild/View.tsx +++ b/src/components/dictionaries/cobuild/View.tsx @@ -14,26 +14,43 @@ export class DictCOBUILDCol extends React.Component<ViewPorps<COBUILDColResult>, curTab: '' } - tabWheelDebounce: any + navRef = React.createRef<HTMLDivElement>() - handleTabClick = (e: React.MouseEvent<HTMLAnchorElement>) => { - e.stopPropagation() - e.preventDefault() - this.setState({ curTab: e.currentTarget.dataset.id || '' }) - } + tabWheelDebounce: any - handleTabWheel = (e: React.WheelEvent<HTMLDivElement>) => { + handleTabWheel = (e: WheelEvent) => { e.stopPropagation() e.preventDefault() const { currentTarget, deltaY } = e clearTimeout(this.tabWheelDebounce) this.tabWheelDebounce = setTimeout(() => { - currentTarget.scrollBy({ + (currentTarget as HTMLDivElement).scrollBy({ left: deltaY > 0 ? 250 : -250, behavior: 'smooth' }) - }, 50) + }, 80) + } + + updateWheelListener = () => { + if (this.navRef.current) { + this.navRef.current.removeEventListener('wheel', this.handleTabWheel) + this.navRef.current.addEventListener('wheel', this.handleTabWheel, { passive: false }) + } + } + + handleTabClick = (e: React.MouseEvent<HTMLAnchorElement>) => { + e.stopPropagation() + e.preventDefault() + this.setState({ curTab: e.currentTarget.dataset.id || '' }) + } + + componentDidMount () { + this.updateWheelListener() + } + + componentDidUpdate () { + this.updateWheelListener() } render () { @@ -48,7 +65,7 @@ export class DictCOBUILDCol extends React.Component<ViewPorps<COBUILDColResult>, <div className='dictionary'> <div className='dc'> <div className='navigation'> - <div className='tabsNavigation' onWheel={this.handleTabWheel}> + <div className='tabsNavigation' ref={this.navRef}> {result.sections.map((section, i) => ( <a key={section.id}
fix
disable passive wheel events on lastest Chrome
17c7396da94a387c3a1456e752949feff5c342f8
2019-08-20 11:52:57
crimx
refactor: add saladict helpers
false
diff --git a/src/_helpers/saladict.ts b/src/_helpers/saladict.ts new file mode 100644 index 000000000..e8c472625 --- /dev/null +++ b/src/_helpers/saladict.ts @@ -0,0 +1,17 @@ +/** Pages with the Saladict extension domain */ +export const isInternalPage = () => !!window.__SALADICT_INTERNAL_PAGE__ + +export const isOptionsPage = () => !!window.__SALADICT_OPTIONS_PAGE__ + +export const isPopupPage = () => !!window.__SALADICT_POPUP_PAGE__ + +export const isPDFPage = () => !!window.__SALADICT_PDF_PAGE__ + +export const isQuickSearchPage = () => !!window.__SALADICT_QUICK_SEARCH_PAGE__ + +/** Dict panel is in a standalone window */ +export const isStandalonePage = () => isPopupPage() || isQuickSearchPage() + +/** do not record search history on these pages */ +export const isNoSearchHistoryPage = () => + isInternalPage() && !isStandalonePage()
refactor
add saladict helpers
56990aa78cd3b4819efefc61b36a4abb0da84d27
2019-03-18 21:23:45
CRIMX
chore(release): 6.27.2
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 414d73cd9..3732199a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.27.2"></a> +## [6.27.2](https://github.com/crimx/ext-saladict/compare/v6.27.1...v6.27.2) (2019-03-18) + + +### Bug Fixes + +* fix google translate ([d8715d1](https://github.com/crimx/ext-saladict/commit/d8715d1)) +* **dicts:** disable passive wheel events on lastest Chrome ([9e8c3f0](https://github.com/crimx/ext-saladict/commit/9e8c3f0)) + + + <a name="6.27.1"></a> ## [6.27.1](https://github.com/crimx/ext-saladict/compare/v6.27.0...v6.27.1) (2019-03-17) diff --git a/package.json b/package.json index bb1269053..c8556a19c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.27.1", + "version": "6.27.2", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.27.2
0f60e9352ee835a28e9ff660cc9b4e88508ab002
2020-04-24 19:49:12
crimx
chore(release): 7.10.0
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index 146b28048..5c98a86cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,51 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [7.10.0](https://github.com/crimx/ext-saladict/compare/v7.9.3...v7.10.0) (2020-04-24) + + +### Features + +* add token settings ([df2924f](https://github.com/crimx/ext-saladict/commit/df2924f7f1a88ce50c21e6019ddf63c73f3a2ae1)) + + +### Bug Fixes + +* **context-menus:** encode selection text ([0da9e84](https://github.com/crimx/ext-saladict/commit/0da9e84fd2c5805d66af637f8977340408b2d21a)) +* **context-menus:** load locale ([e1981b1](https://github.com/crimx/ext-saladict/commit/e1981b145680a7b2fbce86be5a93e50e0266beac)) +* **googledict:** audio link ([407fa9b](https://github.com/crimx/ext-saladict/commit/407fa9b669800bde3ccc29b217e8515d810f022d)) +* **i18n:** make ready changes every time ([2a03730](https://github.com/crimx/ext-saladict/commit/2a0373045d343c77782ca327bce3d6bdf40b7c0c)) +* **i18n:** proper init language without reloading ([bca03cb](https://github.com/crimx/ext-saladict/commit/bca03cb2f3c0d3fb7258b594e69661512606877d)) +* **options:** avoid stale values ([d98b53a](https://github.com/crimx/ext-saladict/commit/d98b53a7973edca8da7274f7fc774da532e30e5e)) +* **options:** layout adjustment ([84496e6](https://github.com/crimx/ext-saladict/commit/84496e698cba7656ea0a46b8dd959fee00f1faaf)) +* **options:** make data immutable ([fc967db](https://github.com/crimx/ext-saladict/commit/fc967db6cb3eed729c9bb3dfd1b3ba9545d0c917)) +* **options:** only get values from item name ([fea31ab](https://github.com/crimx/ext-saladict/commit/fea31abd5ade22c9ff44a0a8115519a5586ff1c3)) +* **options:** reduce re-rendering of the whole form ([02f61a9](https://github.com/crimx/ext-saladict/commit/02f61a9105b0adbf87a17b4170e6522bcc5de370)) +* **options:** rerender error boundary on entry change ([7450057](https://github.com/crimx/ext-saladict/commit/7450057896ce10bd52f5c0602353e2532563d999)) +* **options:** search words on options page ([4bfc211](https://github.com/crimx/ext-saladict/commit/4bfc211d26286d71b178ffcecf9145d7ec222b15)) +* **panel:** correct standalone position on multi-screen ([f2f152f](https://github.com/crimx/ext-saladict/commit/f2f152ff604260e6e65a05b7dfea7d84f8d07e96)) +* **panel:** disable external style reset on standalone panel ([c2f26be](https://github.com/crimx/ext-saladict/commit/c2f26bec4ae533b3f22610fe5ce7ad722e15d446)) +* **panel:** hide external divs ([d584e31](https://github.com/crimx/ext-saladict/commit/d584e313e4cbf6370a8d8c397ce32f4fb9659976)), closes [#703](https://github.com/crimx/ext-saladict/issues/703) +* **panel:** more robust dargging ([e5a876b](https://github.com/crimx/ext-saladict/commit/e5a876b5475e29538874834ed985cde21a7a5ae2)), closes [#747](https://github.com/crimx/ext-saladict/issues/747) +* **panel:** mta font size ([0b261fd](https://github.com/crimx/ext-saladict/commit/0b261fd23d9ea9512ffc59d3adafdd14967b69c7)), closes [#721](https://github.com/crimx/ext-saladict/issues/721) +* **panel:** profiles float box ([7b59fb3](https://github.com/crimx/ext-saladict/commit/7b59fb3246bca4c99acd8129ddb981c913affd56)) +* **pdf:** update pdf script ([f419402](https://github.com/crimx/ext-saladict/commit/f419402bfe96e9759076f865c0ea813a8dc011d1)) +* **selection:** instant selection ([85d43a0](https://github.com/crimx/ext-saladict/commit/85d43a0a03519985828362c99556719c86761f84)), closes [#742](https://github.com/crimx/ext-saladict/issues/742) +* **sync-services:** ignore word addition from sync services ([685cd02](https://github.com/crimx/ext-saladict/commit/685cd02e09adb11bf508ef9ae3033d4d4591763c)), closes [#717](https://github.com/crimx/ext-saladict/issues/717) +* content style origin ([230275d](https://github.com/crimx/ext-saladict/commit/230275d5db56e65de9570d27d62ceed1f0618a32)) + + +### Build System + +* better chunk naming for dict favicons ([d1f65fd](https://github.com/crimx/ext-saladict/commit/d1f65fde14b23992ce7a1969a0a3b778a4caef70)) +* control split chunks ([858ea64](https://github.com/crimx/ext-saladict/commit/858ea644d19016218b2b4481fbd63e80e8345f65)) +* fix dotenv ([07c7fc6](https://github.com/crimx/ext-saladict/commit/07c7fc6b78c1acc84607a0946775d2332f875ffb)) + + +### Tests + +* **panel:** update storybook ([657da12](https://github.com/crimx/ext-saladict/commit/657da12dd418a99a5d13f83158ed9f1d51fe3c33)) + ### [7.9.3](https://github.com/crimx/ext-saladict/compare/v7.9.2...v7.9.3) (2020-03-19) diff --git a/package.json b/package.json index 82e3719ec..c5a94fc22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "7.9.3", + "version": "7.10.0", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
7.10.0
7d9020ac8f18089a09ba1935ef009613fd55c503
2020-02-03 14:25:12
crimx
chore: add edge target
false
diff --git a/src/manifest/edge.manifest.json b/src/manifest/edge.manifest.json new file mode 100644 index 000000000..3f9c579bb --- /dev/null +++ b/src/manifest/edge.manifest.json @@ -0,0 +1,10 @@ +{ + "background": { + "persistent": true + }, + "options_ui": { + "chrome_style": false + }, + "incognito": "split", + "update_url": "https://edge.microsoft.com/extensionwebstorebase/v1/crx" +}
chore
add edge target
8f0314237393861455dc9b45f91f68834033bccf
2019-08-22 18:52:07
crimx
build: remove style loader on development
false
diff --git a/.neutrinorc.js b/.neutrinorc.js index 8b460c16f..d876f00ff 100644 --- a/.neutrinorc.js +++ b/.neutrinorc.js @@ -12,7 +12,8 @@ module.exports = { type: 'content_scripts', manifest: { matches: ['<all_urls>'] - } + }, + setup: 'content/__fake__/env.ts' } }, @@ -137,7 +138,7 @@ module.exports = { .rule('style') .oneOf('normal') .uses.values() - .filter(rule => rule.name !== 'extract') + .filter(rule => !/^(extract|style)$/.test(rule.name)) .forEach(rule => { shadowStyleRules .use(rule.name)
build
remove style loader on development
972a9aad532ee4ad425a4c777d19c609b0dc2835
2019-10-23 17:43:16
crimx
fix(selection): get page info on selection
false
diff --git a/src/selection/helper.ts b/src/selection/helper.ts index c8ed6a1f4..b396bd664 100644 --- a/src/selection/helper.ts +++ b/src/selection/helper.ts @@ -1,7 +1,8 @@ import { AppConfig } from '@/app-config' import { Observable, fromEvent, merge, of } from 'rxjs' import { map, mapTo, filter, distinctUntilChanged } from 'rxjs/operators' -import { newWord } from '@/_helpers/record-manager' +import { newWord, Word } from '@/_helpers/record-manager' +import { message } from '@/_helpers/browser-api' const isMac = /mac/i.test(navigator.platform) @@ -69,11 +70,21 @@ export function isBlacklisted(config: AppConfig): boolean { ) } -export const newSelectionWord: typeof newWord = (word = {}) => { +export async function newSelectionWord( + word: Partial<Word> = {} +): Promise<Word> { + const info = await message.send<'PAGE_INFO'>({ type: 'PAGE_INFO' }) + window.faviconURL = info.faviconURL + if (info.pageTitle) { + window.pageTitle = info.pageTitle + } + if (info.pageURL) { + window.pageURL = info.pageURL + } return newWord({ - title: window.pageTitle || document.title || '', - url: window.pageURL || document.URL || '', - favicon: window.faviconURL || '', + title: info.pageTitle || document.title || '', + url: info.pageURL || document.URL || '', + favicon: info.faviconURL || '', ...word }) } diff --git a/src/selection/index.ts b/src/selection/index.ts index cb4733f44..4ef9c2ae5 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -37,12 +37,10 @@ if (!window.__SALADICT_SELECTION_LOADED__) { message.addListener('PRELOAD_SELECTION', () => { const text = getText() if (text) { - return Promise.resolve( - newSelectionWord({ - text, - context: getSentence() - }) - ) + return newSelectionWord({ + text, + context: getSentence() + }) } }) @@ -50,7 +48,7 @@ if (!window.__SALADICT_SELECTION_LOADED__) { * Manualy emit selection * Beware that this is run on every frame. */ - message.createStream('EMIT_SELECTION').subscribe(() => { + message.createStream('EMIT_SELECTION').subscribe(async () => { const selection = window.getSelection() if (selection) { const text = getTextFromSelection(selection) @@ -61,7 +59,7 @@ if (!window.__SALADICT_SELECTION_LOADED__) { mouseY: rect.top, instant: true, self: isInDictPanel(selection.anchorNode), - word: newSelectionWord({ + word: await newSelectionWord({ text, context: getSentenceFromSelection(selection) }), @@ -89,7 +87,7 @@ if (!window.__SALADICT_SELECTION_LOADED__) { message.self.send({ type: 'TRIPLE_CTRL' }) }) - config$$.pipe(switchMap(createSelectTextStream)).subscribe(result => { + config$$.pipe(switchMap(createSelectTextStream)).subscribe(async result => { if (result.word) { sendMessage({ dbClick: false, @@ -99,7 +97,8 @@ if (!window.__SALADICT_SELECTION_LOADED__) { self: false, instant: false, force: false, - ...result + ...result, + word: await newSelectionWord(result.word) }) } else { sendEmptyMessage(result.self) @@ -108,9 +107,9 @@ if (!window.__SALADICT_SELECTION_LOADED__) { config$$ .pipe(switchMap(createIntantCaptureStream)) - .subscribe(({ word, event, self }) => { + .subscribe(async ({ word, event, self }) => { sendMessage({ - word, + word: await newSelectionWord(word), shiftKey: event.shiftKey, ctrlKey: event.ctrlKey, metaKey: event.metaKey, diff --git a/src/selection/instant-capture.ts b/src/selection/instant-capture.ts index d0b3e15ad..719bc439a 100644 --- a/src/selection/instant-capture.ts +++ b/src/selection/instant-capture.ts @@ -5,7 +5,6 @@ import { import { AppConfig } from '@/app-config' import { isStandalonePage, isInDictPanel } from '@/_helpers/saladict' import { checkSupportedLangs } from '@/_helpers/lang-check' -import { Word } from '@/_helpers/record-manager' import { message } from '@/_helpers/browser-api' import { fromEvent, merge, of, timer, combineLatest, empty, from } from 'rxjs' @@ -19,7 +18,6 @@ import { pluck, startWith } from 'rxjs/operators' -import { newSelectionWord } from './helper' /** * Create an instant capture Observable @@ -91,7 +89,7 @@ export function createIntantCaptureStream(config: AppConfig | null) { }), map(obj => obj && { word: getCursorWord(obj.event), ...obj }), filter((obj): obj is { - word: Word + word: { text: string; context: string } event: MouseEvent config: AppConfig self: boolean @@ -108,7 +106,9 @@ export function createIntantCaptureStream(config: AppConfig | null) { ) } -function getCursorWord(event: MouseEvent): Word | null { +function getCursorWord( + event: MouseEvent +): { text: string; context: string } | null { const x = event.clientX const y = event.clientY @@ -176,7 +176,7 @@ function getCursorWord(event: MouseEvent): Word | null { } range.detach() - return text ? newSelectionWord({ text, context }) : null + return text ? { text, context } : null } return null diff --git a/src/selection/select-text.ts b/src/selection/select-text.ts index d51ef0590..18453d858 100644 --- a/src/selection/select-text.ts +++ b/src/selection/select-text.ts @@ -96,10 +96,10 @@ function withTouchMode(config: AppConfig) { if (isWithMouse) { return { - word: newSelectionWord({ + word: { text, context: getSentenceFromSelection(selection) - }), + }, self, dbClick: clickPeriodCount >= 2, mouseX: mouseup.clientX, @@ -123,10 +123,10 @@ function withTouchMode(config: AppConfig) { } return { - word: newSelectionWord({ + word: { text, context: getSentenceFromSelection(selection) - }), + }, self, dbClick: clickPeriodCount >= 2, mouseX: rect.right, @@ -193,10 +193,10 @@ function withoutTouchMode(config: AppConfig) { } return { - word: newSelectionWord({ + word: { text, context: getSentenceFromSelection(selection) - }), + }, self: false, dbClick: clickPeriodCount >= 2, mouseX: mouseup.clientX, @@ -276,10 +276,10 @@ export function useInPanelSelect( return checkSupportedLangs(language, text) ? { - word: newSelectionWord({ + word: { text, context: getSentenceFromSelection(selection) - }), + }, dbClick: clickPeriodCount >= 2, mouseX: mouseup.clientX, mouseY: mouseup.clientY, @@ -315,7 +315,12 @@ export function useInPanelSelect( ) ) - useSubscription(output$, newSelection) + useSubscription(output$, async result => { + if (result.word) { + result.word = await newSelectionWord(result.word) + } + newSelection(result as Message<'SELECTION'>['payload']) + }) return onMouseUp } diff --git a/src/typings/message.ts b/src/typings/message.ts index 6bf82061f..0e7069fca 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -2,7 +2,13 @@ import { Word, DBArea } from '@/_helpers/record-manager' import { DictID } from '@/app-config' import { DictSearchResult } from '@/components/dictionaries/helpers' -export type MessageConfig = { +type MessageConfigType< + T extends { + [type in string]: { [key in 'payload' | 'response']?: any } + } +> = T + +export type MessageConfig = MessageConfigType<{ /* ------------------------------------------------ *\ Backend - From other pages to background script \* ------------------------------------------------ */ @@ -326,7 +332,7 @@ export type MessageConfig = { payload: any response: any } -} +}> export type MsgType = keyof MessageConfig
fix
get page info on selection
c81e6a1f4839502227f920c830a28a8b712de2d5
2020-04-20 09:41:51
crimx
ci: remove agnostic tests
false
diff --git a/.travis.yml b/.travis.yml index 96510cbbe..0168d4191 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,5 @@ node_js: script: - yarn lint - yarn build - - yarn test + # remove agnostic tests + - yarn test --testPathIgnorePatterns 'components/dictionaries'
ci
remove agnostic tests
1fb55e83b58354e8449ed0b6353e591f4c47e779
2020-05-30 20:51:13
crimx
test(sync-services): add Anki Connect
false
diff --git a/test/specs/background/sync-manager/services/ankiconnect.spec.ts b/test/specs/background/sync-manager/services/ankiconnect.spec.ts new file mode 100644 index 000000000..e3b7ae386 --- /dev/null +++ b/test/specs/background/sync-manager/services/ankiconnect.spec.ts @@ -0,0 +1,142 @@ +import axios from 'axios' +import AxiosMockAdapter from 'axios-mock-adapter' +// import * as helpersMock from '@/background/sync-manager/__mocks__/helpers' +// import { NotebookFile } from '@/background/sync-manager/interface' +import { + Service + // SyncConfig +} from '@/background/sync-manager/services/ankiconnect' +// import { Word, newWord } from '@/_helpers/record-manager' + +jest.mock('@/background/sync-manager/helpers') + +// const helpers: typeof helpersMock = require('@/background/sync-manager/helpers') + +describe('Sync service Anki Connect', () => { + const axiosMock = new AxiosMockAdapter(axios) + + const mockRequest = (handler: (data: any) => any[]) => + axiosMock.onPost().reply(config => { + try { + return handler(JSON.parse(config.data)) + } catch (e) {} + return [404] + }) + + afterAll(() => { + axiosMock.restore() + }) + + beforeEach(() => { + jest.clearAllMocks() + axiosMock.reset() + axiosMock.onAny().reply(404) + }) + + describe('init', () => { + it('should warn if Anki Connect is not running.', async () => { + const config = Service.getDefaultConfig() + + const service = new Service(config) + service.addWord = jest.fn(async () => null) + + let error: Error | undefined + try { + await service.init() + } catch (e) { + error = e + } + + expect(service.addWord).toHaveBeenCalledTimes(0) + expect(error?.message).toBe('server') + }) + + it('should warn if deck does not exist in Anki.', async () => { + const config = Service.getDefaultConfig() + + mockRequest(data => { + switch (data.action) { + case 'version': + return [200, { result: 6, error: null }] + case 'deckNames': + return [200, { result: [], error: null }] + default: + return [404] + } + }) + + const service = new Service(config) + service.addWord = jest.fn(async () => null) + + let error: Error | undefined + try { + await service.init() + } catch (e) { + error = e + } + + expect(service.addWord).toHaveBeenCalledTimes(0) + expect(error?.message).toBe('deck') + }) + + it('should warn if note type does not exist in Anki.', async () => { + const config = Service.getDefaultConfig() + + mockRequest(data => { + switch (data.action) { + case 'version': + return [200, { result: 6, error: null }] + case 'deckNames': + return [200, { result: [config.deckName], error: null }] + case 'modelNames': + return [200, { result: [], error: null }] + default: + return [404] + } + }) + + const service = new Service(config) + service.addWord = jest.fn(async () => null) + + let error: Error | undefined + try { + await service.init() + } catch (e) { + error = e + } + + expect(service.addWord).toHaveBeenCalledTimes(0) + expect(error?.message).toBe('notetype') + }) + + it('should init successfully', async () => { + const config = Service.getDefaultConfig() + + mockRequest(data => { + switch (data.action) { + case 'version': + return [200, { result: 6, error: null }] + case 'deckNames': + return [200, { result: [config.deckName], error: null }] + case 'modelNames': + return [200, { result: [config.noteType], error: null }] + default: + return [404] + } + }) + + const service = new Service(config) + service.addWord = jest.fn(async () => null) + + let error: Error | undefined + try { + await service.init() + } catch (e) { + error = e + } + + expect(service.addWord).toHaveBeenCalledTimes(0) + expect(error).toBeUndefined() + }) + }) +})
test
add Anki Connect
87c98b53dabd4a368f4cee10e4b363906991c01f
2018-05-05 17:56:19
CRIMX
refactor(options): intergrate legacy options page
false
diff --git a/src/options/Coffee.vue b/src/options/Coffee.vue index a2140bb53..f9de2dfe7 100644 --- a/src/options/Coffee.vue +++ b/src/options/Coffee.vue @@ -1,6 +1,6 @@ <template> <div> - <div class="buy-me-coffee" @click="showPayment = !showPayment" :title="i18n('buy_me_a_coffee')"> + <div class="buy-me-coffee" @click="showPayment = !showPayment" :title="$t('opt:buy_me_a_coffee')"> <svg width="80" height="80" viewBox="0 0 32.273 37.388" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com"> <g transform="translate(-1.158 6.833) scale(1.01513)"> <path d="M28.595 8.638c0 .073-.017.146-.052.218l-.84 3.15c2.255.007 4.077.746 4.63 2.49.89 2.8-1.832 7.137-5.805 8.4-.615.195-1.23.33-1.83.408l-1.24 4.653h-.056c.002.012.003.025.003.037 0 .84-3.72 1.52-8.31 1.52-4.587 0-8.307-.68-8.307-1.52 0-.023.002-.047.008-.07L1.714 8.834c-.028-.065-.042-.13-.042-.196 0-1.36 6.027-2.462 13.462-2.462 7.434 0 13.46 1.102 13.46 2.462zm-1.214 4.58l-2.42 9.095c.283-.06.57-.135.858-.227 3.342-1.062 5.592-4.724 4.844-7.08-.454-1.428-1.658-1.885-3.28-1.787z" fill="#EDEDED" style="fill:#fff"/> @@ -18,21 +18,21 @@ <div class="payment-panel" v-if="showPayment"> <div class="payment-aside"> <ul class="payment-tabs"> - <li class="payment-item" :class="{active: active === 'wechat'}" @mouseover="active = 'wechat'"><img class="payment-icon icon-wechat" src="./assets/wechat.svg">{{ i18n('wechat') }}</li> - <li class="payment-item" :class="{active: active === 'alipay'}" @mouseover="active = 'alipay'"><img class="payment-icon icon-alipay" src="./assets/alipay.svg">{{ i18n('alipay') }}</li> + <li class="payment-item" :class="{active: active === 'wechat'}" @mouseover="active = 'wechat'"><img class="payment-icon icon-wechat" src="./assets/wechat.svg">{{ $t('opt:wechat') }}</li> + <li class="payment-item" :class="{active: active === 'alipay'}" @mouseover="active = 'alipay'"><img class="payment-icon icon-alipay" src="./assets/alipay.svg">{{ $t('opt:alipay') }}</li> <li class="payment-item" :class="{active: active === 'paypal'}" @mouseover="active = 'paypal'"><img class="payment-icon icon-paypal" src="./assets/ko-fi.svg">PayPal</li> - <li class="payment-item disabled"><img class="payment-icon icon-bitcoin" src="./assets/bitcoin.svg">{{ i18n('bitcoin') }}</li> + <li class="payment-item disabled"><img class="payment-icon icon-bitcoin" src="./assets/bitcoin.svg">{{ $t('opt:bitcoin') }}</li> </ul> <div> <p class="coffee-social-media-wrap"> - <a href="mailto:[email protected]" @mouseover="isShowSocial = true" @click.prevent="void 0">{{ i18n('cantact_author') }}</a> + <a href="mailto:[email protected]" @mouseover="isShowSocial = true" @click.prevent="void 0">{{ $t('opt:contact_author') }}</a> <transition name="fade"> <div class="coffee-social-media" v-if="isShowSocial" @mouseleave="isShowSocial = false"> <social-media /> </div> </transition> </p> - <p><a href="https://github.com/crimx/crx-saladict/issues" target="_blank" rel="noopener">{{ i18n('report_issue') }}</a></p> + <p><a href="https://github.com/crimx/crx-saladict/issues" target="_blank" rel="noopener">{{ $t('opt:report_issue') }}</a></p> </div> <div class="payment-title"> <div> @@ -58,7 +58,7 @@ </div> <div class="payment-content"> <transition name="fade"> - <div class="payment-pane" key="wechat" v-if="active === 'wechat'"><img src="./assets/qrcode/wechat.png" alt="wechat qrcode"><p><small>{{ i18n('buy_me_a_coffee') }}</small></p></div> + <div class="payment-pane" key="wechat" v-if="active === 'wechat'"><img src="./assets/qrcode/wechat.png" alt="wechat qrcode"><p><small>{{ $t('opt:buy_me_a_coffee') }}</small></p></div> <div class="payment-pane" key="alipay" v-else-if="active === 'alipay'"><img src="./assets/qrcode/alipay.png" alt="alipay qrcode"><p> </p></div> <div class="payment-pane" key="paypal" v-else-if="active === 'paypal'"><img src="./assets/qrcode/ko-fi.png" alt="ko-fi qrcode"><p><a href="https://ko-fi.com/crimxcoffee" target="_blank">https://ko-fi.com/crimxcoffee</a></p></div> <div class="payment-pane" key="bitcoin" v-else-if="active === 'bitcoin'"><img src="./assets/qrcode/bitcoin.png" alt="bitcoin qrcode"><p><small>1LkSPTYg3xFTZp39XxQJHqA77rskkENDyX</small></p></div> @@ -86,9 +86,6 @@ export default { eggClicked () { browser.storage.sync.set({unlock: true}) }, - i18n (key) { - return browser.i18n.getMessage(key) || key - } }, components: { SocialMedia diff --git a/src/options/OptAppActive.vue b/src/options/OptAppActive.vue index b0a5a7583..133f2b430 100644 --- a/src/options/OptAppActive.vue +++ b/src/options/OptAppActive.vue @@ -1,20 +1,20 @@ <template> <div class="opt-item"><!-- 开启查词 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_app_active_title') }}</strong> + <strong>{{ $t('opt:app_active_title') }}</strong> </div> <div class="opt-item__body"> <div class="checkbox"> <label class="checkbox-inline"> - <input type="checkbox" v-model="active"> {{ $i18n('opt_app_active') }} + <input type="checkbox" v-model="active"> {{ $t('opt:app_active') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="pdfSniff"> {{ $i18n('opt_pdf_sniff') }} + <input type="checkbox" v-model="pdfSniff"> {{ $t('opt:pdf_sniff') }} </label> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_app_active_description')"></p> + <p class="opt-item__description" v-html="$t('opt:app_active_description')"></p> </div> </div><!-- 开启查词 --> </template> diff --git a/src/options/OptAutopron.vue b/src/options/OptAutopron.vue index cc7fce9bc..954353fe3 100644 --- a/src/options/OptAutopron.vue +++ b/src/options/OptAutopron.vue @@ -1,36 +1,36 @@ <template> <div class="opt-item"><!-- 自动发音 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_autopron_title') }}</strong> + <strong>{{ $t('opt:autopron_title') }}</strong> </div> <div class="opt-item__body"> <div class="select-box-container"> <label class="select-box"> - <span class="select-label">{{ $i18n('opt_autopron_cn') }}</span> + <span class="select-label">{{ $t('opt:autopron_cn') }}</span> <select class="form-control" v-model="autopron.cn.dict"> - <option value="">{{ $i18n('opt_none') }}</option> - <option v-for="id in autopron.cn.list" :value="id">{{ $i18n('dict_' + id) }}</option> + <option value="">{{ $t('opt:none') }}</option> + <option v-for="id in autopron.cn.list" :value="id">{{ $t('dict:' + id) }}</option> </select> </label> <label class="select-box"> - <span class="select-label">{{ $i18n('opt_autopron_en') }}</span> + <span class="select-label">{{ $t('opt:autopron_en') }}</span> <select class="form-control" v-model="autopron.en.dict"> - <option value="">{{ $i18n('opt_none') }}</option> - <option v-for="id in autopron.en.list" :value="id">{{ $i18n('dict_' + id) }}</option> + <option value="">{{ $t('opt:none') }}</option> + <option v-for="id in autopron.en.list" :value="id">{{ $t('dict:' + id) }}</option> </select> </label> <span :style="{transition: 'opacity 0.4s', opacity: autopron.en.dict ? '1' : '0'}"> <label class="radio-inline"> - <input type="radio" value="uk" v-model="autopron.en.accent"> {{ $i18n('opt_autopron_uk') }} + <input type="radio" value="uk" v-model="autopron.en.accent"> {{ $t('opt:autopron_uk') }} </label> <label class="radio-inline"> - <input type="radio" value="us" v-model="autopron.en.accent"> {{ $i18n('opt_autopron_us') }} + <input type="radio" value="us" v-model="autopron.en.accent"> {{ $t('opt:autopron_us') }} </label> </span> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_autopron_description')"></p> + <p class="opt-item__description" v-html="$t('opt:autopron_description')"></p> </div> </div><!-- 自动发音 --> </template> diff --git a/src/options/OptContextMenu.vue b/src/options/OptContextMenu.vue index 4f9eb3ae4..121581d8b 100644 --- a/src/options/OptContextMenu.vue +++ b/src/options/OptContextMenu.vue @@ -1,14 +1,14 @@ <template> <div class="opt-item"><!-- 右键菜单 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_context_title') }}</strong> + <strong>{{ $t('opt:context_title') }}</strong> </div> <div class="opt-item__body"> <header class="panel-list__add"> <button type="button" class="btn btn-default btn-xs" v-if="contextUnselected.length > 0" @click="isShowAddContextPanel = true" - >{{ $i18n('opt_dicts_btn_add') }}</button> + >{{ $t('opt:dicts_btn_add') }}</button> <!--Modal 未选择右键菜单列表--> <transition name="fade"> @@ -17,14 +17,14 @@ <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" @click="isShowAddContextPanel = false">&times;</button> - <h4 class="modal-title">{{ $i18n('opt_context_add_panel_title') }}</h4> + <h4 class="modal-title">{{ $t('opt:context_add_panel_title') }}</h4> </div> <div class="modal-body"> <div class="panel-group"> <transition-group name="panel-list"> <div class="panel-list panel panel-default" v-for="(id, i) in contextUnselected" :key="id"> <div class="panel-list__header" @click="handleAddContext(id)"> - <strong class="panel-list__title">{{ $i18n('context_' + id) }}</strong> + <strong class="panel-list__title">{{ $t('ctx:' + id) }}</strong> <button type="button" class="close">&#10004;</button> </div> </div> @@ -43,7 +43,7 @@ <transition-group name="panel-list"> <div class="panel-list panel panel-default" v-for="(id, i) in contextMenu.selected" :key="id"> <div class="panel-list__header"> - <strong class="panel-list__title">{{ $i18n('context_' + id) }}</strong> + <strong class="panel-list__title">{{ $t('ctx:' + id) }}</strong> <button type="button" class="close" @click.stop="contextMenu.selected.splice(i, 1)">&times;</button> </div> </div> @@ -53,7 +53,7 @@ </div><!--已选择右键菜单列表--> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_context_description')"></p> + <p class="opt-item__description" v-html="$t('opt:context_description')"></p> </div> </div><!-- 右键菜单 --> </template> @@ -63,7 +63,7 @@ import Draggable from 'vuedraggable' export default { store: { - contextMenu: 'config.contextMenu', + contextMenu: 'config.contextMenus', }, data () { return { diff --git a/src/options/OptDicts.vue b/src/options/OptDicts.vue index adb6303c4..82b47076a 100644 --- a/src/options/OptDicts.vue +++ b/src/options/OptDicts.vue @@ -1,14 +1,14 @@ <template> <div class="opt-item"><!-- 词典设置 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_dicts_title') }}</strong> + <strong>{{ $t('opt:dicts_title') }}</strong> </div> <div class="opt-item__body"> <header class="panel-list__add"> <button type="button" class="btn btn-default btn-xs" v-if="dictsUnselected.length > 0" @click="isShowAddDictsPanel = true" - >{{ $i18n('opt_dicts_btn_add') }}</button> + >{{ $t('opt:dicts_btn_add') }}</button> <!--Modal 未选择词典列表--> <transition name="fade"> @@ -17,7 +17,7 @@ <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" @click="isShowAddDictsPanel = false">&times;</button> - <h4 class="modal-title">{{ $i18n('opt_dicts_add_panel_title') }}</h4> + <h4 class="modal-title">{{ $t('opt:dicts_add_panel_title') }}</h4> </div> <div class="modal-body"> <div class="panel-group"> @@ -25,7 +25,7 @@ <div class="panel panel-default panel-list" v-for="(id, i) in dictsUnselected" :key="id"> <div class="panel-list__header" @click="handleAddDict(id)"> <img class="panel-list__icon" :src="dictsPanelInfo[id].favicon"> - <strong class="panel-list__title">{{ $i18n('dict_' + id) }}</strong> + <strong class="panel-list__title">{{ $t('dict:' + id) }}</strong> <button type="button" class="close">&#10004;</button> </div> </div> @@ -46,7 +46,7 @@ <!--词典名字与图标--> <div class="panel-list__header" @click="handlePanelHeadClick(id, i)"> <img class="panel-list__icon" :src="dictsPanelInfo[id].favicon"> - <strong class="panel-list__title">{{ $i18n('dict_' + id) }}</strong> + <strong class="panel-list__title">{{ $t('dict:' + id) }}</strong> <button type="button" class="close" @click.stop="dicts.selected.splice(i, 1)">&times;</button> </div><!--词典名字与图标--> <div class="panel-list__body" ref="dict" :style="{height: dictsPanelInfo[id].height + 'px'}"> @@ -54,19 +54,19 @@ <!--词典语言选项--> <div class="checkbox"> <label class="checkbox-inline"> - <input type="checkbox" v-model="allDicts[id].defaultUnfold"> {{ $i18n('opt_dict_default_unfold') }} + <input type="checkbox" v-model="allDicts[id].defaultUnfold"> {{ $t('opt:dict_default_unfold') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="allDicts[id].showWhenLang.chs"> {{ $i18n('opt_dict_show_when_chs') }} + <input type="checkbox" v-model="allDicts[id].selectionLang.chs"> {{ $t('opt:dict_show_when_chs') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="allDicts[id].showWhenLang.eng"> {{ $i18n('opt_dict_show_when_eng') }} + <input type="checkbox" v-model="allDicts[id].selectionLang.eng"> {{ $t('opt:dict_show_when_eng') }} </label> </div><!--词典语言选项--> <!--词典默认高度选项--> <div class="input-group"> - <div class="input-group-addon">{{ $i18n('opt_dict_default_height') }}</div> + <div class="input-group-addon">{{ $t('opt:dict_default_height') }}</div> <input type="number" min="1" class="form-control" v-model.number="allDicts[id].preferredHeight"> <div class="input-group-addon">px</div> </div><!--词典默认高度选项--> @@ -76,15 +76,15 @@ <template v-for="(__, optKey) in allDicts[id].options"> <div class="checkbox" v-if="typeof allDicts[id].options[optKey] !== 'boolean'"> <div class="input-group"> - <div class="input-group-addon">{{ $i18n(`dict_${id}_${optKey}`) }}</div> + <div class="input-group-addon">{{ $t(`dict:${id}_${optKey}`) }}</div> <input type="number" min="1" class="form-control" v-model.number="allDicts[id].options[optKey]"> - <div class="input-group-addon">{{ $i18n(`dict_${id}_${optKey}_unit`) }}</div> + <div class="input-group-addon">{{ $t(`dict:${id}_${optKey}_unit`) }}</div> </div> </div> </template> <template v-for="(__, optKey) in allDicts[id].options"> <label class="checkbox-inline" v-if="typeof allDicts[id].options[optKey] === 'boolean'"> - <input type="checkbox" v-model="allDicts[id].options[optKey]"> {{ $i18n(`dict_${id}_${optKey}`) }} + <input type="checkbox" v-model="allDicts[id].options[optKey]"> {{ $t(`dict:${id}_${optKey}`) }} </label> </template> </div><!--词典自定义选项--> @@ -97,14 +97,14 @@ </div><!--已选择词典列表--> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_dicts_description')"></p> + <p class="opt-item__description" v-html="$t('opt:dicts_description')"></p> </div> </div><!-- 词典设置 --> </template> <script> import Draggable from 'vuedraggable' -import AppConfig from 'src/app-config' +import AppConfig from '@/app-config' export default { store: { @@ -151,7 +151,8 @@ export default { } }, handlePanelHeadClick (id, i) { - let height = this.dictsPanelInfo[id].height > 0 ? 0 : document.querySelector(`#dict-${id}`).offsetHeight + const el = document.querySelector(`#dict-${id}`) + let height = this.dictsPanelInfo[id].height <= 0 && el ? el.offsetHeight : 0 this.clearDictsHeight() this.dictsPanelInfo[id].height = height } diff --git a/src/options/OptLanguage.vue b/src/options/OptLanguage.vue index dbf353371..b594801ac 100644 --- a/src/options/OptLanguage.vue +++ b/src/options/OptLanguage.vue @@ -1,20 +1,20 @@ <template> <div class="opt-item"><!-- 语言支持 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_language_title') }}</strong> + <strong>{{ $t('opt:language_title') }}</strong> </div> <div class="opt-item__body"> <div class="checkbox"> <label class="checkbox-inline"> - <input type="checkbox" v-model="chinese"> {{ $i18n('opt_language_chinese') }} + <input type="checkbox" v-model="chinese"> {{ $t('opt:language_chinese') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="english"> {{ $i18n('opt_language_english') }} + <input type="checkbox" v-model="english"> {{ $t('opt:language_english') }} </label> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_language_mode_description')"></p> + <p class="opt-item__description" v-html="$t('opt:language_mode_description')"></p> </div> </div><!-- 语言支持 --> </template> diff --git a/src/options/OptMode.vue b/src/options/OptMode.vue index eda516d35..ffd2793e1 100644 --- a/src/options/OptMode.vue +++ b/src/options/OptMode.vue @@ -1,33 +1,33 @@ <template> <div class="opt-item"><!-- 查词模式--> <div class="opt-item__header"> - <strong>{{ $i18n('opt_mode_title') }}</strong> + <strong>{{ $t('opt:mode_title') }}</strong> </div> <div class="opt-item__body"> <div class="checkbox"> <label class="checkbox-inline"> - <input type="checkbox" v-model="mode.icon"> {{ $i18n('opt_mode_icon') }} + <input type="checkbox" v-model="mode.icon"> {{ $t('opt:mode_icon') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="mode.direct"> {{ $i18n('opt_mode_direct') }} + <input type="checkbox" v-model="mode.direct"> {{ $t('opt:mode_direct') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="mode.double"> {{ $i18n('opt_mode_double') }} + <input type="checkbox" v-model="mode.double"> {{ $t('opt:mode_double') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="mode.ctrl"> {{ $i18n('opt_mode_ctrl') }} + <input type="checkbox" v-model="mode.ctrl"> {{ $t('opt:mode_ctrl') }} </label> </div> <div class="double-click-delay" :style="{height: mode.double ? '44px' : '0'}"> <div class="input-group"> - <div class="input-group-addon">{{ $i18n('opt_mode_double_click_delay') }}</div> + <div class="input-group-addon">{{ $t('opt:mode_double_click_delay') }}</div> <input type="number" min="1" class="form-control" v-model.number="doubleClickDelay"> - <div class="input-group-addon">{{ $i18n('opt_unit_ms') }}</div> + <div class="input-group-addon">{{ $t('opt:unit_ms') }}</div> </div> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_mode_description')"></p> + <p class="opt-item__description" v-html="$t('opt:mode_description')"></p> </div> </div><!-- 查词模式--> </template> diff --git a/src/options/OptPinMode.vue b/src/options/OptPinMode.vue index 9b35fe1e5..42c875382 100644 --- a/src/options/OptPinMode.vue +++ b/src/options/OptPinMode.vue @@ -1,30 +1,30 @@ <template> <div class="opt-item"><!-- 钉住查词--> <div class="opt-item__header"> - <strong>{{ $i18n('opt_pinmode_title') }}</strong> + <strong>{{ $t('opt:pinmode_title') }}</strong> </div> <div class="opt-item__body"> <div class="checkbox"> <label class="checkbox-inline"> - <input type="checkbox" v-model="pinMode.direct"> {{ $i18n('opt_mode_direct') }} + <input type="checkbox" v-model="pinMode.direct"> {{ $t('opt:mode_direct') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="pinMode.double"> {{ $i18n('opt_mode_double') }} + <input type="checkbox" v-model="pinMode.double"> {{ $t('opt:mode_double') }} </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="pinMode.ctrl"> {{ $i18n('opt_mode_ctrl') }} + <input type="checkbox" v-model="pinMode.ctrl"> {{ $t('opt:mode_ctrl') }} </label> </div> <div class="double-click-delay" :style="{height: pinMode.double ? '44px' : '0'}"> <div class="input-group"> - <div class="input-group-addon">{{ $i18n('opt_mode_double_click_delay') }}</div> + <div class="input-group-addon">{{ $t('opt:mode_double_click_delay') }}</div> <input type="number" min="1" class="form-control" v-model.number="doubleClickDelay"> - <div class="input-group-addon">{{ $i18n('opt_unit_ms') }}</div> + <div class="input-group-addon">{{ $t('opt:unit_ms') }}</div> </div> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_pinmode_description')"></p> + <p class="opt-item__description" v-html="$t('opt:pinmode_description')"></p> </div> </div><!-- 钉住查词--> </template> diff --git a/src/options/OptPopup.vue b/src/options/OptPopup.vue index c21571c4f..1f8e7d028 100644 --- a/src/options/OptPopup.vue +++ b/src/options/OptPopup.vue @@ -1,25 +1,25 @@ <template> <div class="opt-item"><!-- 右上弹框 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_popup_title') }}</strong> + <strong>{{ $t('opt:popup_title') }}</strong> </div> <div class="opt-item__body"> <div class="select-box-container"> <label class="select-box"> - <span class="select-label">{{ $i18n('opt_preload') }}</span> + <span class="select-label">{{ $t('opt:preload') }}</span> <select class="form-control" v-model="baPreload"> - <option value="">{{ $i18n('opt_none') }}</option> - <option value="clipboard">{{ $i18n('opt_preload_clipboard') }}</option> - <option value="selection">{{ $i18n('opt_preload_selection') }}</option> + <option value="">{{ $t('opt:none') }}</option> + <option value="clipboard">{{ $t('opt:preload_clipboard') }}</option> + <option value="selection">{{ $t('opt:preload_selection') }}</option> </select> </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="baAuto"> {{ $i18n('opt_preload_auto') }} + <input type="checkbox" v-model="baAuto"> {{ $t('opt:preload_auto') }} </label> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_popup_description')"></p> + <p class="opt-item__description" v-html="$t('opt:popup_description')"></p> </div> </div><!-- 右上弹框 --> </template> diff --git a/src/options/OptTripleCtrl.vue b/src/options/OptTripleCtrl.vue index 4995d4994..ddddb7ae2 100644 --- a/src/options/OptTripleCtrl.vue +++ b/src/options/OptTripleCtrl.vue @@ -1,34 +1,34 @@ <template> <div class="opt-item"><!-- 快捷查词 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_triple_ctrl_title') }}</strong> + <strong>{{ $t('opt:triple_ctrl_title') }}</strong> </div> <div class="opt-item__body"> <div class="select-box-container"> <label class="select-box"> - <span class="select-label">{{ $i18n('opt_preload') }}</span> + <span class="select-label">{{ $t('opt:preload') }}</span> <select class="form-control" v-model="tripleCtrlPreload"> - <option value="">{{ $i18n('opt_none') }}</option> - <option value="clipboard">{{ $i18n('opt_preload_clipboard') }}</option> - <option value="selection">{{ $i18n('opt_preload_selection') }}</option> + <option value="">{{ $t('opt:none') }}</option> + <option value="clipboard">{{ $t('opt:preload_clipboard') }}</option> + <option value="selection">{{ $t('opt:preload_selection') }}</option> </select> </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="tripleCtrlAuto"> {{ $i18n('opt_preload_auto') }} + <input type="checkbox" v-model="tripleCtrlAuto"> {{ $t('opt:preload_auto') }} </label> <label class="select-box"> - <span class="select-label">{{ $i18n('opt_triple_ctrl_loc_title') }}</span> + <span class="select-label">{{ $t('opt:triple_ctrl_loc_title') }}</span> <select class="form-control" v-model.number="tripleCtrlLocation"> - <option v-for="n in 9" :value="n - 1">{{ $i18n(`opt_triple_ctrl_loc_${n-1}`) }}</option> + <option v-for="n in 9" :value="n - 1">{{ $t(`opt:triple_ctrl_loc_${n-1}`) }}</option> </select> </label> <label class="checkbox-inline"> - <input type="checkbox" v-model="tripleCtrl"> {{ $i18n('opt_triple_ctrl') }} + <input type="checkbox" v-model="tripleCtrl"> {{ $t('opt:triple_ctrl') }} </label> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_triple_ctrl_description')"></p> + <p class="opt-item__description" v-html="$t('opt:triple_ctrl_description')"></p> </div> </div><!-- 快捷查词 --> </template> diff --git a/src/options/OptWordList.vue b/src/options/OptWordList.vue index 0fedf061a..92cb2738a 100644 --- a/src/options/OptWordList.vue +++ b/src/options/OptWordList.vue @@ -1,20 +1,17 @@ <template> <div class="opt-item"><!-- 单词列表 --> <div class="opt-item__header"> - <strong>{{ $i18n('opt_word_list_title') }}</strong> + <strong>{{ $t('opt:word_list_title') }}</strong> </div> <div class="opt-item__body"> <div class="checkbox"> <label class="checkbox-inline"> - <input type="checkbox" v-model="searhHistory"> {{ $i18n('opt_word_list_history') }} - </label> - <label class="checkbox-inline"> - <input type="checkbox" v-model="newWordSound"> {{ $i18n('opt_word_list_notebook') }} + <input type="checkbox" v-model="searhHistory"> {{ $t('opt:word_list_history') }} </label> </div> </div> <div class="opt-item__description-wrap"> - <p class="opt-item__description" v-html="$i18n('opt_word_list_description')"></p> + <p class="opt-item__description" v-html="$t('opt:word_list_description')"></p> </div> </div><!-- 单词列表 --> </template> @@ -23,7 +20,6 @@ export default { store: { searhHistory: 'config.searhHistory', - newWordSound: 'config.newWordSound', } } </script> diff --git a/src/options/Options.vue b/src/options/Options.vue index 3ccddb6db..7b6d566c2 100644 --- a/src/options/Options.vue +++ b/src/options/Options.vue @@ -2,26 +2,26 @@ <div> <transition name="dropdown"> <div class="config-updated" v-if="isShowConfigUpdated"> - {{ $i18n('opt_storage_updated') }} + {{ $t('opt:storage_updated') }} </div> </transition> <div class="opt-container"> <div class="page-header"> - <h1>{{ $i18n('opt_title') }} - <a class="new-version" v-if="newVersionAvailable" href="http://www.crimx.com/crx-saladict/" target="_blank">{{ $i18n('opt_new_version') }}</a> + <h1>{{ $t('opt:title') }} + <a class="new-version" v-if="newVersionAvailable" href="http://www.crimx.com/crx-saladict/" target="_blank">{{ $t('opt:new_version') }}</a> </h1> <div class="page-header-info"> - <p><a href="https://github.com/crimx/crx-saladict/wiki" target="_blank" rel="noopener">{{ $i18n('instructions') }}</a></p> + <p><a href="https://github.com/crimx/crx-saladict/wiki" target="_blank" rel="noopener">{{ $t('opt:instructions') }}</a></p> <p class="page-header-social-media-wrap"> - <a href="mailto:[email protected]" @mouseover="isShowSocial = true" @click.prevent="void 0">{{ $i18n('cantact_author') }}</a> + <a href="mailto:[email protected]" @mouseover="isShowSocial = true" @click.prevent="void 0">{{ $t('opt:contact_author') }}</a> <transition name="fade"> <div class="page-header-social-media" v-if="isShowSocial" @mouseleave="isShowSocial = false"> <social-media /> </div> </transition> </p> - <p><a href="https://github.com/crimx/crx-saladict/issues" target="_blank" rel="noopener">{{ $i18n('report_issue') }}</a></p> - <button type="button" class="btn btn-default btn-reset" @click="handleReset">{{ $i18n('opt_reset') }}</button> + <p><a href="https://github.com/crimx/crx-saladict/issues" target="_blank" rel="noopener">{{ $t('opt:report_issue') }}</a></p> + <button type="button" class="btn btn-default btn-reset" @click="handleReset">{{ $t('opt:reset') }}</button> </div> </div> <opt-app-active /> @@ -57,11 +57,11 @@ </template> <script> -import {storage, message} from 'src/_helpers/browser-api' -import AppConfig from 'src/app-config' +import {storage, message} from '@/_helpers/browser-api' +import AppConfig from '@/app-config' import Coffee from './Coffee' import SocialMedia from './SocialMedia' -import AlertModal from 'src/components/AlertModal' +import AlertModal from '@/components/AlertModal' import OptAppActive from './OptAppActive' import OptWordList from './OptWordList' @@ -105,8 +105,8 @@ export default { }, handleReset () { this.$refs.alert.$emit('show', { - title: this.$i18n('opt_reset_modal_title'), - content: this.$i18n('opt_reset_modal_content'), + title: this.$t('opt:reset_modal_title'), + content: this.$t('opt:reset_modal_content'), onConfirm: () => { storage.sync.set({config: new AppConfig()}) .then(() => storage.sync.get('config')) @@ -193,7 +193,7 @@ export default { </script> <style lang="scss"> -@import "src/_sass_global/z-index"; +@import "src/_sass_global/z-indices"; /*------------------------------------*\ Bootstrap \*------------------------------------*/ diff --git a/src/options/index.html b/src/options/index.html index 28119f73d..c1f5d0be0 100644 --- a/src/options/index.html +++ b/src/options/index.html @@ -2,7 +2,7 @@ <html> <head> <meta charset="utf-8"> - <title>Saladict</title> + <title>Saladict Options</title> </head> <body> <div id="app"></div> diff --git a/src/options/index.js b/src/options/index.js index 698c86d30..65177789e 100644 --- a/src/options/index.js +++ b/src/options/index.js @@ -1,32 +1,48 @@ import Vue from 'vue' -import App from './Options' -import i18n from 'vue-plugin-webextension-i18n' +import VueI18Next from '@panter/vue-i18next' import VueStash from 'vue-stash' -import {storage} from 'src/_helpers/browser-api' -import checkUpdate from 'src/_helpers/check-update' -import AppConfig from 'src/app-config' +import App from './Options' +import { storage } from '../_helpers/browser-api' +import checkUpdate from '../_helpers/check-update' +import { appConfigFactory } from '../app-config' + +import i18next from 'i18next' +import i18nLoader from '@/_helpers/i18n' +import commonLocles from '@/_locales/common' +import dictsLocles from '@/_locales/dicts' +import optionsLocles from '@/_locales/options' +import contextLocles from '@/_locales/context' Vue.use(VueStash) -Vue.use(i18n) +Vue.use(VueI18Next) Vue.config.productionTip = false -Vue.config.devtools = false -document.title = browser.i18n.getMessage('opt_title') +// Vue.use(VueI18Next) before loading +const i18n = new VueI18Next(i18nLoader({ + common: commonLocles, + opt: optionsLocles, + dict: dictsLocles, + ctx: contextLocles, +}, 'common')) + +console.log('sddddddffffff') storage.sync.get('config') - .then(({config}) => { + .then(({ config }) => { + console.log('x') const store = { - config: config || new AppConfig(), + config: config || appConfigFactory(), unlock: false, newVersionAvailable: false } - new Vue({ // eslint-disable-line no-new + new Vue({ el: '#app', + i18n, render: h => h(App), - data: {store}, + data: { store }, created () { - storage.sync.listen('config', changes => { + storage.sync.addListener('config', changes => { let config = changes.config.newValue if (config) { // only listen to active setting in popup panel @@ -34,14 +50,14 @@ storage.sync.get('config') } }) - storage.sync.get('unlock', ({unlock}) => { + storage.sync.get('unlock', ({ unlock }) => { this.store.unlock = Boolean(unlock) - storage.sync.listen('unlock', changes => { + storage.sync.addListener('unlock', changes => { this.store.unlock = changes.unlock.newValue }) }) - checkUpdate().then(({isAvailable}) => { + checkUpdate().then(({ isAvailable }) => { this.store.newVersionAvailable = isAvailable }) }
refactor
intergrate legacy options page
633795b21ad0fb2ac0fff668556ba0937f8f70c3
2018-12-03 20:55:40
CRIMX
test: fix tabs.highlight
false
diff --git a/test/specs/_helpers/browser-api.spec.ts b/test/specs/_helpers/browser-api.spec.ts index b82d432f0..d2e8e5b35 100644 --- a/test/specs/_helpers/browser-api.spec.ts +++ b/test/specs/_helpers/browser-api.spec.ts @@ -586,13 +586,14 @@ describe('Browser API Wapper', () => { it('Existing tab', () => { browser.tabs.query.returns(Promise.resolve( [{ + windowId: 10, index: 1 }] )) return openURL(url) .then(() => { expect(browser.tabs.query.calledWith({ url })).toBeTruthy() - expect(browser.tabs.highlight.calledWith({ tabs: 1 })).toBeTruthy() + expect(browser.tabs.highlight.calledWith({ tabs: 1, windowId: 10 })).toBeTruthy() expect(browser.tabs.create.notCalled).toBeTruthy() }) })
test
fix tabs.highlight
2d7486e1aeea509fcd3ad3a7c61775cf1abeed40
2018-05-15 10:47:03
CRIMX
fix(locales): fix wording
false
diff --git a/src/_locales/options/messages.json b/src/_locales/options/messages.json index f7a8f929b..16ddad062 100644 --- a/src/_locales/options/messages.json +++ b/src/_locales/options/messages.json @@ -70,13 +70,13 @@ "en": "Use animation transitions" }, "no_type_field": { - "zh_CN": "关闭输入框划词", - "zh_TW": "關閉輸入框鼠標滑字", + "zh_CN": "关闭可编辑区域划词", + "zh_TW": "關閉可編輯區域鼠標滑字", "en": "No selection in editable regions" }, "preference_description": { - "zh_CN": "关闭过渡动画可减少资源消耗。关闭输入框划词本扩展会自动识别 Input Box、 TextArea 以及常见编辑器,如 CodeMirror 和 ACE 。", - "zh_TW": "關閉轉換動畫可減少資源消耗。關閉輸入框鼠標滑字本程式會自動識別 Input Box、 Textarea 以及常見編輯器,如 CodeMirror 和 ACE 。", + "zh_CN": "关闭过渡动画可减少资源消耗。关闭可编辑区域划词后,本扩展会自动识别输入框以及常见编辑器,如 CodeMirror 和 ACE 。", + "zh_TW": "關閉轉換動畫可減少資源消耗。關閉可編輯區域鼠標滑字后,本程式會自動識別輸入框以及常見編輯器,如 CodeMirror 和 ACE 。", "en": "Switch off animation transitions to reduce runtime cost. If selection making in editable regions is banned, the extension will identify Input Boxes, TextAreas and other common text editors like CodeMirror and ACE." }, "privacy_title": {
fix
fix wording
1aaad9dabdb7465b5b24d7166bfa97be4bd9c7c9
2024-04-02 15:49:23
Hamir Mahal
fix: outdated `caniuse-lite` (#2166)
false
diff --git a/yarn.lock b/yarn.lock index 9366e1ce..e41a8962 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4571,9 +4571,9 @@ can-use-dom@^0.1.0: integrity sha1-IsxKNKCrxDlQ9CxkEQJKP2NmtFo= caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001087, caniuse-lite@^1.0.30001093: - version "1.0.30001228" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz" - integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A== + version "1.0.30001589" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz" + integrity sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg== capture-exit@^2.0.0: version "2.0.0"
fix
outdated `caniuse-lite` (#2166)
2c315624507f79c9c44c6c3c6ec25d266fbb0f34
2020-02-13 14:32:49
crimx
fix: space escape
false
diff --git a/src/components/dictionaries/cobuild/engine.ts b/src/components/dictionaries/cobuild/engine.ts index 59845b4ab..5c0e9eba8 100644 --- a/src/components/dictionaries/cobuild/engine.ts +++ b/src/components/dictionaries/cobuild/engine.ts @@ -13,7 +13,10 @@ import { import { getStaticSpeaker } from '@/components/Speaker' export const getSrcPage: GetSrcPageFunction = text => { - return `https://www.collinsdictionary.com/dictionary/english/${text}` + return ( + `https://www.collinsdictionary.com/dictionary/english/` + + encodeURIComponent(text.replace(/\s+/g, '-')) + ) } export interface COBUILDCibaResult { @@ -48,7 +51,7 @@ export const search: SearchFunction<COBUILDResult> = ( profile, payload ) => { - text = encodeURIComponent(text.replace(/\s+/g, ' ')) + text = encodeURIComponent(text.replace(/\s+/g, '-')) const isChz = config.langCode === 'zh-TW' const { options } = profile.dicts.all.cobuild const sources:
fix
space escape
8777470e14fa90697450f59ff34073ad3fe8e299
2018-06-10 15:48:56
CRIMX
perf(panel): better animation
false
diff --git a/src/content/components/SaladBowlPortal/_style.scss b/src/content/components/SaladBowlPortal/_style.scss index 3f4b0fd5e..7c6c3eb16 100644 --- a/src/content/components/SaladBowlPortal/_style.scss +++ b/src/content/components/SaladBowlPortal/_style.scss @@ -58,8 +58,8 @@ $bowl-width: 30px; .isAnimate { &.saladict-SaladBowl { - will-change: left, top !important; - transition: top 0.3s ease-out, left 0.3s ease-out !important; + will-change: transform !important; + transition: transform 0.3s ease-out !important; &:hover { .saladict-SaladBowl_Leaf { @@ -75,7 +75,6 @@ $bowl-width: 30px; } &.saladict-SaladBowl-enter { - will-change: transform !important; animation: saladict-SaladBowl_Jelly 1000ms linear; } } diff --git a/src/content/components/SaladBowlPortal/index.tsx b/src/content/components/SaladBowlPortal/index.tsx index 2acbad34e..59faf3279 100644 --- a/src/content/components/SaladBowlPortal/index.tsx +++ b/src/content/components/SaladBowlPortal/index.tsx @@ -31,15 +31,15 @@ export default class SaladBowlPortal extends React.Component<SaladBowlPortalProp handleBowlEntered = (node: HTMLElement) => { this.bowl = node const { x, y } = this.props.bowlRect - node.style.setProperty('left', `${x}px`, 'important') - node.style.setProperty('top', `${y}px`, 'important') + node.style.removeProperty('top') + node.style.removeProperty('left') + node.style.setProperty('transform', `translate(${x}px, ${y}px)`, 'important') } componentDidUpdate () { if (this.bowl) { const { x, y } = this.props.bowlRect - this.bowl.style.setProperty('left', `${x}px`, 'important') - this.bowl.style.setProperty('top', `${y}px`, 'important') + this.bowl.style.setProperty('transform', `translate(${x}px, ${y}px)`, 'important') } }
perf
better animation
fdc2ba56ad63d278668633c507a1e0c3a11070eb
2020-05-13 21:41:34
crimx
feat(selection): add altKey for search modes
false
diff --git a/src/_locales/en/options.ts b/src/_locales/en/options.ts index 017a8a22f..c83841d5a 100644 --- a/src/_locales/en/options.ts +++ b/src/_locales/en/options.ts @@ -170,7 +170,7 @@ export const locale: typeof _locale = { double_help: 'Show dict panel after double click selection.', holding: 'Hold a key', holding_help: - 'After a selection is made, the selected key must be pressing when releasing mouse (Meta key is "⌘ Command" on macOS and "⊞ Windows" for others).', + 'After a selection is made, the selected key must be pressing when releasing mouse (Alt is "⌥ Option" on macOS. Meta key is "⌘ Command" on macOS and "⊞ Windows" for others.).', instant: 'Instant Capture', instant_help: 'Selection is automatically made near by the cursor.', instantDirect: 'Direct', diff --git a/src/_locales/zh-CN/options.ts b/src/_locales/zh-CN/options.ts index 130bc03de..ea45f56d6 100644 --- a/src/_locales/zh-CN/options.ts +++ b/src/_locales/zh-CN/options.ts @@ -160,7 +160,7 @@ export const locale = { double_help: '双击选择文本之后直接显示词典面板。', holding: '按住按键', holding_help: - '在放开鼠标之前按住选择的按键才显示词典面板(Meta 键为 macOS 上的「⌘ Command」键以及其它键盘的「⊞ Windows」键)。', + '在放开鼠标之前按住选择的按键才显示词典面板(Alt 为 macOS 上的 "⌥ Option"键。 Meta 键为 macOS 上的「⌘ Command」键以及其它键盘的「⊞ Windows」键)。', instant: '鼠标悬浮取词', instant_help: '自动选取鼠标附近的单词。', instantDirect: '直接取词', diff --git a/src/_locales/zh-TW/options.ts b/src/_locales/zh-TW/options.ts index bc264909a..9b87fb3ec 100644 --- a/src/_locales/zh-TW/options.ts +++ b/src/_locales/zh-TW/options.ts @@ -164,7 +164,7 @@ export const locale: typeof _locale = { double_help: '滑鼠按兩下所選擇的句子或單字後,會直接顯示字典視窗介面。', holding: '按住按键', holding_help: - '在放開滑鼠之前,需按住選擇的按鍵才顯示字典視窗介面(Meta 鍵為 macOS 上的「⌘ Command」鍵以及其它鍵盤的「⊞ Windows」鍵)。', + '在放開滑鼠之前,需按住選擇的按鍵才顯示字典視窗介面(Alt 為 macOS 上的 "⌥ Option"鍵。Meta 鍵為 macOS 上的「⌘ Command」鍵以及其它鍵盤的「⊞ Windows」鍵)。', instant: '滑鼠懸浮取詞', instant_help: '自動選取滑鼠附近的單字。', instantDirect: '直接取詞', diff --git a/src/app-config/index.ts b/src/app-config/index.ts index 388f64bbc..5233fa21d 100644 --- a/src/app-config/index.ts +++ b/src/app-config/index.ts @@ -126,6 +126,7 @@ function _getDefaultConfig() { double: false, /** holding a key */ holding: { + alt: false, shift: false, ctrl: false, meta: false @@ -146,6 +147,7 @@ function _getDefaultConfig() { double: false, /** holding a key */ holding: { + alt: false, shift: false, ctrl: false, meta: false @@ -166,6 +168,7 @@ function _getDefaultConfig() { double: false, /** holding a key */ holding: { + alt: false, shift: false, ctrl: false, meta: false @@ -186,6 +189,7 @@ function _getDefaultConfig() { double: false, /** holding a key */ holding: { + alt: false, shift: false, ctrl: true, meta: false diff --git a/src/app-config/merge-config.ts b/src/app-config/merge-config.ts index ea53d1373..b061a27b1 100644 --- a/src/app-config/merge-config.ts +++ b/src/app-config/merge-config.ts @@ -73,6 +73,7 @@ export function mergeConfig( } mergeBoolean(`${key}.direct`) mergeBoolean(`${key}.double`) + mergeBoolean(`${key}.holding.alt`) mergeBoolean(`${key}.holding.shift`) mergeBoolean(`${key}.holding.ctrl`) mergeBoolean(`${key}.holding.meta`) diff --git a/src/content/components/DictList/DictList.tsx b/src/content/components/DictList/DictList.tsx index f06f0c147..04334ab95 100644 --- a/src/content/components/DictList/DictList.tsx +++ b/src/content/components/DictList/DictList.tsx @@ -31,6 +31,7 @@ export interface DictListProps mouseX: number mouseY: number dbClick: boolean + altKey: boolean shiftKey: boolean ctrlKey: boolean metaKey: boolean diff --git a/src/content/redux/epics/newSelection.epic.ts b/src/content/redux/epics/newSelection.epic.ts index 827f82b86..8780751d8 100644 --- a/src/content/redux/epics/newSelection.epic.ts +++ b/src/content/redux/epics/newSelection.epic.ts @@ -39,6 +39,7 @@ export const newSelectionEpic: Epic = (action$, state$) => (!isPinned || pinMode.direct || (pinMode.double && selection.dbClick) || + (pinMode.holding.alt && selection.altKey) || (pinMode.holding.shift && selection.shiftKey) || (pinMode.holding.ctrl && selection.ctrlKey) || (pinMode.holding.meta && selection.metaKey)) @@ -68,6 +69,7 @@ function selectionInsideDictPanel( (selection.instant || direct || (double && selection.dbClick) || + (holding.alt && selection.altKey) || (holding.shift && selection.shiftKey) || (holding.ctrl && selection.ctrlKey) || (holding.meta && selection.metaKey)) @@ -98,6 +100,7 @@ function selectionToQSPanel( (selection.instant || direct || (double && selection.dbClick) || + (holding.alt && selection.altKey) || (holding.shift && selection.shiftKey) || (holding.ctrl && selection.ctrlKey) || (holding.meta && selection.metaKey)) diff --git a/src/content/redux/modules/action-handlers/new-selection.ts b/src/content/redux/modules/action-handlers/new-selection.ts index 57ba7452a..9640812e9 100644 --- a/src/content/redux/modules/action-handlers/new-selection.ts +++ b/src/content/redux/modules/action-handlers/new-selection.ts @@ -95,6 +95,7 @@ export const newSelection: ActionHandler< (state.isShowDictPanel || direct || (double && selection.dbClick) || + (holding.alt && selection.altKey) || (holding.shift && selection.shiftKey) || (holding.ctrl && selection.ctrlKey) || (holding.meta && selection.metaKey) || @@ -110,6 +111,7 @@ export const newSelection: ActionHandler< !newState.isShowDictPanel && !direct && !(double && selection.dbClick) && + !(holding.alt && selection.altKey) && !(holding.shift && selection.shiftKey) && !(holding.ctrl && selection.ctrlKey) && !(holding.meta && selection.metaKey) && diff --git a/src/content/redux/modules/state.ts b/src/content/redux/modules/state.ts index e3a2c7e3a..110b2b327 100644 --- a/src/content/redux/modules/state.ts +++ b/src/content/redux/modules/state.ts @@ -19,6 +19,7 @@ export const initState = () => { mouseY: 0, self: false, dbClick: false, + altKey: false, shiftKey: false, ctrlKey: false, metaKey: false, diff --git a/src/options/components/Entries/SearchModes/searchMode.tsx b/src/options/components/Entries/SearchModes/searchMode.tsx index dd747fdb3..55e0247e1 100644 --- a/src/options/components/Entries/SearchModes/searchMode.tsx +++ b/src/options/components/Entries/SearchModes/searchMode.tsx @@ -86,6 +86,17 @@ export const searchMode = (mode: Mode, t: TFunction): SaladictFormItem => { </Checkbox> ) }, + { + name: getConfigPath(mode, 'holding', 'alt'), + label: null, + className: 'form-item-inline', + valuePropName: 'checked', + children: ( + <Checkbox> + <kbd>Alt</kbd> + </Checkbox> + ) + }, { name: getConfigPath(mode, 'holding', 'shift'), label: null, diff --git a/src/selection/index.ts b/src/selection/index.ts index 4ef9c2ae5..eb5f0447f 100644 --- a/src/selection/index.ts +++ b/src/selection/index.ts @@ -64,6 +64,7 @@ if (!window.__SALADICT_SELECTION_LOADED__) { context: getSentenceFromSelection(selection) }), dbClick: false, + altKey: false, shiftKey: false, ctrlKey: false, metaKey: false, @@ -91,6 +92,7 @@ if (!window.__SALADICT_SELECTION_LOADED__) { if (result.word) { sendMessage({ dbClick: false, + altKey: false, shiftKey: false, ctrlKey: false, metaKey: false, @@ -110,6 +112,7 @@ if (!window.__SALADICT_SELECTION_LOADED__) { .subscribe(async ({ word, event, self }) => { sendMessage({ word: await newSelectionWord(word), + altKey: event.altKey, shiftKey: event.shiftKey, ctrlKey: event.ctrlKey, metaKey: event.metaKey, diff --git a/src/selection/message.ts b/src/selection/message.ts index bf1bc34f0..5a758bc4f 100644 --- a/src/selection/message.ts +++ b/src/selection/message.ts @@ -71,6 +71,7 @@ export function sendEmptyMessage(isDictPanel: boolean) { mouseX: 0, mouseY: 0, dbClick: false, + altKey: false, shiftKey: false, ctrlKey: false, metaKey: false, diff --git a/src/selection/select-text.ts b/src/selection/select-text.ts index a8313cc3c..33ebc0846 100644 --- a/src/selection/select-text.ts +++ b/src/selection/select-text.ts @@ -106,6 +106,7 @@ function withTouchMode(config: AppConfig) { dbClick: clickPeriodCount >= 2, mouseX: mouseup.clientX, mouseY: mouseup.clientY, + altKey: !!mouseup['altKey'], shiftKey: !!mouseup['shiftKey'], ctrlKey: !!mouseup['ctrlKey'], metaKey: !!mouseup['metaKey'] @@ -146,6 +147,7 @@ function withTouchMode(config: AppConfig) { if ( direct || (double && result.dbClick) || + (holding.alt && result.altKey) || (holding.shift && result.shiftKey) || (holding.ctrl && result.ctrlKey) || (holding.meta && result.metaKey) @@ -206,6 +208,7 @@ function withoutTouchMode(config: AppConfig) { dbClick: clickPeriodCount >= 2, mouseX: mouseup.clientX, mouseY: mouseup.clientY, + altKey: mouseup.altKey, shiftKey: mouseup.shiftKey, ctrlKey: mouseup.ctrlKey, metaKey: mouseup.metaKey @@ -288,6 +291,7 @@ export function useInPanelSelect( dbClick: clickPeriodCount >= 2, mouseX: mouseup.clientX, mouseY: mouseup.clientY, + altKey: mouseup.altKey, shiftKey: mouseup.shiftKey, ctrlKey: mouseup.ctrlKey, metaKey: mouseup.metaKey, @@ -301,6 +305,7 @@ export function useInPanelSelect( mouseX: 0, mouseY: 0, dbClick: false, + altKey: false, shiftKey: false, ctrlKey: false, metaKey: false, diff --git a/src/typings/message.ts b/src/typings/message.ts index 4dbe5bb39..253822483 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -163,6 +163,7 @@ export type MessageConfig = MessageConfigType<{ mouseX: number mouseY: number dbClick: boolean + altKey: boolean shiftKey: boolean ctrlKey: boolean metaKey: boolean
feat
add altKey for search modes
e01a234cbc266ad16893447320704fb571155a35
2019-01-20 22:22:46
CRIMX
test: fix profile mocking
false
diff --git a/test/specs/_helpers/config-manager.spec.ts b/test/specs/_helpers/profile-manager.spec.ts similarity index 97% rename from test/specs/_helpers/config-manager.spec.ts rename to test/specs/_helpers/profile-manager.spec.ts index 9304408d2..bf80d64d9 100644 --- a/test/specs/_helpers/config-manager.spec.ts +++ b/test/specs/_helpers/profile-manager.spec.ts @@ -27,7 +27,7 @@ describe('Profile Manager', () => { fakeStorageGet({}) const profile = await profileManager.initProfiles() - expect(profile).toMatchObject({ name: expect.stringContaining('default') }) + expect(typeof profile).toBe('object') expect(browser.storage.sync.set.calledWith(sinon.match({ profileIDList: sinon.match.array, activeProfileID: sinon.match.string, @@ -96,9 +96,13 @@ describe('Profile Manager', () => { [profile2.id]: profile2, }) - const profile = await profileManager.resetAllProfiles() - expect(profile.id).not.toEqual(profile2.id) - expect(browser.storage.sync.remove.called).toBeTruthy() + await profileManager.resetAllProfiles() + expect(browser.storage.sync.remove.calledWith(sinon.match([ + profile1.id, + profile2.id, + 'profileIDList', + 'activeProfileID', + ]))).toBeTruthy() expect(browser.storage.sync.set.calledWith(sinon.match({ profileIDList: sinon.match.array, activeProfileID: sinon.match.string, diff --git a/test/specs/background/initialization.spec.ts b/test/specs/background/initialization.spec.ts index ba78eb5e1..00b38d5e0 100644 --- a/test/specs/background/initialization.spec.ts +++ b/test/specs/background/initialization.spec.ts @@ -15,6 +15,13 @@ jest.mock('@/app-config/merge-config', () => { } }) +jest.mock('@/app-config/merge-profile', () => { + const { getDefaultProfile } = require('@/app-config/profiles') + return { + mergeProfile: jest.fn(profile => Promise.resolve(profile || getDefaultProfile())) + } +}) + jest.mock('@/background/context-menus', () => { return { init: jest.fn(() => Promise.resolve()) } }) @@ -48,6 +55,7 @@ describe('Initialization', () => { let initPdf: jest.Mock let openURL: jest.Mock let mergeConfig: jest.Mock + let mergeProfile: jest.Mock beforeEach(() => { browser.flush() @@ -57,10 +65,12 @@ describe('Initialization', () => { const pdfSniffer = require('@/background/pdf-sniffer') const browserApi = require('@/_helpers/browser-api') const _mergeConfig = require('@/app-config/merge-config') + const _mergeProfile = require('@/app-config/merge-profile') initMenus = contextMenus.init initPdf = pdfSniffer.init openURL = browserApi.openURL mergeConfig = _mergeConfig.mergeConfig + mergeProfile = _mergeProfile.mergeProfile browser.storage.sync.get.callsFake(() => Promise.resolve({})) browser.storage.sync.set.callsFake(() => Promise.resolve()) diff --git a/test/specs/background/server.spec.ts b/test/specs/background/server.spec.ts index dec48e403..edbafede6 100644 --- a/test/specs/background/server.spec.ts +++ b/test/specs/background/server.spec.ts @@ -1,4 +1,5 @@ import { getDefaultConfig } from '@/app-config' +import { getDefaultProfile } from '@/app-config/profiles' import * as browserWrap from '@/_helpers/browser-api' import { MsgType } from '@/typings/message' import { timer } from '@/_helpers/promise-more' @@ -6,6 +7,7 @@ import { timer } from '@/_helpers/promise-more' jest.mock('@/background/database') const config = getDefaultConfig() +const profile = getDefaultProfile() describe('Server', () => { const chsToChz = jest.fn() @@ -37,9 +39,21 @@ describe('Server', () => { getDefaultConfig: () => config } }) + jest.doMock('@/app-config/profiles', () => { + return { + getDefaultProfile: () => profile + } + }) jest.doMock('@/_helpers/config-manager', () => { return { - createActiveConfigStream: () => ({ + createConfigStream: () => ({ + subscribe: () => {/* noop */} + }) + } + }) + jest.doMock('@/_helpers/profile-manager', () => { + return { + createActiveProfileStream: () => ({ subscribe: () => {/* noop */} }) } @@ -118,7 +132,7 @@ describe('Server', () => { payload: { field: 'any' }, }) expect(bingSearch).toHaveBeenCalledTimes(1) - expect(bingSearch).toHaveBeenCalledWith('test', config, { field: 'any' }) + expect(bingSearch).toHaveBeenCalledWith('test', config, profile, { field: 'any' }) }) }) }) diff --git a/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap b/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap index efafa0a2d..af0ad0191 100644 --- a/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap +++ b/test/specs/components/content/__snapshots__/MenuBar.spec.tsx.snap @@ -56,6 +56,7 @@ exports[`Component/content/MenuBar should render correctly 1`] = ` <div> <CSSTransition classNames="panel-MenuBar_SuggestPanel" + in={false} timeout={100} unmountOnExit={true} /> @@ -260,6 +261,7 @@ exports[`Component/content/MenuBar should render correctly with fav and pin 1`] <div> <CSSTransition classNames="panel-MenuBar_SuggestPanel" + in={false} timeout={100} unmountOnExit={true} />
test
fix profile mocking
90c81fb7ed123c59b761a752715d11d718c0e212
2019-08-30 21:14:37
crimx
refactor(panel): dict panel height reconciliation
false
diff --git a/src/_helpers/storybook.tsx b/src/_helpers/storybook.tsx index fdc59bd6e..5121bd6ce 100644 --- a/src/_helpers/storybook.tsx +++ b/src/_helpers/storybook.tsx @@ -130,7 +130,10 @@ export function withSaladictPanel(options: WithSaladictPanelOptions) { color, backgroundColor, '--panel-width': `${width}px`, - '--panel-height': `${height}px`, + '--panel-max-height': `${number( + 'Panel Max Hegiht', + window.innerHeight + )}px`, '--panel-color': color, '--panel-background-color': backgroundColor }} diff --git a/src/content/components/DictPanel/DictPanel.tsx b/src/content/components/DictPanel/DictPanel.tsx index 56ec49fe0..3064fad24 100644 --- a/src/content/components/DictPanel/DictPanel.tsx +++ b/src/content/components/DictPanel/DictPanel.tsx @@ -20,10 +20,7 @@ export interface DictPanelProps { } export const DictPanel: FC<DictPanelProps> = props => { - const [height, _setHeight] = useState(50) - const updateHeightRef = useRef((width: number, height: number) => { - _setHeight(height) - }) + const heightRef = useRef(50) const [x, setX] = useState(props.x) const [y, setY] = useState(props.y) @@ -33,13 +30,19 @@ export const DictPanel: FC<DictPanelProps> = props => { }, [props.x]) useEffect(() => { - setY(reconcileY(height, props.y)) + setY(reconcileY(heightRef.current, props.y)) }, [props.y]) useUpdateEffect(() => { setX(x => reconcileX(props.width, x)) - setY(y => reconcileY(height, y)) - }, [props.width, height]) + setY(y => reconcileY(heightRef.current, y)) + }, [props.width]) + + const updateHeightRef = useRef((width: number, height: number) => { + heightRef.current = height + setX(x => reconcileX(props.width, x)) + setY(y => reconcileY(heightRef.current, y)) + }) return ( <div @@ -58,11 +61,15 @@ export const DictPanel: FC<DictPanelProps> = props => { '--panel-background-color': '#fff', '--panel-color': '#333', '--panel-width': props.width + 'px', - '--panel-height': height + 'px', '--panel-max-height': props.maxHeight + 'px' }} > - <ReactResizeDetector handleHeight onResize={updateHeightRef.current} /> + <ReactResizeDetector + handleHeight + refreshMode="debounce" + refreshRate={100} + onResize={updateHeightRef.current} + /> <div className="dictPanel-Head">{props.menuBar}</div> <div className="dictPanel-Body"> {props.mtaBox} @@ -76,8 +83,9 @@ export const DictPanel: FC<DictPanelProps> = props => { function reconcileX(width: number, x: number): number { const winWidth = window.innerWidth - if (x + width + 10 > winWidth) { - x = winWidth - 10 - width + // also counted scrollbar width + if (x + width + 25 > winWidth) { + x = winWidth - 25 - width } if (x < 10) { @@ -90,12 +98,12 @@ function reconcileX(width: number, x: number): number { function reconcileY(height: number, y: number): number { const winHeight = window.innerHeight - if (y + height + 10 > winHeight) { - y = winHeight - 10 - height + if (y + height + 15 > winHeight) { + y = winHeight - 15 - height } - if (y < 10) { - y = 10 + if (y < 15) { + y = 15 } return y diff --git a/src/typings/css.d.ts b/src/typings/css.d.ts index 83f76aae8..e1a331f30 100644 --- a/src/typings/css.d.ts +++ b/src/typings/css.d.ts @@ -6,7 +6,6 @@ declare module 'csstype' { '--panel-color'?: string '--panel-background-color'?: string '--panel-width'?: string - '--panel-height'?: string '--panel-max-height'?: string } }
refactor
dict panel height reconciliation
c57485f3c30927e92702264597a2b8e7797269b2
2020-06-18 22:34:18
crimx
refactor(options): add code style to dict auths
false
diff --git a/src/components/dictionaries/tencent/auth.ts b/src/components/dictionaries/tencent/auth.ts index 25386ac06..feaa57989 100644 --- a/src/components/dictionaries/tencent/auth.ts +++ b/src/components/dictionaries/tencent/auth.ts @@ -3,4 +3,4 @@ export const auth = { secretKey: '' } -export const url = 'https://cloud.tencent.com/document/api/213/30654' +export const url = 'https://cloud.tencent.com/product/tmt' diff --git a/src/options/_style.scss b/src/options/_style.scss index cafcc2720..06a7f6bac 100644 --- a/src/options/_style.scss +++ b/src/options/_style.scss @@ -159,6 +159,26 @@ kbd[data-key='eject']:after { content: ' ⏏'; } +/* ======================================= *\ + * Base +\* ======================================= */ + +code { + border: 1px solid #ddd; + color: #f14668; + background: #f6f6f6; + padding: 3px 5px; + border-radius: 3px; + font-size: 1em; +} + +.saladict-theme-dark { + code { + border-color: #333; + background: #181818; + } +} + /* ======================================= *\ * Components \* ======================================= */ diff --git a/src/options/components/Entries/DictAuths.tsx b/src/options/components/Entries/DictAuths.tsx index cc09c49ea..fbf1e47b6 100644 --- a/src/options/components/Entries/DictAuths.tsx +++ b/src/options/components/Entries/DictAuths.tsx @@ -34,7 +34,12 @@ export const DictAuths: FC = () => { const isLast = i + 1 === keys.length formItems.push({ name: configPath + '.' + key, - label: i === 0 ? title + ' ' + key : key, + label: ( + <span> + {i === 0 ? title + ' ' : ''} + <code>{key}</code> + </span> + ), help: isLast ? ( <Trans message={t('dictAuth.dictHelp')}> <a
refactor
add code style to dict auths
1f1b5ffa7ed8fb99773f645eb20555a00b12bacd
2020-04-28 11:24:55
crimx
test(background): remove update check
false
diff --git a/test/specs/background/initialization.spec.ts b/test/specs/background/initialization.spec.ts index ef91f521f..12c151268 100644 --- a/test/specs/background/initialization.spec.ts +++ b/test/specs/background/initialization.spec.ts @@ -1,5 +1,3 @@ -import sinon from 'sinon' - import { message, storage } from '@/_helpers/browser-api' import { getDefaultConfig } from '@/app-config' import getDefaultProfile from '@/app-config/profiles' @@ -120,26 +118,5 @@ describe('Initialization', () => { await timer(0) expect(checkUpdate).toHaveBeenCalledTimes(0) }) - - it('should check update when last check was 7 days ago', async () => { - browser.storage.local.get.onFirstCall().returns( - Promise.resolve({ - lastCheckUpdate: 0 - }) - ) - checkUpdate.mockReturnValueOnce( - Promise.resolve({ isAvailable: true, info: {} }) - ) - browser.runtime.onStartup.dispatch() - - await timer(0) - expect(checkUpdate).toHaveBeenCalledTimes(1) - expect( - browser.storage.local.set.calledWith({ - lastCheckUpdate: sinon.match.number - }) - ).toBeTruthy() - expect(browser.notifications.create.calledOnce).toBeTruthy() - }) }) })
test
remove update check
1dc3c9bd4ac9fde4e6911d153c31fa4cd2f43f94
2020-06-15 17:34:49
crimx
docs: add comments
false
diff --git a/src/selection/instant-capture.ts b/src/selection/instant-capture.ts index ba66274f5..875b37f5c 100644 --- a/src/selection/instant-capture.ts +++ b/src/selection/instant-capture.ts @@ -171,6 +171,11 @@ function getCursorWord( range.setEnd(textNode, offset + tail.length) const rangeRect = range.getBoundingClientRect() + // When cursor is pointing at the blank space of + // the last line of a paragraph, + // caretPositionFromPoint would select the nearest + // ending text. + // This will make sure the text is truly under cursor. if ( rangeRect.left <= x && rangeRect.right >= x && @@ -179,6 +184,7 @@ function getCursorWord( ) { sel.removeAllRanges() sel.addRange(range) + // select the whole word(CJK) if (sel['modify']) { sel['modify']('move', 'backward', 'word') sel.collapseToStart()
docs
add comments
10e9636d85d7c6779bbc2a64bb0be8c944dc6804
2019-11-01 10:32:01
crimx
fix: missing pdf locale properties
false
diff --git a/scripts/pdf.js b/scripts/pdf.js index a117d6b29..7cc75790e 100644 --- a/scripts/pdf.js +++ b/scripts/pdf.js @@ -153,6 +153,13 @@ async function cloneFiles() { await fs.copy(path.join(__dirname, repoRoot, pdfDir), targetPath) } + // copy locale.properties + await fs.ensureDir(path.join(publicPDFRoot, 'web/locale')) + await fs.copy( + path.join(__dirname, repoRoot, 'web/locale/locale.properties'), + path.join(publicPDFRoot, 'web/locale/locale.properties') + ) + const locales = (await fs.readdir( path.join(__dirname, repoRoot, 'web/locale') )).filter(
fix
missing pdf locale properties
1f89a0677aa36f03ae85af604f61e3157ce5c4d2
2018-09-02 10:54:32
CRIMX
refactor(panel): tweak multiline search box style
false
diff --git a/src/content/components/DictPanel/_style.scss b/src/content/components/DictPanel/_style.scss index 42b068f60..f9e65e8ce 100644 --- a/src/content/components/DictPanel/_style.scss +++ b/src/content/components/DictPanel/_style.scss @@ -44,7 +44,9 @@ .panel-BigSearchBoxBtn { width: 100%; - height: 10px; + height: 12px; + overflow: hidden; + font-size: 0; cursor: pointer; } diff --git a/src/content/redux/modules/widget.ts b/src/content/redux/modules/widget.ts index 7c354c74b..9234f0747 100644 --- a/src/content/redux/modules/widget.ts +++ b/src/content/redux/modules/widget.ts @@ -13,7 +13,7 @@ import { MachineTranslateResult } from '@/components/dictionaries/helpers' const isSaladictOptionsPage = !!window.__SALADICT_OPTIONS_PAGE__ const isSaladictPopupPage = !!window.__SALADICT_POPUP_PAGE__ -const panelHeaderHeight = 30 + 10 // menu bar + multiline search box button +const panelHeaderHeight = 30 + 12 // menu bar + multiline search box button /*-----------------------------------------------*\ Action Type
refactor
tweak multiline search box style
de5cbcd58cdd4f7ad58e85ac3972af7d0421c8a8
2020-07-06 07:27:27
crimx
refactor(background): add set clipboard channel
false
diff --git a/src/background/server.ts b/src/background/server.ts index 8cde6e03b..caba57555 100644 --- a/src/background/server.ts +++ b/src/background/server.ts @@ -18,7 +18,7 @@ import { } from './database' import { AudioManager } from './audio-manager' import { QsPanelManager } from './windows-manager' -import { getTextFromClipboard } from './clipboard-manager' +import { getTextFromClipboard, copyTextToClipboard } from './clipboard-manager' import './types' import { DictID } from '@/app-config' @@ -73,6 +73,8 @@ export class BackgroundServer { return this.callDictEngineMethod(msg.payload) case 'GET_CLIPBOARD': return Promise.resolve(getTextFromClipboard()) + case 'SET_CLIPBOARD': + return Promise.resolve(copyTextToClipboard(msg.payload)) case 'INJECT_DICTPANEL': return injectDictPanel(sender.tab) diff --git a/src/typings/message.ts b/src/typings/message.ts index 63238cb85..2ff368664 100644 --- a/src/typings/message.ts +++ b/src/typings/message.ts @@ -35,6 +35,10 @@ export type MessageConfig = MessageConfigType<{ response: string } + SET_CLIPBOARD: { + payload: string + } + /** Request backend for page info */ PAGE_INFO: { response: {
refactor
add set clipboard channel
828e3159d8dead6fdf8328f8f239c063449fd5d9
2018-10-12 07:49:23
CRIMX
fix(panel): fix search text loading on standalone panel
false
diff --git a/src/background/server.ts b/src/background/server.ts index cda5de532..982e143ce 100644 --- a/src/background/server.ts +++ b/src/background/server.ts @@ -131,9 +131,24 @@ export async function openQSPanel (): Promise<void> { break } + let url = browser.runtime.getURL('quick-search.html') + if (config.tripleCtrlPreload === 'selection') { + const tab = (await browser.tabs.query({ active: true, lastFocusedWindow: true }))[0] + if (tab && tab.id) { + const info = await message.send(tab.id, { type: MsgType.PreloadSelection }) + try { + url += '?info=' + encodeURIComponent(JSON.stringify(info)) + } catch (e) { + if (process.env.DEV_BUILD) { + console.warn(e) + } + } + } + } + const qsPanelWin = await browser.windows.create({ type: 'popup', - url: browser.runtime.getURL('quick-search.html'), + url, width: config.panelWidth, height: config.tripleCtrlHeight, left: Math.round(left), diff --git a/src/content/redux/modules/dictionaries.ts b/src/content/redux/modules/dictionaries.ts index 3799f8537..0a5416812 100644 --- a/src/content/redux/modules/dictionaries.ts +++ b/src/content/redux/modules/dictionaries.ts @@ -263,7 +263,7 @@ export function startUpAction (): DispatcherThunk { return (dispatch, getState) => { if (isSaladictPopupPage) { const { baPreload, baAuto } = getState().config - dispatch(summonedPanelInit(baPreload, baAuto, true)) + dispatch(summonedPanelInit(baPreload, baAuto, 'popup')) } else if (isSaladictQuickSearchPage) { /** From other tabs */ message.addListener<MsgQSPanelSearchText>(MsgType.QSPanelSearchText, ({ info }) => { @@ -377,39 +377,52 @@ export function searchText ( export function summonedPanelInit ( preload: PreloadSource, autoSearch: boolean, - isStandalone: boolean, + // quick-search could be turned off so this argument is needed + standalone: '' | 'popup' | 'quick-search', ): DispatcherThunk { - return (dispatch, getState) => { + return async (dispatch, getState) => { if (!preload) { return } const state = getState() - const fetchInfo = preload === 'selection' - ? isStandalone - ? browser.tabs.query({ active: true, currentWindow: true }) - .then(tabs => { - if (tabs.length > 0 && tabs[0].id != null) { - return message.send(tabs[0].id as number, { type: MsgType.PreloadSelection }) + let info: SelectionInfo | null = null + + try { + if (preload === 'selection') { + if (standalone === 'popup') { + const tab = (await browser.tabs.query({ active: true, currentWindow: true }))[0] + if (tab && tab.id != null) { + info = await message.send(tab.id, { type: MsgType.PreloadSelection }) + } + } else if (standalone === 'quick-search') { + const infoText = new URL(document.URL).searchParams.get('info') + if (infoText) { + try { + info = JSON.parse(decodeURIComponent(infoText)) + } catch (err) { + info = null } - return null - }) - : Promise.resolve({ ...state.selection.selectionInfo }) - : message.send({ type: MsgType.GetClipboard }) - .then(text => getDefaultSelectionInfo({ text, title: 'From Clipboard' })) - - fetchInfo.then(info => { - if (info) { - if (autoSearch && info.text) { - dispatch(searchText({ info })) + } } else { - dispatch(restoreDicts()) - dispatch(searchBoxUpdate({ text: info.text, index: 0 })) + info = { ...state.selection.selectionInfo } } + } else /* preload === clipboard */ { + const text = await message.send({ type: MsgType.GetClipboard }) + info = getDefaultSelectionInfo({ text, title: 'From Clipboard' }) } - }).catch(e => { - if (process.env.NODE_ENV !== 'production') { + } catch (e) { + if (process.env.DEV_BUILD) { console.warn(e) } - }) + } + + if (info) { + if (autoSearch && info.text) { + dispatch(searchText({ info })) + } else { + dispatch(restoreDicts()) + dispatch(searchBoxUpdate({ text: info.text, index: 0 })) + } + } } } diff --git a/src/content/redux/modules/widget.ts b/src/content/redux/modules/widget.ts index 8eb4affdf..f7eb710d7 100644 --- a/src/content/redux/modules/widget.ts +++ b/src/content/redux/modules/widget.ts @@ -509,7 +509,7 @@ export function startUpAction (): DispatcherThunk { if (isSaladictQuickSearchPage) { const { config } = getState() - dispatch(summonedPanelInit(config.tripleCtrlPreload, config.tripleCtrlAuto, true)) + dispatch(summonedPanelInit(config.tripleCtrlPreload, config.tripleCtrlAuto, 'quick-search')) } else if (!isSaladictPopupPage && !isSaladictOptionsPage) { listenTrpleCtrl(dispatch, getState) } @@ -851,7 +851,7 @@ function listenTrpleCtrl ( message.send({ type: MsgType.OpenQSPanel }) } else { dispatch(tripleCtrlPressed()) - dispatch(summonedPanelInit(config.tripleCtrlPreload, config.tripleCtrlAuto, false)) + dispatch(summonedPanelInit(config.tripleCtrlPreload, config.tripleCtrlAuto, '')) } }) }
fix
fix search text loading on standalone panel
659c663ca78bf8bac8a656cfa535f47062f02cc7
2020-04-08 14:57:38
crimx
refactor: mv AntdRoot to components
false
diff --git a/src/_helpers/antd.tsx b/src/components/AntdRoot.tsx similarity index 100% rename from src/_helpers/antd.tsx rename to src/components/AntdRoot.tsx diff --git a/src/history/index.tsx b/src/history/index.tsx index 81e91dfae..a186ef71f 100644 --- a/src/history/index.tsx +++ b/src/history/index.tsx @@ -4,7 +4,7 @@ import '@/selection' import React from 'react' import ReactDOM from 'react-dom' import { WordPage } from '@/components/WordPage' -import { AntdRoot } from '@/_helpers/antd' +import { AntdRoot } from '@/components/AntdRoot' document.title = 'Saladict History' diff --git a/src/notebook/index.tsx b/src/notebook/index.tsx index 0d073ab63..6b7233425 100644 --- a/src/notebook/index.tsx +++ b/src/notebook/index.tsx @@ -4,7 +4,7 @@ import '@/selection' import React from 'react' import ReactDOM from 'react-dom' import { WordPage } from '@/components/WordPage' -import { AntdRoot } from '@/_helpers/antd' +import { AntdRoot } from '@/components/AntdRoot' document.title = 'Saladict Notebook' diff --git a/src/options/index.tsx b/src/options/index.tsx index 6bfc5a1e5..f64e521c8 100644 --- a/src/options/index.tsx +++ b/src/options/index.tsx @@ -3,7 +3,7 @@ import '@/selection' import React from 'react' import ReactDOM from 'react-dom' -import { AntdRoot } from '@/_helpers/antd' +import { AntdRoot } from '@/components/AntdRoot' import { MainEntry } from './components/MainEntry' import './_style.scss'
refactor
mv AntdRoot to components
feda41b7ff8b4cefc559072a16654fdf009092b6
2018-05-31 03:25:47
CRIMX
test(selection): fix rxjs incompatible downgrade
false
diff --git a/src/_helpers/__mocks__/config-manager.ts b/src/_helpers/__mocks__/config-manager.ts index f48d5d77d..faf5fd5d8 100644 --- a/src/_helpers/__mocks__/config-manager.ts +++ b/src/_helpers/__mocks__/config-manager.ts @@ -36,7 +36,7 @@ export const createAppConfigStream = jest.fn((): Observable<AppConfig> => { handler => addAppConfigListener(handler), handler => removeAppConfigListener(handler), ).pipe( - map(args => args[0].config.newValue) + map(args => (Array.isArray(args) ? args[0] : args).config.newValue) ) ) })
test
fix rxjs incompatible downgrade
0ee87d659ee4e3c871bf0c57a942064cc3df28bb
2019-03-17 12:56:44
CRIMX
test(profile): update compression test
false
diff --git a/src/_helpers/profile-manager.ts b/src/_helpers/profile-manager.ts index ed5259f34..3f6427f28 100644 --- a/src/_helpers/profile-manager.ts +++ b/src/_helpers/profile-manager.ts @@ -37,17 +37,17 @@ interface ProfileCompressed { d: string } -function deflate (profile: Profile): ProfileCompressed { +export function deflate (profile: Profile): ProfileCompressed { return { v: 1, d: pako.deflate(JSON.stringify(profile), { to: 'string' }) } } -function inflate (profile: Profile | ProfileCompressed): Profile -function inflate (profile: undefined): undefined -function inflate (profile?: Profile | ProfileCompressed): Profile | undefined -function inflate (profile?: Profile | ProfileCompressed): Profile | undefined { +export function inflate (profile: Profile | ProfileCompressed): Profile +export function inflate (profile: undefined): undefined +export function inflate (profile?: Profile | ProfileCompressed): Profile | undefined +export function inflate (profile?: Profile | ProfileCompressed): Profile | undefined { if (profile && profile['v'] === 1) { return JSON.parse(pako.inflate((profile as ProfileCompressed).d, { to: 'string' })) } diff --git a/test/specs/_helpers/profile-manager.spec.ts b/test/specs/_helpers/profile-manager.spec.ts index 68832131e..84fbb4d2c 100644 --- a/test/specs/_helpers/profile-manager.spec.ts +++ b/test/specs/_helpers/profile-manager.spec.ts @@ -39,11 +39,13 @@ describe('Profile Manager', () => { const id2 = getDefaultProfileID() const profile1 = getDefaultProfile(id1.id) const profile2 = getDefaultProfile(id2.id) + const deflatedProfile1 = profileManager.deflate(profile1) + const deflatedProfile2 = profileManager.deflate(profile2) fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: deflatedProfile1, + [profile2.id]: deflatedProfile2, }) const profile = await profileManager.initProfiles() @@ -53,10 +55,10 @@ describe('Profile Manager', () => { activeProfileID: profile2.id, }))).toBeTruthy() expect(browser.storage.sync.set.calledWith(sinon.match({ - [profile1.id]: profile1, + [profile1.id]: deflatedProfile1, }))).toBeTruthy() expect(browser.storage.sync.set.calledWith(sinon.match({ - [profile2.id]: profile2, + [profile2.id]: deflatedProfile2, }))).toBeTruthy() }) @@ -70,8 +72,8 @@ describe('Profile Manager', () => { fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: profileManager.deflate(profile1), + [profile2.id]: profileManager.deflate(profile2), [detached1.id]: detached1, [detached2.id]: detached2, }) @@ -92,8 +94,8 @@ describe('Profile Manager', () => { fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: profileManager.deflate(profile1), + [profile2.id]: profileManager.deflate(profile2), }) await profileManager.resetAllProfiles() @@ -119,8 +121,8 @@ describe('Profile Manager', () => { fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: profileManager.deflate(profile1), + [profile2.id]: profileManager.deflate(profile2), }) const id3 = getDefaultProfileID() @@ -139,8 +141,8 @@ describe('Profile Manager', () => { fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: profileManager.deflate(profile1), + [profile2.id]: profileManager.deflate(profile2), }) await profileManager.removeProfile(profile1.id) @@ -158,11 +160,11 @@ describe('Profile Manager', () => { fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: profileManager.deflate(profile1), + [profile2.id]: profileManager.deflate(profile2), }) - expect(await profileManager.getActiveProfile()).toBe(profile2) + expect((await profileManager.getActiveProfile()).id).toBe(profile2.id) }) it('should update profile ID list', async () => { @@ -186,7 +188,7 @@ describe('Profile Manager', () => { const profile = getDefaultProfile() await profileManager.updateProfile(profile) expect(browser.storage.sync.set.calledWith({ - [profile.id]: profile, + [profile.id]: sinon.match(profileManager.deflate(profile)), })).toBeTruthy() }) @@ -203,8 +205,8 @@ describe('Profile Manager', () => { fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: profileManager.deflate(profile1), + [profile2.id]: profileManager.deflate(profile2), }) callback = jest.fn() await profileManager.addActiveProfileListener(callback) @@ -281,8 +283,8 @@ describe('Profile Manager', () => { fakeStorageGet({ profileIDList: [id1, id2], activeProfileID: profile2.id, - [profile1.id]: profile1, - [profile2.id]: profile2, + [profile1.id]: profileManager.deflate(profile1), + [profile2.id]: profileManager.deflate(profile2), }) const subscriber = jest.fn()
test
update compression test
444dd1d56e8a262ea2f02cadc832de9f9701908c
2018-05-18 20:42:06
CRIMX
refactor(legacy): remove share img
false
diff --git a/src/shareimg/Shareimg.vue b/src/shareimg/Shareimg.vue deleted file mode 100644 index ed5df8e80..000000000 --- a/src/shareimg/Shareimg.vue +++ /dev/null @@ -1,298 +0,0 @@ -<template> -<div class="page-container"> - <div class="panel-container"> - <header class="panel-header"> - <div class="search-input" :style="{width: textWidth + 'px'}"> - <span class="input-text" ref="inputspan">{{ text }}</span> - <span class="ellipsis" v-if="isShowEllipsis">......</span> - </div> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52.966 52.966" width="14" height="14" fill="#fff"> - <path d="M51.704 51.273L36.844 35.82c3.79-3.8 6.14-9.04 6.14-14.82 0-11.58-9.42-21-21-21s-21 9.42-21 21 9.42 21 21 21c5.082 0 9.747-1.817 13.383-4.832l14.895 15.49c.196.206.458.308.72.308.25 0 .5-.093.694-.28.398-.382.41-1.015.028-1.413zM21.984 40c-10.478 0-19-8.523-19-19s8.522-19 19-19 19 8.523 19 19-8.525 19-19 19z"/> - </svg> - <div class="placeholder"></div> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 612 612" width="16" height="16" opacity="0.85"> - <path fill="#6BBC57" d="M577.557 184.258C560.417 140.85 519.54 59.214 519.54 59.214l.003-.01s-82.64 38.422-123.102 61.674c-30.27 17.396-41.46 48.877-44.22 56.743-3.22 9.23-12.33 51.19 6.12 90.86 23.93 51.44 50.86 106.04 50.86 106.04v.01s55.31-25.83 106.09-51.13c39.16-19.51 58.3-57.96 61.53-67.18 2.75-7.865 13.577-39.475.753-71.95z"/> - <path fill="#BDE9B7" d="M501.052 102.162l6.466 2.263L426.69 335.38l-6.466-2.263z"/> - <circle cx="299.756" cy="198.246" r="178.613" fill="#FFB30D"/> - <circle cx="299.756" cy="198.246" r="155.24" fill="#FCE29C"/> - <path fill="#FCC329" d="M299.756 189.873l41.513-76.398c7.9-30.932-16.92-54.887-41.52-55.584-24.6-.69-51.52 24.89-43.26 55.59l43.26 76.4zm7.27 4.884h86.948c30.954-7.674 40.15-41.076 29.02-63.02-11.13-21.942-46.46-33.38-69.494-11.467l-46.475 74.487zm1.764 8.687l46.095 73.724c23.04 22.1 56.11 12.27 68.816-8.8 12.71-21.07 3.68-57.092-27.11-65.006l-87.79.08zm-8.582 3.174l-40.58 76.898c-7.53 31.027 17.586 54.677 42.187 55.075 24.6.4 51.207-25.51 42.577-56.1l-44.184-75.86zm-8.15-3.318l-86.95.115c-30.945 7.862-40.094 41.125-28.936 63.053 11.158 21.928 49.88 34.073 72.884 12.13l43-75.297zm.407-8.47l-45.968-73.806c-23.003-22.14-56.088-12.366-68.83 8.682-12.742 21.047-3.774 57.085 27.002 65.05l87.79.073z"/> - <path fill="#A63131" d="M71.014 337.344c76.277 85.25 207.22 92.522 292.468 16.245L87.258 44.87C2.01 121.15-5.262 252.092 71.014 337.342z"/> - <path fill="#BC5757" d="M101.447 310.115c61.238 68.44 166.364 74.278 234.804 13.04L114.49 75.31c-68.443 61.24-74.28 166.364-13.043 234.805z"/> - <path fill="#F1D4AF" d="M186.412 237.54l-34.753 7.904c-11.67 5.94-12.32 20.066-5.88 27.826 6.44 7.758 21.6 9.12 28.82-1.732l11.8-33.998zm55.65 32.292l-18.696 30.343c-3.927 12.483 5.7 22.843 15.75 23.675 10.052.835 21.64-9.035 18.945-21.785l-16-32.233zm-81.86-91.515l-29.845-19.48c-12.377-4.252-22.982 5.102-24.08 15.128-1.094 10.025 8.47 21.868 21.286 19.506l32.64-15.15z"/> - <path fill="#2D97B7" d="M30.857 311.46c0 118.41 74.514 219.34 179.01 258.06v19.68h191.12v-20.3c102.608-38.786 175.9-137.698 177.323-253.993l10.886-18.937H22.804l8.063 14.028c-.002.49-.01.973-.01 1.46z"/> - <path fill="#FFF" d="M540.565 321.42c.02 1.167.03 2.335.03 3.507 0 81.014-43.082 151.957-107.58 191.195l4.163 7.195c66.974-40.677 111.717-114.308 111.717-198.39 0-1.172-.01-2.34-.03-3.508zm-140.68 211.26c-11.587 4.63-23.648 8.322-36.092 10.974v.796l1.178 7.443c13.51-2.844 26.58-6.875 39.11-11.958z"/> - </svg> - <div class="brand"> - <div class="brand-saladict">Saladict</div> - </div> - </header> - <div class="dicts"> - <section class="dict-item" v-for="id in selected"> - <header class="dict-item-header"> - <img class="dict-item-logo" :src="dicts[id].favicon"> - <h1 class="dict-item-name">{{ dicts[id].name }}</h1> - </header> - <div ref="dict" class="dict-item-body"> - <component :is="id" :result="dicts[id].result"></component> - </div> - </section> - </div> - </div> - <transition name="fade"> - <img v-if="imgsrc" class="panel-img" :src="imgsrc" @click="downloadImg" alt="panel image"> - <div v-else class="panel-mask"> - <loader :width="150" :height="150" fill="#fff"></loader> - </div> - </transition> -</div> -</template> - -<script> -import html2canvas from 'html2canvas' -import Loader from 'src/components/Loader' -import AppConfig from 'src/app-config' -import {storage} from 'src/helpers/chrome-api' - -const defaultConfig = new AppConfig() - -export default { - name: 'share-img', - data () { - let dicts = Object.keys(defaultConfig.dicts.all).reduce((dicts, id) => { - dicts[id] = { - result: null, - favicon: chrome.runtime.getURL(`assets/dicts/${id}.png`), - name: chrome.i18n.getMessage('dict_' + id) || id - } - return dicts - }, {}) - - return { - imgsrc: '', - text: '', - textWidth: 84, - isShowEllipsis: false, // html2canvas doesn't support text overflow: ellipsis - selected: [], - dicts - } - }, - methods: { - downloadImg () { - var a = document.createElement('a') - a.href = this.imgsrc - a.download = `${this.text}-Saladict` - a.click() - } - }, - mounted () { - storage.local.get('paneldata') - .then(({paneldata}) => { - return new Promise((resolve, reject) => { - this.text = paneldata.text - paneldata.dicts.forEach(dict => { - this.selected.push(dict.id) - this.dicts[dict.id].result = dict.result - if (dict.id === 'dictcn') { - dict.result.animate = false - } - }) - - this.$nextTick(() => { - // get text width - let textWidth = this.$refs.inputspan.getBoundingClientRect().width - console.log(textWidth) - if (textWidth > this.textWidth) { - if (textWidth <= 270) { - this.textWidth = textWidth - } else { - this.textWidth = 270 - this.isShowEllipsis = true - } - } - }) - setTimeout(resolve, 1500) - }) - }) - .then(() => { - html2canvas(document.querySelector('.panel-container')).then(canvas => { - if (canvas) { - this.imgsrc = canvas.toDataURL('image/png') - } else { - console.error('dom to canvas faild') - } - }) - }) - }, - components: (() => { - // Dynamically & asynchronously loads components - const components = {Loader} - Object.keys(defaultConfig.dicts.all).forEach(id => { - components[id] = () => Promise.resolve(require('src/dictionaries/' + id + '/view.vue')) - }) - return components - })() -} -</script> - -<style src="normalize.css/normalize.css"></style> - -<style lang="scss"> -*, *:before, *:after { - box-sizing: inherit; -} - -html { - box-sizing: border-box; -} - -body { - font-size: 14px; - // font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei UI", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; - background: #f7f7f7; -} - -.page-container { - position: relative; - width: 400px; - margin: auto; -} - -.panel-mask { - display: flex; - justify-content: center; - position: absolute; - z-index: 9999; - top: 0; - left: 0; - bottom: 0; - right: 0; - padding-top: 10%; - background: rgba(0, 0, 0, 0.7); -} - -.panel-img { - position: absolute; - top: 0; - left: 0; - width: 100%; - cursor: pointer; -} - -.panel-container { - display: flex; - position: relative; - flex-direction: column; - background: #fff; -} - -.panel-header { - display: flex; - align-items: center; - height: 30px; - padding-left: 6px; - background-color: rgb(92, 175, 158); -} - -.hidden-input { - position: absolute; - z-index: -1; - top: 0; - left: 0; - padding: 0 5px; -} - -.search-input { - position: relative; - width: 6em; - height: 18px; - margin-right: 8px; - padding: 0 5px; - color: #fff; - overflow: hidden; - background-color: rgba(225, 225, 225, 0.1); - transition: all 0.4s; -} - -.input-text { - position: absolute; - z-index: 1; - top: 0; - left: 0; - padding: 0 5px; - white-space: nowrap; -} - -.ellipsis { - position: absolute; - z-index: 2; - top: 0; - right: 0; - padding-right: 5px; - background-color: #6ab4a5; -} - -.placeholder { - flex: 1; -} - -.brand { - color: rgba(255, 255, 255, 0.6); - margin: 0 6px 0 2px; -} - -.brand-saladict { - text-align: center; -} - -.dicts { - flex: 1; - padding: 0 10px; - border: 1px solid #eee; - border-top: none; -} - -.dict-item { - position: relative; -} - -.dict-item-header { - display: flex; - align-items: center; - border-top: 1px #ddd solid; -} - -.dict-item:first-child .dict-item-header { - border: none; -} - -.dict-item-logo { - align-self: flex-start; - width: 19px; - height: 19px; - margin-top: -1px; -} - -.dict-item-name { - margin: 0; - padding: 3px; - font-size: 12px; - font-weight: normal; - color: #444; - cursor: pointer; -} - -.dict-item-body { - overflow: hidden; - margin-bottom: 10px; - font-size: 12px; - line-height: 1.6; - color: #333; -} - -.fade-enter-active, .fade-leave-active { - transition: opacity .5s -} -.fade-enter, .fade-leave-active { - opacity: 0 -} -</style> diff --git a/src/shareimg/main.js b/src/shareimg/main.js deleted file mode 100644 index 7c703a132..000000000 --- a/src/shareimg/main.js +++ /dev/null @@ -1,13 +0,0 @@ -import Vue from 'vue' -import App from './Shareimg' - -import VueHighcharts from 'vue-highcharts' -Vue.use(VueHighcharts) - -Vue.config.productionTip = false -Vue.config.devtools = false - -new Vue({ // eslint-disable-line no-new - el: '#app', - render: h => h(App) -})
refactor
remove share img
ffbe24902a7c3fb1cb6e2dd75479a4909055212b
2019-04-26 10:23:42
CRIMX
docs: update issue template
false
diff --git a/.github/issue_template.md b/.github/issue_template.md index 571638afd..ecd58d991 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,4 +1,4 @@ -<!–– +<!-- 使用相关的问题请阅读使用方式: https://github.com/crimx/ext-saladict/wiki#wiki-content @@ -15,7 +15,7 @@ https://github.com/crimx/ext-saladict/wiki/Q&A -- 平台:包括操作系统和 Chrome/Firefox 版本(或者其它浏览器版本) +- 平台:操作系统版本,Chrome/Firefox 版本,是否测试版
docs
update issue template
9fc61fdb3410f2880ede5a0f81f861dba4f7bb60
2019-01-22 15:27:20
CRIMX
style(options): clean code
false
diff --git a/src/options/components/options/DictPanel/index.tsx b/src/options/components/options/DictPanel/index.tsx index a637554e9..b94ab6f30 100644 --- a/src/options/components/options/DictPanel/index.tsx +++ b/src/options/components/options/DictPanel/index.tsx @@ -10,6 +10,7 @@ export type DictPanelProps = Props & FormComponentProps export class DictPanel extends React.Component<DictPanelProps> { render () { const { t, config, profile } = this.props + const { getFieldDecorator } = this.props.form return ( <Form> @@ -19,7 +20,7 @@ export class DictPanel extends React.Component<DictPanelProps> { extra={t('opt_profile_change')} required >{ - this.props.form.getFieldDecorator('profile#mtaAutoUnfold', { + getFieldDecorator('profile#mtaAutoUnfold', { initialValue: profile.mtaAutoUnfold, })( <Radio.Group> @@ -38,7 +39,7 @@ export class DictPanel extends React.Component<DictPanelProps> { {...formItemLayout} label={t('opt_search_suggests')} >{ - this.props.form.getFieldDecorator('config#searchSuggests', { + getFieldDecorator('config#searchSuggests', { initialValue: config.searchSuggests, valuePropName: 'checked', })( @@ -50,7 +51,7 @@ export class DictPanel extends React.Component<DictPanelProps> { label={t('opt_animation')} help={t('opt_animation_help')} >{ - this.props.form.getFieldDecorator('config#animation', { + getFieldDecorator('config#animation', { initialValue: config.animation, valuePropName: 'checked', })( @@ -61,7 +62,7 @@ export class DictPanel extends React.Component<DictPanelProps> { {...formItemLayout} label={t('opt_dict_panel_height_ratio')} >{ - this.props.form.getFieldDecorator('config#panelMaxHeightRatio', { + getFieldDecorator('config#panelMaxHeightRatio', { initialValue: config.panelMaxHeightRatio, rules: [{ type: 'number' }], })( @@ -72,7 +73,7 @@ export class DictPanel extends React.Component<DictPanelProps> { {...formItemLayout} label={t('opt_dict_panel_width')} >{ - this.props.form.getFieldDecorator('config#panelWidth', { + getFieldDecorator('config#panelWidth', { initialValue: config.panelWidth, })( <InputNumber formatter={v => `${v} px`} /> @@ -82,7 +83,7 @@ export class DictPanel extends React.Component<DictPanelProps> { {...formItemLayout} label={t('opt_dict_panel_font_size')} >{ - this.props.form.getFieldDecorator('config#fontSize', { + getFieldDecorator('config#fontSize', { initialValue: config.fontSize, })( <InputNumber formatter={v => `${v} px`} /> diff --git a/src/options/components/options/Dictionaries/DictForm.tsx b/src/options/components/options/Dictionaries/DictForm.tsx index 6fc938f81..1adb67c77 100644 --- a/src/options/components/options/Dictionaries/DictForm.tsx +++ b/src/options/components/options/Dictionaries/DictForm.tsx @@ -10,6 +10,7 @@ export type DictFormProps = Props & FormComponentProps export class DictForm extends React.Component<DictFormProps> { render () { const { t, config } = this.props + const { getFieldDecorator } = this.props.form return ( <Form> @@ -17,7 +18,7 @@ export class DictForm extends React.Component<DictFormProps> { {...formItemLayout} label={t('opt_autopron_cn')} >{ - this.props.form.getFieldDecorator('config#autopron#cn#dict', { + getFieldDecorator('config#autopron#cn#dict', { initialValue: config.autopron.cn.dict, })( <Select> @@ -34,7 +35,7 @@ export class DictForm extends React.Component<DictFormProps> { {...formItemLayout} label={t('opt_autopron_en')} >{ - this.props.form.getFieldDecorator('config#autopron#en#dict', { + getFieldDecorator('config#autopron#en#dict', { initialValue: config.autopron.en.dict, })( <Select> @@ -52,7 +53,7 @@ export class DictForm extends React.Component<DictFormProps> { {...formItemLayout} label={t('opt_autopron_accent')} >{ - this.props.form.getFieldDecorator('config#autopron#en#accent', { + getFieldDecorator('config#autopron#en#accent', { initialValue: config.autopron.en.accent, })( <Select> diff --git a/src/options/components/options/General/index.tsx b/src/options/components/options/General/index.tsx index 34012093d..3b693d4fc 100644 --- a/src/options/components/options/General/index.tsx +++ b/src/options/components/options/General/index.tsx @@ -15,6 +15,7 @@ export class General extends React.Component<Props & FormComponentProps> { render () { const { t, config } = this.props + const { getFieldDecorator } = this.props.form return ( <Form> @@ -26,7 +27,7 @@ export class General extends React.Component<Props & FormComponentProps> { label={t('opt_active')} help={t('opt_app_active_help')} >{ - this.props.form.getFieldDecorator('config#active', { + getFieldDecorator('config#active', { initialValue: config.active, valuePropName: 'checked', })( @@ -38,7 +39,7 @@ export class General extends React.Component<Props & FormComponentProps> { label={t('opt_animation')} help={t('opt_animation_help')} >{ - this.props.form.getFieldDecorator('config#animation', { + getFieldDecorator('config#animation', { initialValue: config.animation, valuePropName: 'checked', })( @@ -49,7 +50,7 @@ export class General extends React.Component<Props & FormComponentProps> { {...formItemLayout} label={t('opt_language')} >{ - this.props.form.getFieldDecorator('config#langCode', { + getFieldDecorator('config#langCode', { initialValue: config.langCode, })( <Select> diff --git a/src/options/components/options/Notebook/index.tsx b/src/options/components/options/Notebook/index.tsx index 9ee02f3a9..100e7354c 100644 --- a/src/options/components/options/Notebook/index.tsx +++ b/src/options/components/options/Notebook/index.tsx @@ -100,6 +100,7 @@ export class Notebook extends React.Component<NotebookProps> { render () { const { t, config, profile } = this.props const { syncServiceConfig } = this.state + const { getFieldDecorator } = this.props.form return ( <Form> @@ -109,7 +110,7 @@ export class Notebook extends React.Component<NotebookProps> { label={t('opt_edit_on_fav')} help={t('opt_edit_on_fav_help')} >{ - this.props.form.getFieldDecorator('config#editOnFav', { + getFieldDecorator('config#editOnFav', { initialValue: config.editOnFav, valuePropName: 'checked', })( @@ -121,7 +122,7 @@ export class Notebook extends React.Component<NotebookProps> { label={t('opt_history')} help={t('opt_history_help')} >{ - this.props.form.getFieldDecorator('config#searhHistory', { + getFieldDecorator('config#searhHistory', { initialValue: config.searhHistory, valuePropName: 'checked', })( @@ -133,7 +134,7 @@ export class Notebook extends React.Component<NotebookProps> { {...formItemLayout} label={t('opt_history_inco')} >{ - this.props.form.getFieldDecorator('config#searhHistoryInco', { + getFieldDecorator('config#searhHistoryInco', { initialValue: config.searhHistoryInco, valuePropName: 'checked', })( diff --git a/src/options/components/options/SearchModes/SearchMode.tsx b/src/options/components/options/SearchModes/SearchMode.tsx index 622e8caf3..c48f78f28 100644 --- a/src/options/components/options/SearchModes/SearchMode.tsx +++ b/src/options/components/options/SearchModes/SearchMode.tsx @@ -41,6 +41,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM render () { const { t, config, mode } = this.props const { isShowHolding } = this.state + const { getFieldDecorator } = this.props.form return ( <Form.Item @@ -49,7 +50,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM > {mode === 'mode' && ( <Form.Item help={t('opt_sm_icon_help')}>{ - this.props.form.getFieldDecorator(`config#${mode}#icon`, { + getFieldDecorator(`config#${mode}#icon`, { initialValue: config[mode].icon, valuePropName: 'checked', })( @@ -58,7 +59,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM }</Form.Item> )} <Form.Item help={t('opt_sm_direct_help')}>{ - this.props.form.getFieldDecorator(`config#${mode}#direct`, { + getFieldDecorator(`config#${mode}#direct`, { initialValue: config[mode].direct, valuePropName: 'checked', })( @@ -66,7 +67,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM ) }</Form.Item> <Form.Item help={t('opt_sm_double_help')}>{ - this.props.form.getFieldDecorator(`config#${mode}#double`, { + getFieldDecorator(`config#${mode}#double`, { initialValue: config[mode].double, valuePropName: 'checked', })( @@ -81,7 +82,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM {isShowHolding && <div> <Form.Item className='form-item-inline'>{ - this.props.form.getFieldDecorator(`config#${mode}#holding#shift`, { + getFieldDecorator(`config#${mode}#holding#shift`, { initialValue: config[mode].holding.shift, valuePropName: 'checked', })( @@ -89,7 +90,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM ) }</Form.Item> <Form.Item className='form-item-inline'>{ - this.props.form.getFieldDecorator(`config#${mode}#holding#ctrl`, { + getFieldDecorator(`config#${mode}#holding#ctrl`, { initialValue: config[mode].holding.ctrl, valuePropName: 'checked', })( @@ -97,7 +98,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM ) }</Form.Item> <Form.Item className='form-item-inline'>{ - this.props.form.getFieldDecorator(`config#${mode}#holding#meta`, { + getFieldDecorator(`config#${mode}#holding#meta`, { initialValue: config[mode].holding.meta, valuePropName: 'checked', })( @@ -108,7 +109,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM } </Form.Item> <Form.Item help={t('opt_sm_instant_help')}> - {this.props.form.getFieldDecorator(`config#${mode}#instant#enable`, { + {getFieldDecorator(`config#${mode}#instant#enable`, { initialValue: config[mode].instant.enable, valuePropName: 'checked', })( @@ -118,7 +119,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM <div> {t('opt_sm_instant_key') + ': '} <Form.Item className='form-item-inline'>{ - this.props.form.getFieldDecorator(`config#${mode}#instant#key`, { + getFieldDecorator(`config#${mode}#instant#key`, { initialValue: config[mode].instant.key, })( <Select style={{ width: 100 }}> @@ -132,7 +133,7 @@ export default class SearchMode extends React.Component<SearchModeProps, SearchM <span style={{ marginLeft: 20 }}>{t('opt_sm_instant_delay')}: </span> <Form.Item className='form-item-inline'>{ - this.props.form.getFieldDecorator(`config#${mode}#instant#delay`, { + getFieldDecorator(`config#${mode}#instant#delay`, { initialValue: config[mode].instant.delay, rules: [{ type: 'number' }], })( diff --git a/src/options/components/options/SearchModes/index.tsx b/src/options/components/options/SearchModes/index.tsx index dcb56af54..3675246bb 100644 --- a/src/options/components/options/SearchModes/index.tsx +++ b/src/options/components/options/SearchModes/index.tsx @@ -11,6 +11,7 @@ export type SearchModesProps = Props & FormComponentProps export class SearchModes extends React.Component<SearchModesProps> { render () { const { t, config } = this.props + const { getFieldDecorator } = this.props.form return ( <Form> @@ -19,7 +20,7 @@ export class SearchModes extends React.Component<SearchModesProps> { label={t('opt_no_type_field')} help={t('opt_no_type_field_help')} >{ - this.props.form.getFieldDecorator('config#noTypeField', { + getFieldDecorator('config#noTypeField', { initialValue: config.noTypeField, valuePropName: 'checked', })( @@ -33,7 +34,7 @@ export class SearchModes extends React.Component<SearchModesProps> { >{ ['chinese', 'english', 'minor'].map(lang => ( <Form.Item key={lang} className='form-item-inline'>{ - this.props.form.getFieldDecorator(`config#language#${lang}`, { + getFieldDecorator(`config#language#${lang}`, { initialValue: config.language[lang], valuePropName: 'checked', })( @@ -46,7 +47,7 @@ export class SearchModes extends React.Component<SearchModesProps> { {...formItemLayout} label={t('opt_double_click_delay')} >{ - this.props.form.getFieldDecorator('config#doubleClickDelay', { + getFieldDecorator('config#doubleClickDelay', { initialValue: config.doubleClickDelay, rules: [{ type: 'number' }], })(
style
clean code
8a473545dbf0f70435f55da472047a18fe7d16ce
2019-01-27 09:14:27
CRIMX
fix(options): wording
false
diff --git a/src/_locales/options/messages.json b/src/_locales/options/messages.json index d3ceeda94..332313977 100644 --- a/src/_locales/options/messages.json +++ b/src/_locales/options/messages.json @@ -351,8 +351,8 @@ }, "opt_edit_on_fav_help": { "en": "When turned off, new words will be added to notebook directly.", - "zh_CN": "关闭后,点击红心生词将至今添加到生词本,上下文翻译亦会自动获取。", - "zh_TW": "關閉後,點選紅心生詞將至今新增到生詞本,上下文翻譯亦會自動獲取。" + "zh_CN": "关闭后,点击红心生词将自动添加到生词本,上下文翻译亦会自动获取。", + "zh_TW": "關閉後,點選紅心生詞將自動新增到生詞本,上下文翻譯亦會自動獲取。" }, "opt_history": { "en": "Keep search history",
fix
wording
a0db5f948924634393b2de5e09cf1da370705ac3
2020-07-03 23:51:38
crimx
refactor: let hover box support portal
false
diff --git a/src/components/HoverBox/HoverBox.scss b/src/components/HoverBox/HoverBox.scss index 90e23d5e6..2c959cf47 100644 --- a/src/components/HoverBox/HoverBox.scss +++ b/src/components/HoverBox/HoverBox.scss @@ -7,10 +7,7 @@ .hoverBox-FloatBox { position: absolute; - left: 50%; - top: 40px; z-index: 1000; - transform: translateX(-50%); } .isAnimate { diff --git a/src/components/HoverBox/index.tsx b/src/components/HoverBox/index.tsx index 51bc19fc9..c143ea34e 100644 --- a/src/components/HoverBox/index.tsx +++ b/src/components/HoverBox/index.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react' +import React, { FC, useContext, useRef, useState } from 'react' import CSSTransition from 'react-transition-group/CSSTransition' import { useObservable, @@ -12,12 +12,24 @@ import { focusBlur, mapToTrue } from '@/_helpers/observables' -import { isOptionsPage } from '@/_helpers/saladict' import { FloatBox } from '../FloatBox' +import { createPortal } from 'react-dom' + +/** + * Accept a optional root element via Context which + * will be the parent element of the float boxes. + * This is for bypassing z-index restriction, making sure + * the float boxes is always on top of other elements. + */ +export const HoverBoxContext = React.createContext< + React.RefObject<HTMLElement | null> +>({ current: null }) export interface HoverBoxProps { Button: React.ComponentType<React.ComponentProps<'button'>> items: Array<{ key: string; content: React.ReactNode }> + top?: number + left?: number onSelect?: (key: string) => void onBtnClick?: () => void onHeightChanged?: (height: number) => void @@ -27,6 +39,9 @@ export interface HoverBoxProps { * A button and a FloatBox that shows when hovering. */ export const HoverBox: FC<HoverBoxProps> = props => { + const portalRootRef = useContext(HoverBoxContext) + const containerRef = useRef<HTMLDivElement | null>(null) + const [onHoverBtn, onHoverBtn$] = useObservableCallback< boolean, React.MouseEvent<Element> @@ -50,10 +65,22 @@ export const HoverBox: FC<HoverBoxProps> = props => { const isShowBox = isOnBtn || isOnBox + const [floatBoxStyle, setFloatBoxStyle] = useState<React.CSSProperties>(() => + props.left == null + ? { + top: props.top == null ? 40 : props.top, + left: '50%', + transform: 'translateX(-50%)' + } + : { + top: props.top == null ? 40 : props.top, + left: props.left + } + ) + return ( - <div className="hoverBox-Container"> + <div className="hoverBox-Container" ref={containerRef}> <props.Button - disabled={isOptionsPage()} onKeyDown={e => { if (e.key === 'ArrowDown') { e.preventDefault() @@ -71,27 +98,51 @@ export const HoverBox: FC<HoverBoxProps> = props => { timeout={100} mountOnEnter unmountOnExit + onEnter={() => { + if (portalRootRef.current && containerRef.current) { + const portalRootRect = portalRootRef.current.getBoundingClientRect() + const containerRect = containerRef.current.getBoundingClientRect() + setFloatBoxStyle({ + top: + containerRect.y - + portalRootRect.y + + (props.top == null ? 40 : props.top), + left: + containerRect.x - + portalRootRect.x + + (props.left == null + ? -Math.floor(containerRect.width / 2) + : props.left) + }) + } + }} onExited={() => props.onHeightChanged && props.onHeightChanged(0)} > - {() => ( - <div className="hoverBox-FloatBox"> - <FloatBox - list={props.items} - onFocus={onFocusBlur} - onBlur={onFocusBlur} - onMouseOver={onHoverBox} - onMouseOut={onHoverBox} - onArrowUpFirst={container => - (container.lastElementChild as HTMLButtonElement).focus() - } - onArrowDownLast={container => - (container.firstElementChild as HTMLButtonElement).focus() - } - onSelect={props.onSelect} - onHeightChanged={props.onHeightChanged} - /> - </div> - )} + {() => { + const floatBox = ( + <div className="hoverBox-FloatBox" style={floatBoxStyle}> + <FloatBox + list={props.items} + onFocus={onFocusBlur} + onBlur={onFocusBlur} + onMouseOver={onHoverBox} + onMouseOut={onHoverBox} + onArrowUpFirst={container => + (container.lastElementChild as HTMLButtonElement).focus() + } + onArrowDownLast={container => + (container.firstElementChild as HTMLButtonElement).focus() + } + onSelect={props.onSelect} + onHeightChanged={props.onHeightChanged} + /> + </div> + ) + + return portalRootRef.current && containerRef.current + ? createPortal(floatBox, portalRootRef.current) + : floatBox + }} </CSSTransition> </div> ) diff --git a/src/content/components/MenuBar/Profiles.tsx b/src/content/components/MenuBar/Profiles.tsx index 28a9a0346..e6feb0de0 100755 --- a/src/content/components/MenuBar/Profiles.tsx +++ b/src/content/components/MenuBar/Profiles.tsx @@ -3,6 +3,7 @@ import { TFunction } from 'i18next' import { getProfileName } from '@/_helpers/profile-manager' import { message } from '@/_helpers/browser-api' import { useTranslate } from '@/_helpers/i18n' +import { isOptionsPage } from '@/_helpers/saladict' import { HoverBox } from '@/components/HoverBox' import { OptionsBtn } from './MenubarBtns' @@ -53,5 +54,5 @@ export const Profiles: FC<ProfilesProps> = props => { function ProfilesBtn(props: React.ComponentProps<'button'>) { const { t } = useTranslate(['content']) - return <OptionsBtn {...props} t={t} /> + return <OptionsBtn {...props} t={t} disabled={isOptionsPage()} /> } diff --git a/src/content/components/MenuBar/Suggest.scss b/src/content/components/MenuBar/Suggest.scss index 28a6dda2e..88f1e014e 100644 --- a/src/content/components/MenuBar/Suggest.scss +++ b/src/content/components/MenuBar/Suggest.scss @@ -4,3 +4,7 @@ margin-right: 1.5em; color: #f9690e; } + +.menuBar-SuggestsExplain { + color: var(--color-font); +}
refactor
let hover box support portal
cdd4a5e9553e2692742f71ff9699d269284f3754
2020-04-23 00:19:40
crimx
refactor: remove url from config
false
diff --git a/src/app-config/auth.ts b/src/app-config/auth.ts index 5d264bba6..405083688 100644 --- a/src/app-config/auth.ts +++ b/src/app-config/auth.ts @@ -1,15 +1,9 @@ import { DictID } from '.' -const authReq = require.context( - '@/components/dictionaries', - true, - /auth\.(json|ts)$/ -) +const authReq = require.context('@/components/dictionaries', true, /auth\.ts$/) export type DictAuth = { [index: string]: string -} & { - url: string } export type DictAuths = { @@ -20,7 +14,7 @@ export const defaultDictAuths: DictAuths = authReq .keys() .reduce<DictAuths>((o, filename) => { const authModule = authReq(filename) - const dictID = /([^/]+)\/auth\.(json|ts)$/.exec(filename)![1] as DictID + const dictID = /([^/]+)\/auth\.ts$/.exec(filename)![1] as DictID o[dictID] = authModule.auth || authModule return o }, {}) diff --git a/src/components/dictionaries/baidu/auth.ts b/src/components/dictionaries/baidu/auth.ts index a38bb4260..f164b9130 100644 --- a/src/components/dictionaries/baidu/auth.ts +++ b/src/components/dictionaries/baidu/auth.ts @@ -2,6 +2,7 @@ import { DictAuth } from '@/app-config/auth' export const auth: DictAuth = { appid: '', - key: '', - url: 'http://api.fanyi.baidu.com/api/trans/product/prodinfo' + key: '' } + +export const url = 'http://api.fanyi.baidu.com/api/trans/product/prodinfo' diff --git a/src/components/dictionaries/caiyun/auth.ts b/src/components/dictionaries/caiyun/auth.ts index d322313ac..f57fa6dae 100644 --- a/src/components/dictionaries/caiyun/auth.ts +++ b/src/components/dictionaries/caiyun/auth.ts @@ -1,6 +1,7 @@ import { DictAuth } from '@/app-config/auth' export const auth: DictAuth = { - token: '', - url: 'https://fanyi.caiyunapp.com/#/api' + token: '' } + +export const url = 'https://fanyi.caiyunapp.com/#/api' diff --git a/src/components/dictionaries/sogou/auth.ts b/src/components/dictionaries/sogou/auth.ts index 151f258d4..3d673093d 100644 --- a/src/components/dictionaries/sogou/auth.ts +++ b/src/components/dictionaries/sogou/auth.ts @@ -2,6 +2,7 @@ import { DictAuth } from '@/app-config/auth' export const auth: DictAuth = { pid: '', - key: '', - url: 'https://deepi.sogou.com/?from=translatepc' + key: '' } + +export const url = 'https://deepi.sogou.com/?from=translatepc' diff --git a/src/components/dictionaries/tencent/auth.ts b/src/components/dictionaries/tencent/auth.ts index 519d2a68e..ee19e7e63 100644 --- a/src/components/dictionaries/tencent/auth.ts +++ b/src/components/dictionaries/tencent/auth.ts @@ -2,6 +2,7 @@ import { DictAuth } from '@/app-config/auth' export const auth: DictAuth = { secretId: '', - secretKey: '', - url: 'https://cloud.tencent.com/document/api/213/30654' + secretKey: '' } + +export const url = 'https://cloud.tencent.com/document/api/213/30654' diff --git a/src/components/dictionaries/youdaotrans/auth.ts b/src/components/dictionaries/youdaotrans/auth.ts index fda92dc3a..4848c5158 100644 --- a/src/components/dictionaries/youdaotrans/auth.ts +++ b/src/components/dictionaries/youdaotrans/auth.ts @@ -2,6 +2,7 @@ import { DictAuth } from '@/app-config/auth' export const auth: DictAuth = { appKey: '', - key: '', - url: 'http://ai.youdao.com/gw.s' + key: '' } + +export const url = 'http://ai.youdao.com/gw.s' diff --git a/src/options/components/Entries/DictAuths.tsx b/src/options/components/Entries/DictAuths.tsx index 9868fc1dd..c7da3b24e 100644 --- a/src/options/components/Entries/DictAuths.tsx +++ b/src/options/components/Entries/DictAuths.tsx @@ -29,28 +29,26 @@ export const DictAuths: FC = () => { const configPath = getConfigPath('dictAuth', dictID) const title = t(`dicts:${dictID}.name`) - objectKeys(auth) - .filter(key => key !== 'url') - .forEach((key, i, keys) => { - const isLast = i + 1 === keys.length - formItems.push({ - name: configPath + '.' + key, - label: i === 0 ? title + ' ' + key : key, - help: isLast ? ( - <Trans message={t('dictAuth.dictHelp')}> - <a - href={auth.url} - target="_blank" - rel="nofollow noopener noreferrer" - > - {title} - </a> - </Trans> - ) : null, - style: { marginBottom: isLast ? 10 : 5 }, - children: <Input /> - }) + objectKeys(auth).forEach((key, i, keys) => { + const isLast = i + 1 === keys.length + formItems.push({ + name: configPath + '.' + key, + label: i === 0 ? title + ' ' + key : key, + help: isLast ? ( + <Trans message={t('dictAuth.dictHelp')}> + <a + href={require(`@/components/dictionaries/${dictID}/auth.ts`).url} + target="_blank" + rel="nofollow noopener noreferrer" + > + {title} + </a> + </Trans> + ) : null, + style: { marginBottom: isLast ? 10 : 5 }, + children: <Input /> }) + }) }) return <SaladictForm items={formItems} />
refactor
remove url from config
cfc43b118747e95f61cb35cfecb64049816a6820
2018-07-27 00:00:15
CRIMX
chore(release): 6.8.2
false
diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b48e802..acaaa92be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="6.8.2"></a> +## [6.8.2](https://github.com/crimx/ext-saladict/compare/v6.8.1...v6.8.2) (2018-07-26) + + +### Bug Fixes + +* **panel:** triple ctrl auto search ([00a1381](https://github.com/crimx/ext-saladict/commit/00a1381)), closes [#174](https://github.com/crimx/ext-saladict/issues/174) + + + <a name="6.8.1"></a> ## [6.8.1](https://github.com/crimx/ext-saladict/compare/v6.8.0...v6.8.1) (2018-07-26) diff --git a/package.json b/package.json index c526872a3..1930fa8fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "saladict", - "version": "6.8.1", + "version": "6.8.2", "description": "Chrome extension and Firefox WebExtension, inline translator powered by mutiple online dictionaries", "private": true, "scripts": {
chore
6.8.2
772ccb4d4bb7bc556f54be5b49ab51de76e09d3c
2018-08-30 16:17:00
CRIMX
style(helpers): fix typing
false
diff --git a/src/_helpers/__mocks__/config-manager.ts b/src/_helpers/__mocks__/config-manager.ts index faa63c3c1..241e35c0f 100644 --- a/src/_helpers/__mocks__/config-manager.ts +++ b/src/_helpers/__mocks__/config-manager.ts @@ -1,5 +1,5 @@ import { AppConfig, appConfigFactory } from '@/app-config' -import { StorageListenerCb, StorageChange } from '@/_helpers/browser-api' +import { StorageListenerCb } from '@/_helpers/browser-api' // import { map } from 'rxjs/operators' // import { Observable, fromEventPattern, of, concat } from 'rxjs' import { Observable } from 'rxjs/Observable'
style
fix typing
98657ac78d09a8067f1344e0eec32c6f13ce21f0
2020-05-26 04:30:12
crimx
refactor(sync-services): rename startInterval to onStart
false
diff --git a/src/background/sync-manager/interface.ts b/src/background/sync-manager/interface.ts index 7e6edf1b7..580e2506c 100644 --- a/src/background/sync-manager/interface.ts +++ b/src/background/sync-manager/interface.ts @@ -69,8 +69,8 @@ export abstract class SyncService< async destroy() {} /** Download code */ async download(config: DownloadConfig): Promise<void> {} - /** Called on browser start */ - startInterval() {} + /** Called on browser start or config changes */ + onStart() {} } type SyncServiceAbstractClass = typeof SyncService diff --git a/src/background/sync-manager/services/webdav/index.ts b/src/background/sync-manager/services/webdav/index.ts index b8a96efa1..76627c4b9 100644 --- a/src/background/sync-manager/services/webdav/index.ts +++ b/src/background/sync-manager/services/webdav/index.ts @@ -46,7 +46,7 @@ export class Service extends SyncService<SyncConfig, SyncMeta> { meta: SyncMeta = {} - async startInterval() { + async onStart() { if (process.env.DEBUG) { console.log(`Sync Service WebDAV starts interval.`) }
refactor
rename startInterval to onStart
eff0fc8ffbcb8f264dba18ea8c0a367fc88dcc76
2019-09-07 23:16:14
crimx
refactor(popup): with new api
false
diff --git a/src/popup/Notebook.tsx b/src/popup/Notebook.tsx index 196d5360d..763b88fe3 100644 --- a/src/popup/Notebook.tsx +++ b/src/popup/Notebook.tsx @@ -1,6 +1,7 @@ -import React from 'react' -import { withTranslation, WithTranslation } from 'react-i18next' +import React, { FC, useEffect } from 'react' import { Word } from '@/_helpers/record-manager' +import { TFunction } from 'i18next' +import { useTranslate } from '@/_helpers/i18n' interface NotebookProps { word?: Word @@ -13,89 +14,88 @@ const wrapperStyle: React.CSSProperties = { fontSize: 14 } -export class Notebook extends React.Component<NotebookProps & WithTranslation> { - componentDidMount() { +export const Notebook: FC<NotebookProps> = ({ word, hasError }) => { + useEffect(() => { setTimeout(() => { window.close() }, 3000) - } + }, []) - renderError() { - return ( - <div style={wrapperStyle}> - <p> - <svg - width="100" - height="100" - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 426.667 426.667" - > - <path - fill="#f05228" - d="M213.333 0C95.514 0 0 95.514 0 213.333s95.514 213.333 213.333 213.333 213.333-95.514 213.333-213.333S331.153 0 213.333 0zm117.662 276.689l-54.302 54.306-63.36-63.356-63.36 63.36-54.302-54.31 63.356-63.356-63.356-63.36 54.302-54.302 63.36 63.356 63.36-63.356 54.302 54.302-63.356 63.36 63.356 63.356z" - /> - </svg> - </p> - <p>{this.props.t('notebook_error')}</p> - </div> - ) - } + const { t } = useTranslate('popup') - renderEmpty() { - return ( - <div style={wrapperStyle}> - <p> - <svg - width="100" - height="100" - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 426.667 426.667" - > - <g fill="#fac917"> - <path d="M213.338 0C95.509 0 0 95.497 0 213.325c0 117.854 95.509 213.342 213.338 213.342 117.82 0 213.329-95.488 213.329-213.342C426.667 95.497 331.157 0 213.338 0zm-.005 99.49c14.793 0 26.786 11.994 26.786 26.786s-11.998 26.782-26.786 26.782-26.786-11.994-26.786-26.782c0-14.792 11.994-26.786 26.786-26.786zm46.874 227.691H166.46v-40.183h20.087V206.64H166.46v-40.18h73.664v120.537h20.087v40.183h-.004z" /> - <path d="M325.935 394.449l93.615 25.08-25.084-93.611z" /> - </g> - </svg> - </p> - <p>{this.props.t('notebook_empty')}</p> - </div> - ) + if (hasError) { + return renderError(t) } - - renderSuccess(word: Word) { - return ( - <div style={wrapperStyle}> - <p> - <svg - width="100" - height="100" - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 426.667 426.667" - > - <path - fill="#6ac259" - d="M213.333 0C95.518 0 0 95.514 0 213.333s95.518 213.333 213.333 213.333c117.828 0 213.333-95.514 213.333-213.333S331.157 0 213.333 0zm-39.134 322.918l-93.935-93.931 31.309-31.309 62.626 62.622 140.894-140.898 31.309 31.309-172.203 172.207z" - /> - </svg> - </p> - <p> - {this.props.t('notebook_added')} 「{word.text}」 - </p> - </div> - ) + if (word && word.text) { + return renderSuccess(t, word) + } else { + return renderEmpty(t) } +} - render() { - const { word, hasError } = this.props - if (hasError) { - return this.renderError() - } - if (word && word.text) { - return this.renderSuccess(word) - } else { - return this.renderEmpty() - } - } +function renderError(t: TFunction) { + return ( + <div style={wrapperStyle}> + <p> + <svg + width="100" + height="100" + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 426.667 426.667" + > + <path + fill="#f05228" + d="M213.333 0C95.514 0 0 95.514 0 213.333s95.514 213.333 213.333 213.333 213.333-95.514 213.333-213.333S331.153 0 213.333 0zm117.662 276.689l-54.302 54.306-63.36-63.356-63.36 63.36-54.302-54.31 63.356-63.356-63.356-63.36 54.302-54.302 63.36 63.356 63.36-63.356 54.302 54.302-63.356 63.36 63.356 63.356z" + /> + </svg> + </p> + <p>{t('notebook_error')}</p> + </div> + ) +} + +function renderEmpty(t: TFunction) { + return ( + <div style={wrapperStyle}> + <p> + <svg + width="100" + height="100" + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 426.667 426.667" + > + <g fill="#fac917"> + <path d="M213.338 0C95.509 0 0 95.497 0 213.325c0 117.854 95.509 213.342 213.338 213.342 117.82 0 213.329-95.488 213.329-213.342C426.667 95.497 331.157 0 213.338 0zm-.005 99.49c14.793 0 26.786 11.994 26.786 26.786s-11.998 26.782-26.786 26.782-26.786-11.994-26.786-26.782c0-14.792 11.994-26.786 26.786-26.786zm46.874 227.691H166.46v-40.183h20.087V206.64H166.46v-40.18h73.664v120.537h20.087v40.183h-.004z" /> + <path d="M325.935 394.449l93.615 25.08-25.084-93.611z" /> + </g> + </svg> + </p> + <p>{t('notebook_empty')}</p> + </div> + ) +} + +function renderSuccess(t: TFunction, word: Word) { + return ( + <div style={wrapperStyle}> + <p> + <svg + width="100" + height="100" + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 426.667 426.667" + > + <path + fill="#6ac259" + d="M213.333 0C95.518 0 0 95.514 0 213.333s95.518 213.333 213.333 213.333c117.828 0 213.333-95.514 213.333-213.333S331.157 0 213.333 0zm-39.134 322.918l-93.935-93.931 31.309-31.309 62.626 62.622 140.894-140.898 31.309 31.309-172.203 172.207z" + /> + </svg> + </p> + <p> + {t('notebook_added')} 「{word.text}」 + </p> + </div> + ) } -export default withTranslation()(Notebook) +export default Notebook diff --git a/src/popup/Popup.tsx b/src/popup/Popup.tsx index b38f619f0..c1feb4a6b 100644 --- a/src/popup/Popup.tsx +++ b/src/popup/Popup.tsx @@ -1,160 +1,41 @@ -import React from 'react' +import React, { FC, useState, useRef, useEffect } from 'react' import QRCode from 'qrcode.react' import CSSTransition from 'react-transition-group/CSSTransition' -import { withTranslation, WithTranslation } from 'react-i18next' import { AppConfig } from '@/app-config' -import { updateConfig } from '@/_helpers/config-manager' +import { updateConfig, addConfigListener } from '@/_helpers/config-manager' import { message } from '@/_helpers/browser-api' +import { useTranslate } from '@/_helpers/i18n' +import { DictPanelStandaloneContainer } from '@/content/components/DictPanel/DictPanelStandalone.container' interface PopupProps { config: AppConfig } -interface PopupState { - currentTabUrl: string - isShowUrlBox: boolean - tempOff: boolean - showPageNoResponse: boolean - insCapMode: 'mode' | 'pinMode' -} - -export class Popup extends React.Component< - PopupProps & WithTranslation, - PopupState -> { - state: PopupState = { - currentTabUrl: '', - isShowUrlBox: false, - tempOff: false, - showPageNoResponse: false, - insCapMode: 'mode' as 'mode' | 'pinMode' - } +export const Popup: FC<PopupProps> = props => { + const { t } = useTranslate('popup') - activeContainer = () => { - const $frameRoot = document.querySelector<HTMLDivElement>('#frame-root') - if ($frameRoot) { - $frameRoot.style.height = '400px' - } - } + const [config, setConfig] = useState(props.config) - hideContainer = () => { - const $frameRoot = document.querySelector<HTMLDivElement>('#frame-root') - if ($frameRoot) { - $frameRoot.style.height = '500px' - this.setState({ currentTabUrl: '' }) - } - } + /** URL box with QR code */ + const [isShowUrlBox, setIsShowUrlBox] = useState(false) + const [currentTabUrl, setCurrentTabUrl] = useState('') - changeTempOff = () => { - const oldTempOff = this.state.tempOff - const newTempOff = !oldTempOff + const [isExpandDictPanel, setDictPanel] = useState(false) + const expandDictPanel = useRef(() => setDictPanel(true)).current + const shrinkDictPanel = useRef(() => setDictPanel(false)).current - this.setState({ tempOff: newTempOff }) + /** Instant Capture Mode */ + const [insCapMode, setInsCapMode] = useState<'mode' | 'pinMode'>('mode') - browser.tabs - .query({ active: true, currentWindow: true }) - .then(tabs => { - if (tabs.length > 0 && tabs[0].id != null) { - return message.send<'TEMP_DISABLED_STATE'>(tabs[0].id, { - type: 'TEMP_DISABLED_STATE', - payload: { - op: 'set', - value: newTempOff - } - }) - } - return false - }) - .then(isSuccess => { - if (!isSuccess) { - this.setState({ tempOff: oldTempOff }) - throw new Error('Set tempOff failed') - } - }) - .catch(() => this.setState({ showPageNoResponse: true })) - } - - changeInsCap = () => { - const { config } = this.props - const { insCapMode } = this.state - const newConfig: AppConfig = { - ...config, - [insCapMode]: { - ...config[insCapMode], - instant: { - ...config[insCapMode].instant, - enable: !config[insCapMode].instant.enable - } - } - } - updateConfig(newConfig) - } - - showQRcode = async () => { - const tabs = await browser.tabs.query({ active: true, currentWindow: true }) - if (tabs.length > 0) { - const url = tabs[0].url - if (url) { - if (!url.startsWith('http')) { - const match = /static\/pdf\/web\/viewer\.html\?file=(.*)$/.exec(url) - if (match) { - this.setState({ - isShowUrlBox: true, - currentTabUrl: decodeURIComponent(match[1]) - }) - return - } - } - this.setState({ - isShowUrlBox: false, - currentTabUrl: url - }) - } - } - } - - changeActive = () => { - const { config } = this.props - const newConfig = { - ...config, - active: !config.active - } - updateConfig(newConfig) - } + const [isTempOff, setTempOff] = useState(false) - clearCurrentTabUrl = () => { - this.setState({ currentTabUrl: '' }) - } + const [isShowPageNoResponse, setShowPageNoResponse] = useState(false) - renderQRPanel = () => { - const { t } = this.props - const { isShowUrlBox, currentTabUrl, showPageNoResponse } = this.state - return ( - <div className="qrcode-panel" onMouseLeave={this.clearCurrentTabUrl}> - <QRCode value={currentTabUrl} size={250} /> - <p className="qrcode-panel-title"> - {isShowUrlBox ? ( - <input - type="text" - autoFocus - readOnly - value={currentTabUrl} - onFocus={e => e.currentTarget.select()} - /> - ) : ( - <span>{t('qrcode_title')}</span> - )} - </p> - {showPageNoResponse && ( - <div className="page-no-response-panel"> - <p className="page-no-response-title">{t('page_no_response')}</p> - </div> - )} - </div> - ) - } + useEffect(() => { + addConfigListener(({ newConfig }) => { + setConfig(newConfig) + }) - componentDidMount() { browser.tabs .query({ active: true, currentWindow: true }) .then(tabs => { @@ -165,7 +46,7 @@ export class Popup extends React.Component< payload: { op: 'get' } }) .then(flag => { - this.setState({ tempOff: flag }) + setTempOff(flag) }) message @@ -174,24 +55,25 @@ export class Popup extends React.Component< payload: 'widget.isPinned' }) .then(isPinned => { - this.setState({ insCapMode: isPinned ? 'pinMode' : 'mode' }) + setInsCapMode(isPinned ? 'pinMode' : 'mode') }) } }) .catch(err => console.warn('Error when receiving MsgTempDisabled response', err) ) - } - - render() { - const { t, config } = this.props - const { currentTabUrl, tempOff, insCapMode } = this.state - - return ( + }, []) + + return ( + <div className="popup-root"> + <DictPanelStandaloneContainer + width={450} + height={isExpandDictPanel ? 500 : 400} + /> <div className="switch-container" - onMouseEnter={this.activeContainer} - onMouseLeave={this.hideContainer} + onMouseEnter={shrinkDictPanel} + onMouseLeave={expandDictPanel} > <div className="active-switch"> <span className="switch-title">{t('app_temp_active_title')}</span> @@ -199,9 +81,9 @@ export class Popup extends React.Component< type="checkbox" id="opt-temp-active" className="btn-switch" - checked={tempOff} - onClick={this.changeTempOff} - onFocus={this.activeContainer} + checked={isTempOff} + onChange={toggleTempOff} + onFocus={shrinkDictPanel} /> <label htmlFor="opt-temp-active"></label> </div> @@ -215,15 +97,15 @@ export class Popup extends React.Component< id="opt-instant-capture" className="btn-switch" checked={config[insCapMode].instant.enable} - onClick={this.changeInsCap} - onFocus={this.activeContainer} + onChange={toggleInsCap} + onFocus={shrinkDictPanel} /> <label htmlFor="opt-instant-capture"></label> </div> <div className="active-switch"> <svg className="icon-qrcode" - onMouseEnter={this.showQRcode} + onMouseEnter={showQRcode} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 612 612" > @@ -241,8 +123,8 @@ export class Popup extends React.Component< id="opt-active" className="btn-switch" checked={config.active} - onClick={this.changeActive} - onFocus={this.activeContainer} + onChange={toggleAppActive} + onFocus={shrinkDictPanel} /> <label htmlFor="opt-active"></label> </div> @@ -254,11 +136,105 @@ export class Popup extends React.Component< mountOnEnter unmountOnExit > - {this.renderQRPanel} + {() => ( + <div + className="qrcode-panel" + onMouseLeave={() => setCurrentTabUrl('')} + > + <QRCode value={currentTabUrl} size={250} /> + <p className="qrcode-panel-title"> + {isShowUrlBox ? ( + <input + type="text" + autoFocus + readOnly + value={currentTabUrl} + onFocus={e => e.currentTarget.select()} + /> + ) : ( + <span>{t('qrcode_title')}</span> + )} + </p> + {isShowPageNoResponse && ( + <div className="page-no-response-panel"> + <p className="page-no-response-title"> + {t('page_no_response')} + </p> + </div> + )} + </div> + )} </CSSTransition> </div> - ) + </div> + ) + + function toggleTempOff() { + const newTempOff = !isTempOff + + setTempOff(newTempOff) + + browser.tabs + .query({ active: true, currentWindow: true }) + .then(tabs => { + if (tabs.length > 0 && tabs[0].id != null) { + return message.send<'TEMP_DISABLED_STATE'>(tabs[0].id, { + type: 'TEMP_DISABLED_STATE', + payload: { + op: 'set', + value: newTempOff + } + }) + } + return false + }) + .then(isSuccess => { + if (!isSuccess) { + setTempOff(!newTempOff) + throw new Error('Set tempOff failed') + } + }) + .catch(() => setShowPageNoResponse(true)) + } + + function toggleInsCap() { + updateConfig({ + ...config, + [insCapMode]: { + ...config[insCapMode], + instant: { + ...config[insCapMode].instant, + enable: !config[insCapMode].instant.enable + } + } + }) + } + + function toggleAppActive() { + updateConfig({ + ...config, + active: !config.active + }) + } + + async function showQRcode() { + const tabs = await browser.tabs.query({ active: true, currentWindow: true }) + if (tabs.length > 0) { + const url = tabs[0].url + if (url) { + if (!url.startsWith('http')) { + const match = /pdf\/web\/viewer\.html\?file=(.*)$/.exec(url) + if (match) { + setIsShowUrlBox(true) + setCurrentTabUrl(decodeURIComponent(match[1])) + return + } + } + setIsShowUrlBox(false) + setCurrentTabUrl(url) + } + } } } -export default withTranslation()(Popup) +export default Popup diff --git a/src/popup/_style.scss b/src/popup/_style.scss index bb2d4bbb1..4684f7e24 100644 --- a/src/popup/_style.scss +++ b/src/popup/_style.scss @@ -12,55 +12,23 @@ body { margin: 0; padding: 0; overflow: hidden; - font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; + font-family: 'Helvetica Neue', Helvetica, Arial, 'Hiragino Sans GB', + 'Hiragino Sans GB W3', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif; } -#frame-root { - position: relative; - z-index: 100; - height: 0; - - // hide white spaces - font-size: 0; +/*------------------------------------*\ + Components +\*------------------------------------*/ - &::after { - content: ''; - position: absolute; - top: 100%; - left: 0; - width: 100%; - height: 10px; - box-shadow: inset 0 10px 6px -6px rgba(0,0,0,.13); - pointer-events: none; - } -} +@import '@/content/components/DictPanel/DictPanelStandalone.scss'; -body.panel { +.popup-root { + overflow: hidden; + display: flex; + flex-direction: column-reverse; width: 450px; height: 550px; font-size: 14px; - - #frame-root { - height: 500px; - transition: height 0.5s; - } - - #root { - position: absolute; - bottom: 0; - width: 100%; - } -} - -.saladict-DIV { - height: 100%; -} - -.saladict-DictPanel { - position: static; - overflow: hidden; - height: 100%; - transition: height 0.5s; } .qrcode-panel { @@ -193,10 +161,10 @@ $switch-button-height: 35px; .fade-enter { opacity: 0; - transition: opacity .5s; + transition: opacity 0.5s; } .fade-enter-active { opacity: 1; - transition: opacity .5s; + transition: opacity 0.5s; } diff --git a/src/popup/index.tsx b/src/popup/index.tsx index aeaf1ea56..ecc1bcf8f 100644 --- a/src/popup/index.tsx +++ b/src/popup/index.tsx @@ -1,55 +1,27 @@ import React from 'react' import ReactDOM from 'react-dom' -import Popup from './Popup' -import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' -import { injectAnalytics } from '@/_helpers/analytics' import { AppConfig } from '@/app-config' -import { getConfig, addConfigListener } from '@/_helpers/config-manager' +import { injectAnalytics } from '@/_helpers/analytics' +import { getConfig } from '@/_helpers/config-manager' import { message, openURL } from '@/_helpers/browser-api' import { saveWord, Word } from '@/_helpers/record-manager' -import Notebook from './Notebook' import { translateCtx } from '@/_helpers/translateCtx' +import { Message } from '@/typings/message' + +import { Provider as ProviderRedux } from 'react-redux' +import createStore from '@/content/redux/create' import { I18nextProvider as ProviderI18next } from 'react-i18next' import { i18nLoader } from '@/_helpers/i18n' +import Popup from './Popup' +import Notebook from './Notebook' import './_style.scss' -import { Message } from '@/typings/message' // inject panel AFTER flags are set window.__SALADICT_INTERNAL_PAGE__ = true window.__SALADICT_POPUP_PAGE__ = true -interface AppProps { - i18n: ReturnType<typeof i18nLoader> - config: AppConfig -} - -interface AppState { - config: AppConfig -} - -class App extends React.Component<AppProps, AppState> { - state: AppState = { - config: this.props.config - } - - componentDidMount() { - addConfigListener(({ newConfig }) => { - document.body.style.width = newConfig.panelWidth + 'px' - this.setState({ config: newConfig }) - }) - } - - render() { - return ( - <ProviderI18next i18n={this.props.i18n}> - <Popup config={this.state.config} /> - </ProviderI18next> - ) - } -} - getConfig().then(config => { document.body.style.width = config.panelWidth + 'px' @@ -70,19 +42,16 @@ getConfig().then(config => { }) function showPanel(config: AppConfig) { - document.body.classList.add('panel') - injectSaladictInternal(true) - if (config.analytics) { injectAnalytics('/popup') } - const i18n = i18nLoader() - i18n.loadNamespaces('popup') - i18n.setDefaultNamespace('popup') - ReactDOM.render( - <App config={config} i18n={i18n} />, + <ProviderRedux store={createStore()}> + <ProviderI18next i18n={i18nLoader()}> + <Popup config={config} /> + </ProviderI18next> + </ProviderRedux>, document.getElementById('root') ) } @@ -113,12 +82,8 @@ async function addNotebook() { hasError = true } - const i18n = i18nLoader() - i18n.loadNamespaces('popup') - i18n.setDefaultNamespace('popup') - ReactDOM.render( - <ProviderI18next i18n={i18n}> + <ProviderI18next i18n={i18nLoader()}> <Notebook word={word} hasError={hasError} /> </ProviderI18next>, document.getElementById('root')
refactor
with new api
34393fbdbda7708ce8698a31e20a7aca7a287cc1
2019-07-12 20:06:02
CRIMX
chore(storybook): rename path
false
diff --git a/src/content/components/SaladBowl/SaladBowl.stories.tsx b/src/content/components/SaladBowl/SaladBowl.stories.tsx index 21134bce9..ce2be308d 100644 --- a/src/content/components/SaladBowl/SaladBowl.stories.tsx +++ b/src/content/components/SaladBowl/SaladBowl.stories.tsx @@ -6,11 +6,11 @@ import { SaladBowl } from './SaladBowl' import { SaladBowlShadow } from './SaladBowl.shadow' import { SaladBowlPortal } from './SaladBowl.portal' -storiesOf('Content|SaladBowl', module) +storiesOf('Content Scripts|SaladBowl', module) .addDecorator(withKnobs) .add('SaladBowl', () => ( <div> - <style>{require('../style.shadow.scss').toString()}</style> + <style>{require('./style.shadow.scss').toString()}</style> <SaladBowl mouseX={number('mouseX', 0)} mouseY={number('mouseY', 0)}
chore
rename path
0f3fbe85ee44cb4e039f6a3520887ba4834cdf37
2018-02-08 22:29:10
CRIMX
refactor(helpers): add config manager
false
diff --git a/src/_helpers/config-manager.ts b/src/_helpers/config-manager.ts new file mode 100644 index 000000000..466f08b65 --- /dev/null +++ b/src/_helpers/config-manager.ts @@ -0,0 +1,48 @@ +import { AppConfig, appConfigFactory } from '@/app-config' +import { storage, StorageListenerCb } from './browser-api' +import { map } from 'rxjs/operators' +import { Observable } from 'rxjs/Observable' +import { concat } from 'rxjs/observable/concat' +import { fromPromise } from 'rxjs/observable/fromPromise' + +export type AppConfigChanged = { + config: { + newValue: AppConfig, + oldValue?: AppConfig, + } +} + +export function getAppConfig (): Promise<AppConfig> { + return storage.sync.get<{ config?: AppConfig }>('config') + .then(({ config }) => { + if (config && typeof config.version) { + return config + } + return appConfigFactory() + }) +} + +export function setAppConfig (config: AppConfig): Promise<void> { + return storage.sync.set({ config }) +} + +export function addAppConfigListener (cb: StorageListenerCb): void { + return storage.sync.addListener('config', cb) +} + +/** + * Get AppConfig and create a stream listening config changing + */ +export function createAppConfigStream (): Observable<AppConfig> { + return concat<AppConfig>( + fromPromise(getAppConfig()), + storage.createStream<AppConfigChanged>('config').pipe(map(x => x.config.newValue)), + ) +} + +export const appConfig = { + get: getAppConfig, + set: setAppConfig, + addListener: addAppConfigListener, + createStream: createAppConfigStream, +}
refactor
add config manager
7dc226cefafc4f2f49542b89293e0a70dd932ac6
2022-06-25 09:28:07
FantasqueX
fix: correct regex of locating default pdf (#1775)
false
diff --git a/scripts/pdf.js b/scripts/pdf.js index dae28185..4c85e242 100644 --- a/scripts/pdf.js +++ b/scripts/pdf.js @@ -66,7 +66,7 @@ async function modifyViewrJS() { file = '/* saladict */ window.__SALADICT_PDF_PAGE__ = true;\n' + file // change default pdf - const defaultPDFTester = /defaultUrl: {[\s\S]*?value: (['"]\S+?.pdf['"]),[\s\S]*?kind: OptionKind\.VIEWER/ + const defaultPDFTester = /defaultUrl = {[\s\S]*?value: (['"]\S+?.pdf['"]),[\s\S]*?kind: OptionKind\.VIEWER/ if (!defaultPDFTester.test(file)) { shell.echo('Could not locate default pdf in viewer.js') shell.exit(1)
fix
correct regex of locating default pdf (#1775)
a79ddf81d3ac3c56503f25d8e2dcdc6a9fddfd2c
2018-05-11 13:59:27
CRIMX
test(panel): update snapshots
false
diff --git a/test/specs/components/content/__snapshots__/DictItem.spec.tsx.snap b/test/specs/components/content/__snapshots__/DictItem.spec.tsx.snap index 7deaac6d2..1ff957e8c 100644 --- a/test/specs/components/content/__snapshots__/DictItem.spec.tsx.snap +++ b/test/specs/components/content/__snapshots__/DictItem.spec.tsx.snap @@ -3,6 +3,7 @@ exports[`Component/content/DictItem should render pending correctly 1`] = ` <section className="panel-DictItem" + onClick={[Function]} > <header className="panel-DictItem_Header"
test
update snapshots
6440e600b77488677fa9bfe3117693761a9a2944
2019-10-18 14:25:30
crimx
refactor(dicts): dict item string options
false
diff --git a/src/app-config/dicts.ts b/src/app-config/dicts.ts index 2e59e3dd8..affa31428 100644 --- a/src/app-config/dicts.ts +++ b/src/app-config/dicts.ts @@ -107,18 +107,29 @@ type DictItemWithOptions< : DictItemBase & { options: Options } /** - * SelKeys is a subset of keyof Options for `string` type options. - * For example: - * Options = { lang: 'zh' | 'en', isFoo: boolean } - * SelKeys should be 'lang' + * If an option is of `string` type there will be an array + * of options in `options_sel` field. */ export type DictItem< Options extends | { [option: string]: number | boolean | string } | undefined = undefined, - SelKeys extends string | number | undefined = undefined -> = SelKeys extends keyof Options - ? DictItemWithOptions<Options> & { - options_sel: { [key in SelKeys]: Options[key][] } - } - : DictItemWithOptions<Options> + Key extends keyof Options = Options extends undefined ? never : keyof Options +> = Options extends undefined + ? DictItemWithOptions + : DictItemWithOptions<Options> & + ((Key extends any + ? Options[Key] extends string + ? Key + : never + : never) extends never + ? {} + : { + options_sel: { + [opt in Key extends any + ? Options[Key] extends string + ? Key + : never + : never]: Options[opt][] + } + }) diff --git a/src/components/dictionaries/hjdict/config.ts b/src/components/dictionaries/hjdict/config.ts index 07cc465c2..6dfc297b8 100644 --- a/src/components/dictionaries/hjdict/config.ts +++ b/src/components/dictionaries/hjdict/config.ts @@ -1,16 +1,13 @@ import { DictItem } from '@/app-config/dicts' -export type HjdictConfig = DictItem< - { - related: boolean - chsas: 'jp/cj' | 'jp/jc' | 'kr' | 'w' | 'fr' | 'de' | 'es' - engas: 'w' | 'fr' | 'de' | 'es' - uas: 'fr' | 'de' | 'es' - aas: 'fr' | 'de' - eas: 'fr' | 'es' - }, - 'chsas' | 'engas' | 'uas' | 'aas' | 'eas' -> +export type HjdictConfig = DictItem<{ + related: boolean + chsas: 'jp/cj' | 'jp/jc' | 'kr' | 'w' | 'fr' | 'de' | 'es' + engas: 'w' | 'fr' | 'de' | 'es' + uas: 'fr' | 'de' | 'es' + aas: 'fr' | 'de' + eas: 'fr' | 'es' +}> export default (): HjdictConfig => ({ lang: '10011111', diff --git a/src/components/dictionaries/jukuu/config.ts b/src/components/dictionaries/jukuu/config.ts index 89ce64370..f797ef7e1 100644 --- a/src/components/dictionaries/jukuu/config.ts +++ b/src/components/dictionaries/jukuu/config.ts @@ -1,11 +1,8 @@ import { DictItem } from '@/app-config/dicts' -export type JukuuConfig = DictItem< - { - lang: 'zheng' | 'engjp' | 'zhjp' - }, - 'lang' -> +export type JukuuConfig = DictItem<{ + lang: 'zheng' | 'engjp' | 'zhjp' +}> export default (): JukuuConfig => ({ lang: '11010000', diff --git a/src/components/dictionaries/wikipedia/config.ts b/src/components/dictionaries/wikipedia/config.ts index c4f9462ab..73edcece4 100644 --- a/src/components/dictionaries/wikipedia/config.ts +++ b/src/components/dictionaries/wikipedia/config.ts @@ -1,20 +1,8 @@ import { DictItem } from '@/app-config/dicts' -export type WikipediaConfig = DictItem< - { - lang: - | 'auto' - | 'zh' - | 'zh-cn' - | 'zh-tw' - | 'zh-hk' - | 'en' - | 'ja' - | 'fr' - | 'de' - }, - 'lang' -> +export type WikipediaConfig = DictItem<{ + lang: 'auto' | 'zh' | 'zh-cn' | 'zh-tw' | 'zh-hk' | 'en' | 'ja' | 'fr' | 'de' +}> export default (): WikipediaConfig => ({ lang: '11110000', diff --git a/src/typings/helpers.ts b/src/typings/helpers.ts index 29c237d0d..b5ba492ec 100644 --- a/src/typings/helpers.ts +++ b/src/typings/helpers.ts @@ -22,3 +22,5 @@ export type UnionKeys<T> = T extends any ? keyof T : never export type UnionPick<T, K extends UnionKeys<T>> = T extends any ? Pick<T, Extract<K, keyof T>> : never + +export type Subunion<T, U extends T> = U
refactor
dict item string options
8c2939e628c05902223f33421c085e34cbf63603
2018-05-06 19:01:17
CRIMX
feat(content): add animation switch
false
diff --git a/src/content/components/DictItem/_style.scss b/src/content/components/DictItem/_style.scss index b896338d2..37bc6b960 100644 --- a/src/content/components/DictItem/_style.scss +++ b/src/content/components/DictItem/_style.scss @@ -54,20 +54,6 @@ height: 10px; border-radius: 50%; background: orange; - animation: panel-DictItem_Loader-shift 2s linear infinite; - - &:nth-child(2) { - animation-delay: -0.4s; - } - &:nth-child(3) { - animation-delay: -0.8s; - } - &:nth-child(4) { - animation-delay: -1.2s; - } - &:nth-child(5) { - animation-delay: -1.6s; - } } .panel-DictItem_FoldArrowBtn { @@ -88,7 +74,6 @@ width: 18px; height: 18px; padding: 3px; - transition: transform 400ms; &.isActive { transform: rotate(-90deg); @@ -113,20 +98,23 @@ &::after { content: ''; position: absolute; - top: 0; - bottom: 0; + top: 100%; left: 0; - right: 0; + width: 100%; + height: 100%; background: linear-gradient(transparent 40%, rgba(225, 225, 225, .2) 60%, rgba(225, 225, 225, .7) 100%); - opacity: 0; - transition: opacity 400ms; } &:hover { outline: none; &::after { - opacity: 1; + /** + * use top instead of opacity to avoid GUP acceleration + * which might casue iframe flickering in Chrome 66 + * @todo add back after Chrome 68 + */ + top: 0; } } @@ -146,6 +134,37 @@ fill: #000; } +/*-----------------------------------------------*\ + States +\*-----------------------------------------------*/ + +.isAnimate { + .panel-DictItem_Loader_Ball { + animation: panel-DictItem_Loader-shift 2s linear infinite; + + &:nth-child(2) { + animation-delay: -0.4s; + } + &:nth-child(3) { + animation-delay: -0.8s; + } + &:nth-child(4) { + animation-delay: -1.2s; + } + &:nth-child(5) { + animation-delay: -1.6s; + } + } + + .panel-DictItem_FoldArrow { + transition: transform 400ms; + } + + .panel-DictItem_FoldMask::after { + transition: top 400ms; + } +} + /** * remove GPU acceleration which might casue iframe flickering in Chrome 66 * @todo add back after Chrome 68 diff --git a/src/content/components/DictItem/index.tsx b/src/content/components/DictItem/index.tsx index 250575f3e..124d424d1 100644 --- a/src/content/components/DictItem/index.tsx +++ b/src/content/components/DictItem/index.tsx @@ -20,6 +20,7 @@ export interface DictItemProps extends DictItemDispatchers { readonly panelWidth: number readonly searchStatus: SearchStatus readonly searchResult: any + readonly isAnimation: boolean } export type DictItemState = { @@ -159,6 +160,7 @@ export class DictItem extends React.PureComponent<DictItemProps & { t: Translati fontSize, searchStatus, searchResult, + isAnimation, } = this.props const { @@ -189,7 +191,7 @@ export class DictItem extends React.PureComponent<DictItemProps & { t: Translati </svg> </button> </header> - <Spring from={this.initStyle} to={{ height: visibleHeight, opacity: isUnfold ? 1 : 0 }}> + <Spring from={this.initStyle} to={{ height: visibleHeight, opacity: isUnfold ? 1 : 0 }} immediate={!isAnimation}> {({ height, opacity }) => ( <div className='panel-DictItem_Body' key={id} diff --git a/src/content/components/DictPanel/index.tsx b/src/content/components/DictPanel/index.tsx index d084ea074..d6e0aac99 100644 --- a/src/content/components/DictPanel/index.tsx +++ b/src/content/components/DictPanel/index.tsx @@ -73,7 +73,7 @@ export default class DictPanel extends React.Component<DictPanelProps> { panelPinSwitch, closePanel, })} - <div className='panel-DictContainer'> + <div className={`panel-DictContainer${config.animation ? ' isAnimate' : ''}`}> {config.dicts.selected.map(id => React.createElement(DictItem, { key: id, id, @@ -81,6 +81,7 @@ export default class DictPanel extends React.Component<DictPanelProps> { fontSize: config.fontSize, preferredHeight: allDictsConfig[id].preferredHeight, panelWidth: config.panelWidth, + isAnimation: config.animation, searchStatus: (dictsInfo[id] as any).searchStatus, searchResult: (dictsInfo[id] as any).searchResult, searchText, diff --git a/src/content/components/DictPanelPortal/index.tsx b/src/content/components/DictPanelPortal/index.tsx index ba8f20386..0dfbe7bbf 100644 --- a/src/content/components/DictPanelPortal/index.tsx +++ b/src/content/components/DictPanelPortal/index.tsx @@ -218,6 +218,8 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp shouldPanelShow, } = this.props + const isAnimation = this.props.config.animation + const { x, y, height, isDragging } = this.state if (shouldPanelShow && !this.isMount) { @@ -247,7 +249,7 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp width: this.props.config.panelWidth, opacity: shouldPanelShow ? 1 : 0 }} - immediate={!shouldPanelShow || isDragging} + immediate={!isAnimation || !shouldPanelShow || isDragging} >{this.animateFrame}</Spring> </div>, this.el, diff --git a/src/content/components/MenuBar/_style.scss b/src/content/components/MenuBar/_style.scss index 97059299a..a9793eaa3 100644 --- a/src/content/components/MenuBar/_style.scss +++ b/src/content/components/MenuBar/_style.scss @@ -46,13 +46,6 @@ padding: 4px; } -.panel-MenuBar_Btn-close { - @extend .panel-MenuBar_Btn; - &:hover > svg { - animation: panel-MenuBar_Spin 400ms linear infinite; - } -} - .panel-MenuBar_DragArea { flex: 1.5; align-self: stretch; @@ -106,8 +99,3 @@ transform: rotate(45deg); } } - -@keyframes panel-MenuBar_Spin { - from { transform: rotate(0deg); } - to { transform: rotate(360deg); } -} diff --git a/src/content/components/MenuBar/index.tsx b/src/content/components/MenuBar/index.tsx index 5f18f9d4c..75be94318 100644 --- a/src/content/components/MenuBar/index.tsx +++ b/src/content/components/MenuBar/index.tsx @@ -300,7 +300,7 @@ export class MenuBar extends React.PureComponent<MenuBarProps & { t: Translation </svg> </button> - <button className='panel-MenuBar_Btn-close' + <button className='panel-MenuBar_Btn' onClick={this.handleIconCloseClick} disabled={isSaladictOptionsPage} > diff --git a/src/content/components/SaladBowlPortal/index.tsx b/src/content/components/SaladBowlPortal/index.tsx index d1df7cc55..6aa15d9f9 100644 --- a/src/content/components/SaladBowlPortal/index.tsx +++ b/src/content/components/SaladBowlPortal/index.tsx @@ -5,6 +5,7 @@ import SaladBowl from '../SaladBowl' interface SaladBowlPortalProps { readonly shouldShow: boolean + readonly isAnimation: boolean readonly mouseX: number readonly mouseY: number readonly mouseOnBowl: (flag: boolean) => any @@ -17,6 +18,10 @@ export default class SaladBowlPortal extends React.Component<SaladBowlPortalProp isAppeare = false springImmediateCtrl = (key: string): boolean => { + if (!this.props.isAnimation) { + return true + } + switch (key) { case 'x': case 'y': diff --git a/src/content/components/WordEditorPortal/index.tsx b/src/content/components/WordEditorPortal/index.tsx index ea2ad7fed..07d260e61 100644 --- a/src/content/components/WordEditorPortal/index.tsx +++ b/src/content/components/WordEditorPortal/index.tsx @@ -15,6 +15,7 @@ export interface WordEditorPortalProps extends Omit< 'saveToNotebook' | 'getWordsByText' > { shouldWordEditorShow: boolean + isAnimation: boolean } export default class WordEditorPortal extends React.Component<WordEditorPortalProps> { @@ -61,6 +62,7 @@ export default class WordEditorPortal extends React.Component<WordEditorPortalPr render () { const { shouldWordEditorShow, + isAnimation, ...restProps, } = this.props @@ -86,7 +88,7 @@ export default class WordEditorPortal extends React.Component<WordEditorPortalPr getWordsByText: getWordsByTextFromNotebook, })} </PortalFrame> - <Spring from={{ opacity: 0 }} to={{ opacity: 1 }} render={this.animateFrame} /> + <Spring from={{ opacity: 0 }} to={{ opacity: 1 }} render={this.animateFrame} immediate={!isAnimation} /> </> ) : null, diff --git a/src/content/containers/SaladBowlContainer.tsx b/src/content/containers/SaladBowlContainer.tsx index 8987b3548..ae3900806 100644 --- a/src/content/containers/SaladBowlContainer.tsx +++ b/src/content/containers/SaladBowlContainer.tsx @@ -6,6 +6,7 @@ import { mouseOnBowl } from '../redux/modules/widget' export const mapStateToProps = ({ config, selection, widget }: StoreState) => { return { shouldShow: widget.shouldBowlShow, + isAnimation: config.animation, mouseX: selection.mouseX, mouseY: selection.mouseY, } diff --git a/src/content/containers/WordEditorContainer.tsx b/src/content/containers/WordEditorContainer.tsx index ea90b3e5f..d100844b6 100644 --- a/src/content/containers/WordEditorContainer.tsx +++ b/src/content/containers/WordEditorContainer.tsx @@ -8,6 +8,7 @@ import { SelectionInfo } from '@/_helpers/selection' export const mapStateToProps = ({ config, dictionaries, widget }: StoreState) => { return { shouldWordEditorShow: widget.shouldWordEditorShow, + isAnimation: config.animation, dictPanelWidth: config.panelWidth, info: dictionaries.searchHistory[0], }
feat
add animation switch
3d29f105c1288e90bd55160221a859099eed4d49
2019-08-15 14:19:15
crimx
refactor: remove float box max height
false
diff --git a/src/content/components/MenuBar/FloatBox.scss b/src/content/components/MenuBar/FloatBox.scss index 7e50de74c..bfeea1641 100644 --- a/src/content/components/MenuBar/FloatBox.scss +++ b/src/content/components/MenuBar/FloatBox.scss @@ -1,6 +1,5 @@ .menuBar-FloatBoxContainer { max-width: calc(var(--panel-width) * 0.7); - max-height: calc(var(--panel-height) * 0.8); padding: 10px; word-break: keep-all; white-space: nowrap; @@ -16,8 +15,7 @@ } .menuBar-FloatBox { - width: 100%; - height: 100%; + // max-height: calc(var(--panel-height) * 0.8); overflow: hidden; }
refactor
remove float box max height
ce0e252706e20f77bd4e150762d10910d75382dc
2018-05-13 00:43:02
CRIMX
fix(panel): only set immediate to x and y when dragging
false
diff --git a/src/content/components/DictPanelPortal/index.tsx b/src/content/components/DictPanelPortal/index.tsx index d8a339271..3be9f6941 100644 --- a/src/content/components/DictPanelPortal/index.tsx +++ b/src/content/components/DictPanelPortal/index.tsx @@ -162,6 +162,24 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp return null } + panelImmediateCtrl = (key: string) => { + if (!this.props.config.animation || !this.props.shouldPanelShow) { + return true + } + + if (this.state.isDragging) { + switch (key) { + case 'x': + case 'y': + return true + default: + break + } + } + + return false + } + onFrameAnimationEnd = () => { clearTimeout(this._frameAnimationEndTimeout) @@ -259,8 +277,6 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp shouldPanelShow, } = this.props - const isAnimation = this.props.config.animation - const { x, y, height, isDragging } = this.state const width = isSaladictPopupPage @@ -293,7 +309,7 @@ export default class DictPanelPortal extends React.Component<DictPanelPortalProp x, y, height, width, opacity: shouldPanelShow ? 1 : 0 }} - immediate={!isAnimation || !shouldPanelShow || isDragging} + immediate={this.panelImmediateCtrl} onRest={this.onFrameAnimationEnd} >{this.animateFrame}</Spring> </div>,
fix
only set immediate to x and y when dragging
09f929ff3e97a230eb0e9cf149e212d3d789ebdf
2018-05-22 23:30:01
CRIMX
feat(dicts): add helper
false
diff --git a/src/components/dictionaries/helpers.ts b/src/components/dictionaries/helpers.ts index 22600b573..34c43c49e 100644 --- a/src/components/dictionaries/helpers.ts +++ b/src/components/dictionaries/helpers.ts @@ -1,3 +1,9 @@ export function handleNoResult<T> (): Promise<T> { return Promise.reject('No result') } + +export function getText (parent: ParentNode, selector?: string): string { + const child = selector ? parent.querySelector(selector) : parent + if (!child) { return '' } + return child['textContent'] || '' +}
feat
add helper
de9ca077c23147859ebc648b3202faa5b25bca15
2020-04-29 21:19:17
crimx
feat(profiles): add shortcuts for top profiles
false
diff --git a/src/_locales/manifest/en/messages.json b/src/_locales/manifest/en/messages.json index 09ab5ecc8..5bd92bb3d 100644 --- a/src/_locales/manifest/en/messages.json +++ b/src/_locales/manifest/en/messages.json @@ -37,5 +37,20 @@ }, "command_prev_profile": { "message": "Previous Profile" + }, + "command_profile_1": { + "message": "First Profile" + }, + "command_profile_2": { + "message": "Second Profile" + }, + "command_profile_3": { + "message": "Third Profile" + }, + "command_profile_4": { + "message": "Fourth Profile" + }, + "command_profile_5": { + "message": "Fifth Profile" } } diff --git a/src/_locales/manifest/zh_CN/messages.json b/src/_locales/manifest/zh_CN/messages.json index e62291554..7dbd05369 100644 --- a/src/_locales/manifest/zh_CN/messages.json +++ b/src/_locales/manifest/zh_CN/messages.json @@ -37,5 +37,20 @@ }, "command_prev_profile": { "message": "上一个情景模式" + }, + "command_profile_1": { + "message": "第一个情景模式" + }, + "command_profile_2": { + "message": "第二个情景模式" + }, + "command_profile_3": { + "message": "第三个情景模式" + }, + "command_profile_4": { + "message": "第四个情景模式" + }, + "command_profile_5": { + "message": "第五个情景模式" } } diff --git a/src/_locales/manifest/zh_TW/messages.json b/src/_locales/manifest/zh_TW/messages.json index 918fbb09a..c87c6ae3c 100644 --- a/src/_locales/manifest/zh_TW/messages.json +++ b/src/_locales/manifest/zh_TW/messages.json @@ -37,5 +37,20 @@ }, "command_prev_profile": { "message": "上一個情景模式" + }, + "command_profile_1": { + "message": "第一個情景模式" + }, + "command_profile_2": { + "message": "第二個情景模式" + }, + "command_profile_3": { + "message": "第三個情景模式" + }, + "command_profile_4": { + "message": "第四個情景模式" + }, + "command_profile_5": { + "message": "第五個情景模式" } } diff --git a/src/background/initialization.ts b/src/background/initialization.ts index 4e8e5e6b8..17896c4f6 100644 --- a/src/background/initialization.ts +++ b/src/background/initialization.ts @@ -86,25 +86,36 @@ function onCommand(command: string) { break case 'next-profile': case 'prev-profile': - browser.tabs - .query({ active: true, currentWindow: true }) - .then(async tabs => { - if (tabs.length <= 0 || tabs[0].id == null) { - return - } + { + const curID = window.activeProfile.id + const curIndex = window.profileIDList.findIndex( + ({ id }) => id === curID + ) + const offset = command === 'next-profile' ? 1 : -1 + const nextIndex = + curIndex < 0 ? 0 : (curIndex + offset) % window.profileIDList.length - const curID = window.activeProfile.id - const curIndex = window.profileIDList.findIndex( - ({ id }) => id === curID + updateActiveProfileID(window.profileIDList[nextIndex].id).then( + searchTextBox + ) + } + break + case 'profile-1': + case 'profile-2': + case 'profile-3': + case 'profile-4': + case 'profile-5': + { + const index = +command.slice(-1) + if ( + index < window.profileIDList.length && + window.profileIDList[index].id !== window.activeProfile.id + ) { + updateActiveProfileID(window.profileIDList[index].id).then( + searchTextBox ) - const offset = command === 'next-profile' ? 1 : -1 - const nextIndex = - curIndex < 0 ? 0 : (curIndex + offset) % window.profileIDList.length - - await updateActiveProfileID(window.profileIDList[nextIndex].id) - await timer(10) - message.send(tabs[0].id, { type: 'SEARCH_TEXT_BOX' }) - }) + } + } break } } @@ -177,37 +188,40 @@ async function onInstalled({ } function onStartup(): void { - if (!process.env.DEBUG && window.appConfig.updateCheck) { - storage.local - .get<{ lastCheckUpdate: number }>('lastCheckUpdate') - .then(async ({ lastCheckUpdate }) => { - const today = Date.now() - if (!lastCheckUpdate) { - storage.local.set({ lastCheckUpdate: today }) - } else if (today - lastCheckUpdate > 7 * 24 * 60 * 60 * 1000) { - storage.local.set({ lastCheckUpdate: today }) - const { data, diff } = await checkUpdate( - browser.runtime.getManifest().version - ) - if (data && diff > 0) { - const options: browser.notifications.CreateNotificationOptions = { - type: 'basic', - iconUrl: browser.runtime.getURL(`assets/icon-128.png`), - title: getText('%E6%B2%99%E6%8B%89%E6%9F%A5%E8%AF%8D'), - message: `${getText('%E5%8F%AF%E6%9B%B4%E6%96%B0%E8%87%B3')}【${ - data.version - }】` - } - if (!isFirefox) { - options.buttons = [ - { title: getText('%E6%9F%A5%E7%9C%8B%E6%9B%B4%E6%96%B0') } - ] + setTimeout(() => { + // wait for appConfig being loaded + if (!process.env.DEBUG && window.appConfig.updateCheck) { + storage.local + .get<{ lastCheckUpdate: number }>('lastCheckUpdate') + .then(async ({ lastCheckUpdate }) => { + const today = Date.now() + if (!lastCheckUpdate) { + storage.local.set({ lastCheckUpdate: today }) + } else if (today - lastCheckUpdate > 7 * 24 * 60 * 60 * 1000) { + storage.local.set({ lastCheckUpdate: today }) + const { data, diff } = await checkUpdate( + browser.runtime.getManifest().version + ) + if (data && diff > 0) { + const options: browser.notifications.CreateNotificationOptions = { + type: 'basic', + iconUrl: browser.runtime.getURL(`assets/icon-128.png`), + title: getText('%E6%B2%99%E6%8B%89%E6%9F%A5%E8%AF%8D'), + message: `${getText('%E5%8F%AF%E6%9B%B4%E6%96%B0%E8%87%B3')}【${ + data.version + }】` + } + if (!isFirefox) { + options.buttons = [ + { title: getText('%E6%9F%A5%E7%9C%8B%E6%9B%B4%E6%96%B0') } + ] + } + browser.notifications.create('update', options) } - browser.notifications.create('update', options) } - } - }) - } + }) + } + }, 1000) if (!process.env.DEBUG && isExtTainted) { storage.local.get<{ swat: number }>('swat').then(({ swat }) => { @@ -273,3 +287,16 @@ async function loadDictPanelToAllTabs() { } }) } + +/** Search text box text on active tab */ +async function searchTextBox() { + const tabs = await browser.tabs.query({ + active: true, + currentWindow: true + }) + if (tabs.length <= 0 || tabs[0].id == null) { + return + } + await timer(10) + message.send(tabs[0].id, { type: 'SEARCH_TEXT_BOX' }) +} diff --git a/src/content/redux/epics/index.ts b/src/content/redux/epics/index.ts index 5766a19dd..fa4336c0c 100644 --- a/src/content/redux/epics/index.ts +++ b/src/content/redux/epics/index.ts @@ -1,9 +1,9 @@ import { combineEpics } from 'redux-observable' import { from, of, empty } from 'rxjs' -import { map, mapTo, mergeMap, filter } from 'rxjs/operators' +import { map, mapTo, mergeMap, filter, skip } from 'rxjs/operators' import { isPopupPage, isStandalonePage } from '@/_helpers/saladict' -import { saveWord } from '@/_helpers/record-manager' +import { saveWord, newWord } from '@/_helpers/record-manager' import { StoreAction, StoreState } from '../modules' import { ofType } from './utils' @@ -100,6 +100,30 @@ export const epics = combineEpics<StoreAction, StoreAction, StoreState>( ) }) ), + // could not find a way to query browser action page from background + // here we listen active profile changes and trigger searching + (action$, state$) => + action$.pipe( + filter(() => isPopupPage()), + ofType('NEW_ACTIVE_PROFILE'), + skip(1), // skip the initial data + map(() => { + const { searchHistory, historyIndex, text } = state$.value + return { + type: 'SEARCH_START', + payload: { + word: + searchHistory[historyIndex]?.text === text + ? searchHistory[historyIndex] + : newWord({ + text, + title: 'Saladict', + favicon: 'https://saladict.crimx.com/favicon.ico' + }) + } + } + }) + ), newSelectionEpic, searchStartEpic ) diff --git a/src/manifest/common.manifest.js b/src/manifest/common.manifest.js index c4da19c76..516783c10 100644 --- a/src/manifest/common.manifest.js +++ b/src/manifest/common.manifest.js @@ -44,6 +44,21 @@ module.exports = { }, 'prev-profile': { description: '__MSG_command_prev_profile__' + }, + 'profile-1': { + description: '__MSG_command_profile_1__' + }, + 'profile-2': { + description: '__MSG_command_profile_2__' + }, + 'profile-3': { + description: '__MSG_command_profile_3__' + }, + 'profile-4': { + description: '__MSG_command_profile_4__' + }, + 'profile-5': { + description: '__MSG_command_profile_5__' } }, @@ -69,5 +84,5 @@ module.exports = { optional_permissions: ['clipboardWrite'], - content_security_policy: "script-src 'self'; object-src 'self'" + content_security_policy: "script-src 'self' 'unsafe-eval'; object-src 'self'" } diff --git a/src/manifest/firefox.manifest.json b/src/manifest/firefox.manifest.json index 8b0e247a3..34a613a76 100644 --- a/src/manifest/firefox.manifest.json +++ b/src/manifest/firefox.manifest.json @@ -7,5 +7,6 @@ "id": "[email protected]", "strict_min_version": "67.0" } - } + }, + "content_security_policy": "script-src 'self'; object-src 'self'" }
feat
add shortcuts for top profiles
255e5fe74953b5c7076cde4d8344d7523963f8e3
2019-01-15 18:07:20
CRIMX
refactor(popup): remove vue
false
diff --git a/package.json b/package.json index 56a14844c..34b060b24 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@types/i18next": "^8.4.3", "@types/lodash": "^4.14.98", "@types/node": "^9.3.0", + "@types/qrcode.react": "^0.8.1", "@types/react": "^16.3.14", "@types/react-dom": "^16.0.5", "@types/react-i18next": "^7.3.2", @@ -60,6 +61,7 @@ "lodash": "^4.17.4", "md5": "^2.2.1", "normalize-scss": "^7.0.1", + "qrcode.react": "^0.9.2", "react": "^16.4.0", "react-dom": "^16.4.0", "react-i18next": "^7.6.0", @@ -69,7 +71,6 @@ "redux-thunk": "^2.2.0", "rxjs": "5.x", "vue": "^2.5.13", - "vue-qriously": "^1.1.1", "vue-stash": "^2.0.1-beta", "vuedraggable": "^2.16.0", "web-ext-types": "crimx/web-ext-types" diff --git a/src/popup/Popup.tsx b/src/popup/Popup.tsx new file mode 100644 index 000000000..d485bb68a --- /dev/null +++ b/src/popup/Popup.tsx @@ -0,0 +1,283 @@ +import React from 'react' +import QRCode from 'qrcode.react' +import CSSTransition from 'react-transition-group/CSSTransition' +import { translate } from 'react-i18next' +import { TranslationFunction } from 'i18next' +import { message } from '@/_helpers/browser-api' +import { appConfigFactory, AppConfig } from '@/app-config' +import { createActiveConfigStream, updateActiveConfig } from '@/_helpers/config-manager' +import { + MsgType, + MsgQueryPanelState, + MsgTempDisabledState, +} from '@/typings/message' + +interface PopupState { + config: AppConfig + currentTabUrl: string + isShowUrlBox: boolean + tempOff: boolean + showPageNoResponse: boolean + insCapMode: 'mode' | 'pinMode' +} + +export class Popup extends React.Component<{ t: TranslationFunction }, PopupState> { + state = { + config: appConfigFactory(), + currentTabUrl: '', + isShowUrlBox: false, + tempOff: false, + showPageNoResponse: false, + insCapMode: 'mode' as 'mode' | 'pinMode', + } + + constructor (props: any) { + super(props) + createActiveConfigStream().subscribe(config => { + this.setState({ config }) + }) + + browser.tabs.query({ active: true, currentWindow: true }) + .then(tabs => { + if (tabs.length > 0 && tabs[0].id != null) { + message.send<MsgTempDisabledState>( + tabs[0].id as number, + { + type: MsgType.TempDisabledState, + op: 'get', + }, + ).then(flag => { + this.setState({ tempOff: flag }) + }) + + message.send<MsgQueryPanelState, boolean>( + tabs[0].id as number, + { + type: MsgType.QueryPanelState, + path: 'widget.isPinned', + }, + ).then(isPinned => { + this.setState({ insCapMode: isPinned ? 'pinMode' : 'mode' }) + }) + } + }) + .catch(err => console.warn('Error when receiving MsgTempDisabled response', err)) + } + + activeContainer = () => { + const $frameRoot = document.querySelector<HTMLDivElement>('#frame-root') + const $container = document.querySelector<HTMLDivElement>('.switch-container-wrap') + if ($frameRoot && $container) { + $frameRoot.style.height = '400px' + $container.style.height = '150px' + } + } + + hideContainer = () => { + const $frameRoot = document.querySelector<HTMLDivElement>('#frame-root') + const $container = document.querySelector<HTMLDivElement>('.switch-container-wrap') + if ($frameRoot && $container) { + $frameRoot.style.height = '500px' + $container.style.height = '50px' + this.setState({ currentTabUrl: '' }) + } + } + + changeTempOff = () => { + const oldTempOff = this.state.tempOff + const newTempOff = !oldTempOff + + this.setState({ tempOff: newTempOff }) + + browser.tabs.query({ active: true, currentWindow: true }) + .then(tabs => { + if (tabs.length > 0 && tabs[0].id != null) { + return message.send<MsgTempDisabledState>( + tabs[0].id as number, + { + type: MsgType.TempDisabledState, + op: 'set', + value: newTempOff, + }, + ) + } + }) + .then(isSuccess => { + if (!isSuccess) { + this.setState({ tempOff: oldTempOff }) + return Promise.reject(new Error('Set tempOff failed')) as Promise<any> + } + }) + .catch(() => this.setState({ showPageNoResponse: true })) + } + + changeInsCap = () => { + const { config, insCapMode } = this.state + const newConfig: AppConfig = { + ...config, + [insCapMode]: { + ...config[insCapMode], + instant: { + ...config[insCapMode].instant, + enable: !config[insCapMode].instant.enable + } + } + } + this.setState({ config: newConfig }) + updateActiveConfig(newConfig) + } + + showQRcode = () => { + chrome.tabs.query({ active: true, currentWindow: true }, tabs => { + if (tabs.length > 0) { + const url = tabs[0].url + if (url) { + if (!url.startsWith('http')) { + const match = /static\/pdf\/web\/viewer\.html\?file=(.*)$/.exec(url) + if (match) { + this.setState({ + isShowUrlBox: true, + currentTabUrl: decodeURIComponent(match[1]), + }) + return + } + } + this.setState({ + isShowUrlBox: false, + currentTabUrl: url, + }) + } + } + }) + } + + changeActive = () => { + const { config } = this.state + const newConfig = { + ...config, + active: !config.active + } + this.setState({ config: newConfig }) + updateActiveConfig(newConfig) + } + + clearCurrentTabUrl = () => { + this.setState({ currentTabUrl: '' }) + } + + renderQRPanel = () => { + const { t } = this.props + const { + isShowUrlBox, + currentTabUrl, + showPageNoResponse, + } = this.state + return ( + <div className='qrcode-panel' onMouseLeave={this.clearCurrentTabUrl}> + <QRCode value={currentTabUrl} size={250} /> + <p className='qrcode-panel-title'> + {isShowUrlBox + ? <input + type='text' + autoFocus + readOnly + value={currentTabUrl} + onFocus={e => e.currentTarget.select()} + /> + : <span>{t('qrcode_title')}</span> + } + </p> + {showPageNoResponse && + <div className='page-no-response-panel'> + <p className='page-no-response-title'>{t('page_no_response')}</p> + </div> + } + </div> + ) + } + + render () { + const { t } = this.props + const { + config, + currentTabUrl, + tempOff, + insCapMode, + } = this.state + + return ( + <div + className='switch-container-wrap' + onMouseEnter={this.activeContainer} + onMouseLeave={this.hideContainer} + > + <div className='switch-container'> + <div className='active-switch'> + <span className='switch-title'>{t('app_temp_active_title')}</span> + <input + type='checkbox' + id='opt-temp-active' + className='btn-switch' + checked={tempOff} + onClick={this.changeTempOff} + onFocus={this.activeContainer} + /> + <label htmlFor='opt-temp-active'></label> + </div> + <div className='active-switch'> + <span className='switch-title'>{ + t('instant_capture_title') + + (insCapMode === 'pinMode' ? t('instant_capture_pinned') : '') + }</span> + <input + type='checkbox' + id='opt-instant-capture' + className='btn-switch' + checked={config[insCapMode].instant.enable} + onClick={this.changeInsCap} + onFocus={this.activeContainer} + /> + <label htmlFor='opt-instant-capture'></label> + </div> + <div className='active-switch'> + <svg + className='icon-qrcode' + onMouseEnter={this.showQRcode} + xmlns='http://www.w3.org/2000/svg' + viewBox='0 0 612 612' + > + <path d='M0 225v25h250v-25H0zM0 25h250V0H0v25z'/> + <path d='M0 250h25V0H0v250zm225 0h25V0h-25v250zM87.5 162.5h75v-75h-75v75zM362 587v25h80v-25h-80zm0-200h80v-25h-80v25z'/> + <path d='M362 612h25V362h-25v250zm190-250v25h60v-25h-60zm-77.5 87.5v25h50v-25h-50z'/> + <path d='M432 497.958v-25h-70v25h70zM474.5 387h50v-25h-50v25zM362 225v25h250v-25H362zm0-200h250V0H362v25z'/> + <path d='M362 250h25V0h-25v250zm225 0h25V0h-25v250zm-137.5-87.5h75v-75h-75v75zM0 587v25h250v-25H0zm0-200h250v-25H0v25z'/> + <path d='M0 612h25V362H0v250zm225 0h25V362h-25v250zM87.5 524.5h75v-75h-75v75zM587 612h25V441h-25v171zM474.5 499.5v25h50v-25h-50z'/> + <path d='M474.5 449.5v75h25v-75h-25zM562 587v25h50v-25h-50z'/> + </svg> + <span className='switch-title'>{t('app_active_title')}</span> + <input + type='checkbox' + id='opt-active' + className='btn-switch' + checked={config.active} + onClick={this.changeActive} + onFocus={this.activeContainer} + /> + <label htmlFor='opt-active'></label> + </div> + </div> + <CSSTransition + classNames='fade' + in={!!currentTabUrl} + appear + timeout={500} + exit={false} + mountOnEnter + unmountOnExit + >{this.renderQRPanel}</CSSTransition> + </div> + ) + } +} + +export default translate()(Popup) diff --git a/src/popup/Popup.vue b/src/popup/Popup.vue deleted file mode 100644 index 49b30a538..000000000 --- a/src/popup/Popup.vue +++ /dev/null @@ -1,374 +0,0 @@ -<template> -<div class="switch-container-wrap" @mouseenter="activeContainer" @mouseleave="hideContainer"> - <div class="switch-container"> - <div class="active-switch"> - <span class="switch-title">{{ $t('app_temp_active_title') }}</span> - <input type="checkbox" id="opt-temp-active" class="btn-switch" v-model="tempOff" @click.prevent="changeTempOff" @focus="activeContainer"> - <label for="opt-temp-active"></label> - </div> - <div class="active-switch"> - <span class="switch-title">{{ $t('instant_capture_title') + (insCapMode === 'pinMode' ? $t('instant_capture_pinned') : '') }}</span> - <input type="checkbox" id="opt-instant-capture" class="btn-switch" v-model="config[insCapMode].instant.enable" @click.prevent="changeInsCap" @focus="activeContainer"> - <label for="opt-instant-capture"></label> - </div> - <div class="active-switch"> - <svg class="icon-qrcode" @mouseenter="showQRcode" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 612 612"> - <path d="M0 225v25h250v-25H0zM0 25h250V0H0v25z"/> - <path d="M0 250h25V0H0v250zm225 0h25V0h-25v250zM87.5 162.5h75v-75h-75v75zM362 587v25h80v-25h-80zm0-200h80v-25h-80v25z"/> - <path d="M362 612h25V362h-25v250zm190-250v25h60v-25h-60zm-77.5 87.5v25h50v-25h-50z"/> - <path d="M432 497.958v-25h-70v25h70zM474.5 387h50v-25h-50v25zM362 225v25h250v-25H362zm0-200h250V0H362v25z"/> - <path d="M362 250h25V0h-25v250zm225 0h25V0h-25v250zm-137.5-87.5h75v-75h-75v75zM0 587v25h250v-25H0zm0-200h250v-25H0v25z"/> - <path d="M0 612h25V362H0v250zm225 0h25V362h-25v250zM87.5 524.5h75v-75h-75v75zM587 612h25V441h-25v171zM474.5 499.5v25h50v-25h-50z"/> - <path d="M474.5 449.5v75h25v-75h-25zM562 587v25h50v-25h-50z"/> - </svg> - <span class="switch-title">{{ $t('app_active_title') }}</span> - <input type="checkbox" id="opt-active" class="btn-switch" :checked="config.active" @click.prevent="changeActive" @focus="activeContainer"> - <label for="opt-active"></label> - </div> - </div> - <transition name="fade"> - <div class="qrcode-panel" v-if="currentTabUrl" @mouseleave="currentTabUrl = ''"> - <qriously :value="currentTabUrl" :size="250" /> - <p class="qrcode-panel-title"> - <input v-if="isShowUrlBox" v-select type="text" readonly :value="currentTabUrl"> - <span v-else>{{ $t('qrcode_title') }}</span> - </p> - </div> - </transition> - <transition name="fade"> - <div class="page-no-response-panel" v-if="showPageNoResponse"> - <p class="page-no-response-title">{{ $t('page_no_response') }}</p> - </div> - </transition> -</div> -</template> - -<script lang="ts"> -import Vue from 'vue' -import { message, storage } from '@/_helpers/browser-api' -import { MsgType, MsgTempDisabledState, MsgIsPinned, MsgQueryPanelState } from '@/typings/message' -import { appConfigFactory, AppConfigMutable } from '@/app-config' -import { createActiveConfigStream, updateActiveConfig } from '@/_helpers/config-manager' - -export default Vue.extend({ - name: 'Popup', - data () { - return { - config: appConfigFactory() as AppConfigMutable, - currentTabUrl: '', - isShowUrlBox: false, - tempOff: false, - showPageNoResponse: false, - insCapMode: 'mode' as 'mode' | 'pinMode', - } - }, - watch: { - showPageNoResponse (val) { - if (val) { - clearTimeout(this['__pageNoResponseTimeout']) - this['__pageNoResponseTimeout'] = setTimeout(() => { - this.showPageNoResponse = false - }, 2000) - } - } - }, - methods: { - changeActive () { - this.config.active = !this.config.active - updateActiveConfig(this.config) - }, - changeTempOff () { - const newTempOff = !this.tempOff - - browser.tabs.query({ active: true, currentWindow: true }) - .then(tabs => { - if (tabs.length > 0 && tabs[0].id != null) { - return message.send<MsgTempDisabledState>( - tabs[0].id as number, - { - type: MsgType.TempDisabledState, - op: 'set', - value: newTempOff, - }, - ) - } - }) - .then(isSuccess => { - if (isSuccess) { - this.tempOff = newTempOff - } else { - return Promise.reject(new Error('Set tempOff failed')) as Promise<any> - } - }) - .catch(() => this.showPageNoResponse = true) - }, - changeInsCap () { - this.config[this.insCapMode].instant.enable = !this.config[this.insCapMode].instant.enable - updateActiveConfig(this.config) - }, - showQRcode () { - chrome.tabs.query({active: true, currentWindow: true}, tabs => { - if (tabs.length > 0) { - const url = tabs[0].url - if (url) { - if (!url.startsWith('http')) { - const match = /static\/pdf\/web\/viewer\.html\?file=(.*)$/.exec(url) - if (match) { - this.isShowUrlBox = true - this.currentTabUrl = decodeURIComponent(match[1]) - return - } - } - this.isShowUrlBox = false - this.currentTabUrl = url - } - } - }) - }, - activeContainer () { - const $frameRoot = document.querySelector<HTMLDivElement>('#frame-root') - const $container = document.querySelector<HTMLDivElement>('.switch-container-wrap') - if ($frameRoot && $container) { - $frameRoot.style.height = '400px' - $container.style.height = '150px' - } - }, - hideContainer () { - const $frameRoot = document.querySelector<HTMLDivElement>('#frame-root') - const $container = document.querySelector<HTMLDivElement>('.switch-container-wrap') - if ($frameRoot && $container) { - $frameRoot.style.height = '500px' - $container.style.height = '50px' - this.currentTabUrl = '' - } - }, - }, - created () { - createActiveConfigStream().subscribe(config => { - this.config = config as AppConfigMutable - document.body.style.width = config.panelWidth + 'px' - }) - - browser.tabs.query({ active: true, currentWindow: true }) - .then(tabs => { - if (tabs.length > 0 && tabs[0].id != null) { - message.send<MsgTempDisabledState>( - tabs[0].id as number, - { - type: MsgType.TempDisabledState, - op: 'get', - }, - ).then(flag => { - this.tempOff = flag - }) - - message.send<MsgQueryPanelState, boolean>( - tabs[0].id as number, - { - type: MsgType.QueryPanelState, - path: 'widget.isPinned', - }, - ).then(isPinned => { - this.insCapMode = isPinned ? 'pinMode' : 'mode' - }) - } - }) - .catch(err => console.warn('Error when receiving MsgTempDisabled response', err)) - }, -}) -</script> - -<style lang="scss"> -/*------------------------------------*\ - Base -\*------------------------------------*/ -html { - margin: 0; - padding: 0; - overflow: hidden; -} - -body { - width: 450px; - height: 550px; - margin: 0; - padding: 0; - overflow: hidden; - font-size: 14px; - font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei UI", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; -} - -#frame-root { - height: 500px; - transition: height 0.5s; - - // hide white spaces - font-size: 0; -} - -.saladict-DIV { - height: 100%; -} - -.saladict-DictPanel { - position: static; - overflow: hidden; - height: 100%; - transition: height 0.5s; -} - -.qrcode-panel { - position: fixed; - z-index: 100; - bottom: 10px; - left: 10px; - padding: 10px; - background: #fff; - border-radius: 10px; - box-shadow: rgba(0, 0, 0, 0.8) 0px 4px 23px -6px; -} - -.qrcode-panel-title { - text-align: center; - margin: 5px 0 0 0; - - input { - width: 100%; - } -} - -.page-no-response-panel { - position: fixed; - z-index: 100; - bottom: 60px; - right: 25px; - padding: 0 10px; - background: #fff; - border-radius: 10px; - box-shadow: rgba(0, 0, 0, 0.8) 0px 4px 23px -6px; -} - -.switch-container-wrap { - position: relative; - overflow: hidden; - height: 50px; - transition: height 0.5s; - - &::before { - content: ''; - display: block; - position: relative; - z-index: 100; - height: 10px; - box-shadow: inset 0 10px 6px -6px rgba(0,0,0,.13); - pointer-events: none; - } -} - -.switch-container { - position: absolute; - bottom: 0; - width: 100%; - overflow: hidden; - background: #f9f9f9; -} - -.active-switch { - display: flex; - align-items: center; - position: relative; - height: 49px; - border-bottom: 1px solid #d8d8d8; - padding: 0 20px; - user-select: none; - - &:last-child { - border-bottom-color: transparent; - } -} - -.icon-qrcode { - width: 20px; - margin-top: 3px; -} - -.switch-title { - flex: 1; - font-size: 1.2em; - padding: 0 15px; - text-align: left; - color: #333; -} - -$switch-button-width: 55px; -$switch-button-height: 35px; -.btn-switch { - // hide input - position: absolute; - z-index: -200000; - opacity: 0; - - & + label { - display: inline-block; - width: $switch-button-width; - height: $switch-button-height; - position: relative; - margin: auto; - background-color: #ddd; - border-radius: $switch-button-height; - cursor: pointer; - outline: 0; - user-select: none; - } - - & + label:before { - content: ''; - display: block; - position: absolute; - top: 1px; - left: 1px; - bottom: 1px; - right: 1px; - background-color: #f1f1f1; - border-radius: $switch-button-height; - transition: background 0.4s; - } - - & + label:after { - content: ''; - display: block; - position: absolute; - height: $switch-button-height - 2px; - width: $switch-button-height - 2px; - background-color: #fff; - border-radius: 100%; - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); - transition: margin 0.4s; - } - - &:checked + label:before { - background-color: #8ce196; - } - - &:checked + label:after { - margin-left: $switch-button-width - $switch-button-height + 2px; - } - - &:active + label, - &:focus + label { - outline: 5px auto rgb(59, 153, 252); - outline: 5px auto -webkit-focus-ring-color; - } - - & + label:hover { - outline: none !important; - } -} - -.fade-enter-active, .fade-leave-active { - transition: opacity .5s -} -.fade-enter, .fade-leave-active { - opacity: 0 -} -</style> diff --git a/src/popup/_style.scss b/src/popup/_style.scss new file mode 100644 index 000000000..6144f5d86 --- /dev/null +++ b/src/popup/_style.scss @@ -0,0 +1,195 @@ +/*------------------------------------*\ + Base +\*------------------------------------*/ +html { + margin: 0; + padding: 0; + overflow: hidden; +} + +body { + width: 450px; + height: 550px; + margin: 0; + padding: 0; + overflow: hidden; + font-size: 14px; + font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei UI", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; +} + +#frame-root { + height: 500px; + transition: height 0.5s; + + // hide white spaces + font-size: 0; +} + +.saladict-DIV { + height: 100%; +} + +.saladict-DictPanel { + position: static; + overflow: hidden; + height: 100%; + transition: height 0.5s; +} + +.qrcode-panel { + position: fixed; + z-index: 100; + bottom: 10px; + left: 10px; + padding: 20px; + background: #fff; + border-radius: 10px; + box-shadow: rgba(0, 0, 0, 0.8) 0px 4px 23px -6px; +} + +.qrcode-panel-title { + text-align: center; + margin: 5px 0 0 0; + + input { + width: 100%; + } +} + +.page-no-response-panel { + position: fixed; + z-index: 100; + bottom: 60px; + right: 25px; + padding: 0 10px; + background: #fff; + border-radius: 10px; + box-shadow: rgba(0, 0, 0, 0.8) 0px 4px 23px -6px; +} + +.switch-container-wrap { + position: relative; + overflow: hidden; + height: 50px; + transition: height 0.5s; + + &::before { + content: ''; + display: block; + position: relative; + z-index: 100; + height: 10px; + box-shadow: inset 0 10px 6px -6px rgba(0,0,0,.13); + pointer-events: none; + } +} + +.switch-container { + position: absolute; + bottom: 0; + width: 100%; + overflow: hidden; + background: #f9f9f9; +} + +.active-switch { + display: flex; + align-items: center; + position: relative; + height: 49px; + border-bottom: 1px solid #d8d8d8; + padding: 0 20px; + user-select: none; + + &:last-child { + border-bottom-color: transparent; + } +} + +.icon-qrcode { + width: 20px; + margin-top: 3px; +} + +.switch-title { + flex: 1; + font-size: 1.2em; + padding: 0 15px; + text-align: left; + color: #333; +} + +$switch-button-width: 55px; +$switch-button-height: 35px; +.btn-switch { + // hide input + position: absolute; + z-index: -200000; + opacity: 0; + + & + label { + display: inline-block; + width: $switch-button-width; + height: $switch-button-height; + position: relative; + margin: auto; + background-color: #ddd; + border-radius: $switch-button-height; + cursor: pointer; + outline: 0; + user-select: none; + } + + & + label:before { + content: ''; + display: block; + position: absolute; + top: 1px; + left: 1px; + bottom: 1px; + right: 1px; + background-color: #f1f1f1; + border-radius: $switch-button-height; + transition: background 0.4s; + } + + & + label:after { + content: ''; + display: block; + position: absolute; + height: $switch-button-height - 2px; + width: $switch-button-height - 2px; + background-color: #fff; + border-radius: 100%; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); + transition: margin 0.4s; + } + + &:checked + label:before { + background-color: #8ce196; + } + + &:checked + label:after { + margin-left: $switch-button-width - $switch-button-height + 2px; + } + + &:active + label, + &:focus + label { + outline: 5px auto rgb(59, 153, 252); + outline: 5px auto -webkit-focus-ring-color; + } + + & + label:hover { + outline: none !important; + } +} + +.fade-enter { + opacity: 0; + transition: opacity .5s; +} + +.fade-enter-active { + opacity: 1; + transition: opacity .5s; +} diff --git a/src/popup/index.ts b/src/popup/index.ts deleted file mode 100644 index 3303ebfec..000000000 --- a/src/popup/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import Vue from 'vue' -import App from './Popup.vue' -import VueQriously from 'vue-qriously' -import VueI18Next from '@panter/vue-i18next' -import i18nLoader from '@/_helpers/i18n' -import popupLocles from '@/_locales/popup' -import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' - -window.__SALADICT_INTERNAL_PAGE__ = true -window.__SALADICT_POPUP_PAGE__ = true -injectSaladictInternal(true) // inject panel AFTER flags are set - -Vue.use(VueQriously) -Vue.use(VueI18Next) -Vue.directive('focus', { inserted: el => el.focus() }) -Vue.directive('select', { inserted: (el: any) => (el.focus(), el.select()) }) -Vue.config.productionTip = false - -// Vue.use(VueI18Next) before loading -const i18n = new VueI18Next(i18nLoader({ popup: popupLocles }, 'popup')) - -// tslint:disable-next-line: no-unused-expression -new Vue({ // eslint-disable-line no-new - el: '#root', - i18n, - render: h => h(App), -}) diff --git a/src/popup/index.tsx b/src/popup/index.tsx new file mode 100644 index 000000000..fb8d8a8f9 --- /dev/null +++ b/src/popup/index.tsx @@ -0,0 +1,23 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import Popup from './Popup' +import { injectSaladictInternal } from '@/_helpers/injectSaladictInternal' + +import { I18nextProvider as ProviderI18next } from 'react-i18next' +import i18nLoader from '@/_helpers/i18n' +import popupLocles from '@/_locales/popup' + +import './_style.scss' + +window.__SALADICT_INTERNAL_PAGE__ = true +window.__SALADICT_POPUP_PAGE__ = true +injectSaladictInternal(true) // inject panel AFTER flags are set + +const i18n = i18nLoader({ popup: popupLocles }, 'popup') + +ReactDOM.render( + <ProviderI18next i18n={i18n}> + <Popup /> + </ ProviderI18next>, + document.getElementById('root'), +) diff --git a/yarn.lock b/yarn.lock index 4417560c8..579915bc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -209,6 +209,13 @@ version "9.6.18" resolved "http://registry.npm.taobao.org/@types/node/download/@types/node-9.6.18.tgz#092e13ef64c47e986802c9c45a61c1454813b31d" +"@types/qrcode.react@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@types/qrcode.react/-/qrcode.react-0.8.1.tgz#7efeb1d01d8e6dddcdf07fbec0724aaf0fa5c984" + integrity sha512-OpMOBjWIMTnC1sdLcFgif/cXZYiPQGUN2yDaxC2EmZaAmElxehE+toMzPZvUJVXNyFXFdmYSDRWsjKtTTnqqAQ== + dependencies: + "@types/react" "*" + "@types/react-dom@^16.0.5": version "16.0.5" resolved "http://registry.npm.taobao.org/@types/react-dom/download/@types/react-dom-16.0.5.tgz#a757457662e3819409229e8f86795ff37b371f96" @@ -7297,6 +7304,19 @@ q@^1.1.2, q@^1.4.1, q@^1.5.1: version "1.5.1" resolved "http://registry.npm.taobao.org/q/download/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" [email protected]: + version "0.0.0" + resolved "https://registry.yarnpkg.com/qr.js/-/qr.js-0.0.0.tgz#cace86386f59a0db8050fa90d9b6b0e88a1e364f" + integrity sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8= + +qrcode.react@^0.9.2: + version "0.9.2" + resolved "https://registry.yarnpkg.com/qrcode.react/-/qrcode.react-0.9.2.tgz#52f9d55db38bc2d75d63b685ca266b7d6286575b" + integrity sha512-opV0IA4w84qMaZg3hhgmktDs1xjfx3K7RAOzdvmKgkLdhmtv95AYGZmlG0s3NIAZ1qXCK4AyPJayLd3sa6p/RA== + dependencies: + prop-types "^15.6.0" + qr.js "0.0.0" + [email protected]: version "6.5.1" resolved "http://registry.npm.taobao.org/qs/download/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" @@ -9603,10 +9623,6 @@ vue-parser@^1.1.5: dependencies: parse5 "^3.0.3" -vue-qriously@^1.1.1: - version "1.1.1" - resolved "http://registry.npm.taobao.org/vue-qriously/download/vue-qriously-1.1.1.tgz#b3a84b05280cb1edfd153bbc003f031995ea7ce7" - vue-stash@^2.0.1-beta: version "2.0.1-beta" resolved "http://registry.npm.taobao.org/vue-stash/download/vue-stash-2.0.1-beta.tgz#3b46ccab3670e1eddfda8aa711247e6f887691de"
refactor
remove vue