Skip to content

Commit

Permalink
chore: new icons
Browse files Browse the repository at this point in the history
  • Loading branch information
yize committed Jan 12, 2019
1 parent d0c5230 commit 9c5a1db
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build/app.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/background.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/images/info.svg

This file was deleted.

1 change: 0 additions & 1 deletion build/images/new-tab.svg

This file was deleted.

2 changes: 1 addition & 1 deletion build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "XSwitch",
"description": "XSwitch tools for proxy web request url, support reg",
"short_name": "xs",
"version": "1.15.5",
"version": "1.15.6",
"manifest_version": 2,
"browser_action": {
"default_icon": "images/grey_128.png",
Expand Down
1 change: 0 additions & 1 deletion images/info.svg

This file was deleted.

1 change: 0 additions & 1 deletion images/new-tab.svg

This file was deleted.

2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "XSwitch",
"description": "XSwitch tools for proxy web request url, support reg",
"short_name": "xs",
"version": "1.15.5",
"version": "1.15.6",
"manifest_version": 2,
"browser_action": {
"default_icon": "images/grey_128.png",
Expand Down
11 changes: 8 additions & 3 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ export const DEFAULT_DATA = `{
".development.js"
// "react.development.js",
],
// then try visit https://unpkg.com/react@16.4.1/umd/react.production.min.js
// \`Command/Ctrl + click\` to visit:
// https://unpkg.com/react@16.4.1/umd/react.production.min.js
[
"(.*)/path1/path2/(.*)", // https://www.sample.com/path1/path2/index.js
"http://127.0.0.1:3000/$2", // http://127.0.0.1:3000/index.js
],
],
// urls that want CORS
"cors": [
Expand All @@ -108,8 +113,8 @@ export const DEFAULT_DATA = `{
export const DEFAULT_DUP_DATA = `{
"proxy": [
[
".production(.min)?.js",
"react.development.js",
"(.*)/path1/path2/(.*)", // https://www.sample.com/path1/path2/index.js
"http://127.0.0.1:3000/$2", // http://127.0.0.1:3000/index.js
],
],
}
Expand Down
7 changes: 7 additions & 0 deletions src/pages/xswitch/xswitch.less
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
z-index: 3;
background: #fff;
width: 100%;
position: relative;
.confirm-button{
position: absolute;
right: 15px;
top: 15px;
cursor: pointer;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/pages/xswitch/xswitch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ViewController, observable, inject } from '@ali/recore';
import { Switch, Icon, Checkbox, Input, Popconfirm } from 'antd';
import { Switch, Icon, Checkbox, Input, Popconfirm, Button } from 'antd';

import './xswitch.less';

Expand Down Expand Up @@ -35,7 +35,7 @@ import { getEditorConfig } from '../../editor-config';

let editor: any;
@inject({
components: { Switch, Icon, Checkbox, Input, Popconfirm },
components: { Switch, Icon, Checkbox, Input, Popconfirm, Button },
})
export default class XSwitch extends ViewController {
@observable
Expand Down
19 changes: 10 additions & 9 deletions src/pages/xswitch/xswitch.vx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="xswitch-wrapper">
<div class="xswitch-left-area">
<ul class="xswitch-tabs" ref="tabs">
<li x-for={items} x-each='item' @click='setEditingKey' className.editing={item.id === editingKey}>
<Checkbox checked={item.active} @change='setActive' disabled={item.id === '0'}/><span className="label">&nbsp;{item.name}</span>
<Icon className="delete-icon" className.deleting={item.id === deletingKey} type="delete" theme="outlined" style.color={item.id === deletingKey? "#f5222d": "#ccc"} title={item.id === deletingKey? "Are you sure to delete?":"Click to delete"} @click="remove"/>
<li x-for={items} x-each='item' @click='setEditingKey' class.editing={item.id === editingKey}>
<Checkbox checked={item.active} @change='setActive' disabled={item.id === '0'}/><span class="label">&nbsp;{item.name}</span>
<Icon class="delete-icon" class.deleting={item.id === deletingKey} type="delete" theme="outlined" style.color={item.id === deletingKey? "#f5222d": "#ccc"} title={item.id === deletingKey? "Are you sure to delete?":"Click to delete"} @click="remove"/>
</li>
</ul>
<div class="xswitch-new-item-container">
Expand All @@ -15,16 +15,17 @@
x-model={newItem}
@keyUp.enter="add"
/>
<Icon class="confirm-button" type="edit" theme="twoTone" @click="add" />
</div>
</div>
<div className="xswitch-container" ref="shell"></div>
<div class="xswitch-container" ref="shell"></div>
</div>
<div className="toolbar-area">
<div class="toolbar-area">
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="close" />} checked={checked} @change="toggleButton"/>
<a className="open-readme" title="Open help page" href="javascript:;" @click="openReadme">
<img className="xswitch-icon" src={`${prefix}/images/info.svg`} />
<a class="open-readme" title="Open help page" href="javascript:;" @click="openReadme">
<Icon type="question-circle" theme="twoTone" style={{ fontSize: '22px'}}/>
</a>
<a className="new-tab-control" title="Open in new tab" href="javascript:;" @click="openNewTab">
<img className="xswitch-icon" src={`${prefix}/images/new-tab.svg`} />
<a class="new-tab-control" title="Open in new tab" href="javascript:;" @click="openNewTab">
<Icon type="code" theme="twoTone" style={{ fontSize: '22px'}}/>
</a>
</div>

0 comments on commit 9c5a1db

Please sign in to comment.