Skip to content

Commit

Permalink
Merge pull request #547 from hogashi/remove-ctrl-s-func
Browse files Browse the repository at this point in the history
Remove func to fix filename on Ctrl-s
  • Loading branch information
hogashi authored Aug 8, 2023
2 parents cc05c79 + 820148b commit 8530563
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 91 deletions.
81 changes: 0 additions & 81 deletions __tests__/__snapshots__/popup.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -341,87 +341,6 @@ exports[`Popup render 1`] = `
</div>
</div>
</ul>
<ul
className="MuiList-root MuiList-padding MuiList-subheader"
>
<div
className="MuiListSubheader-root MuiListSubheader-sticky MuiListSubheader-gutters"
>
画像ページ
</div>
<div
aria-disabled={false}
className="MuiButtonBase-root MuiListItem-root checkboxListItem STRIP_IMAGE_SUFFIX MuiListItem-dense MuiListItem-gutters MuiListItem-button"
onBlur={[Function]}
onClick={[Function]}
onDragLeave={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
role="button"
tabIndex={0}
>
<span
aria-disabled={false}
className="MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorSecondary PrivateSwitchBase-checked-2 Mui-checked MuiIconButton-colorSecondary"
onBlur={[Function]}
onDragLeave={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
onMouseDown={[Function]}
onMouseLeave={[Function]}
onMouseUp={[Function]}
onTouchEnd={[Function]}
onTouchMove={[Function]}
onTouchStart={[Function]}
style={
{
"padding": "4px 12px",
}
}
tabIndex={null}
>
<span
className="MuiIconButton-label"
>
<input
checked={true}
className="PrivateSwitchBase-input-4"
data-indeterminate={false}
onChange={[Function]}
tabIndex={-1}
type="checkbox"
/>
<svg
aria-hidden={true}
className="MuiSvgIcon-root"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
/>
</svg>
</span>
</span>
<div
className="MuiListItemText-root MuiListItemText-dense"
>
<span
className="MuiTypography-root MuiListItemText-primary MuiTypography-body2 MuiTypography-displayBlock"
>
[Ctrl]+[s]で拡張子を校正
</span>
</div>
</div>
</ul>
<button
className="MuiButtonBase-root MuiButton-root MuiButton-contained saveSettingButton MuiButton-containedPrimary"
disabled={false}
Expand Down
2 changes: 1 addition & 1 deletion dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "twitter画像原寸ボタン",
"version": "5.2.1",
"version": "5.3.0",
"description": "twitterの画像ツイートにボタンを追加する拡張機能。追加されたボタンを押すとツイートの画像を原寸で新しいタブに表示する。連絡先: @hogextend",
"author": "hogashi",
"permissions": ["tabs", "storage"],
Expand Down
4 changes: 0 additions & 4 deletions src/extension-contexts/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
SHOW_ON_TWEET_DETAIL,
SHOW_ON_TWEETDECK_TIMELINE,
SHOW_ON_TWEETDECK_TWEET_DETAIL,
STRIP_IMAGE_SUFFIX,
OPTIONS_TEXT,
OptionsBool,
} from '../constants';
Expand Down Expand Up @@ -113,9 +112,6 @@ export const Popup = (props: Props): JSX.Element => {
{optionsItems[SHOW_ON_TWEETDECK_TIMELINE]}
{optionsItems[SHOW_ON_TWEETDECK_TWEET_DETAIL]}
</List>
<List subheader={<ListSubheader component='div'>画像ページ</ListSubheader>}>
{optionsItems[STRIP_IMAGE_SUFFIX]}
</List>
<Button
className='saveSettingButton'
variant='contained'
Expand Down
7 changes: 2 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { isImageTab, isTweetdeck, isTwitter } from './constants';
import { fixFileNameOnSaveCommand, setOriginalButton, updateOptions } from './utils';
import { isTweetdeck, isTwitter } from './constants';
import { setOriginalButton, updateOptions } from './utils';

updateOptions().then((options) => {
if (isTwitter() || isTweetdeck()) {
/** 公式Web/TweetDeck */
setOriginalButton(options);
} else if (isImageTab()) {
/** 画像ページ(https://pbs.twimg.com/*) */
fixFileNameOnSaveCommand(options);
}
});
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export const setOriginalButton = (options: OptionsBool): void => {
};

/**
* @deprecated
* twitterの画像を表示したときのC-sを拡張
* 画像のファイル名を「~.jpg-orig」「~.png-orig」ではなく「~-orig.jpg」「~-orig.png」にする
*/
Expand Down

0 comments on commit 8530563

Please sign in to comment.