diff --git a/HISTORY.md b/HISTORY.md index 9c2e4d46b5944fc706ad000a4d7fc1af00d8650b..f477cfaf25475d6a985714ba567e8f68141ef0ed 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,12 @@ +### v2.4.6 +* Fix random page reload + +### v2.4.4 +* Fix layout in project page +* Fix intermittent page reload +* Support file icon in Safari +* Set default GitHub token options + ### v2.4.3 * Fix issue branch path not encoded in file navigation diff --git a/README.en.md b/README.en.md deleted file mode 100644 index e98cba8173aee84fa00ae9fb5f6d52f83e911520..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,149 +0,0 @@ -[![OpenCollective](https://opencollective.com/octotree/backers/badge.svg)](#backers) -[![OpenCollective](https://opencollective.com/octotree/sponsors/badge.svg)](#sponsors) - -## Octotree -Browser extension (Chrome, Firefox, Opera and Safari) to show a code tree on GitHub. Awesome for exploring project source without having to pull every single repository to your machine. Features: - -* Easy-to-navigate code tree, just like in IDEs -* Fast browsing with pjax and Turbolinks -* Support private repositories (see [instructions](#access-token)) -* Support GitHub Enterprise (Chrome and Opera only, see [instructions](#enterprise-urls)) - -__GitLab is no longer supported__: -As of version 2.1.0, Octotree no longer supports GitLab. There are 2 reasons for this. First, GitLab has changed so much recently that it would take a lot of effort to keep Octotree up to date. Second, the GitLab team has [told me](https://github.com/buunguyen/octotree/issues/265) they would build a tree feature in GitLab itself. I can't afford working on something knowing my effort will be irrelevant any time soon. That being said, if anyone wants to work on supporting the new GitLab, I'll gladly accept contributions to add back GitLab support. - -![Octotree on GitHub](docs/chrome-github.png) - - -### Install on Chrome, Firefox and Opera -* Install Octotree from [Chrome Web Store](https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc), [Mozilla Add-ons Store](https://addons.mozilla.org/en-US/firefox/addon/octotree/) or [Opera Add-ons Store](https://addons.opera.com/en/extensions/details/octotree/) -* Navigate to any GitHub repository (or just refresh this page as an example) -* The code tree should show on the left-hand side of the screen - -__Note__: to configure Octotree for GitHub Enteprise, see [instructions](#enterprise-urls) - -### Install on Safari - -Octotree is not available on the Safari gallery. Instead, you must use the prebuilt package or build one from source. - -* Download the [Safari prebuilt package](https://github.com/buunguyen/octotree/blob/master/dist/safari.safariextz?raw=true) -* Double-click or drag it to Safari - -### Install from prebuilt packages (all browsers) - -Prebuilt packages are available in the [dist](https://github.com/buunguyen/octotree/tree/master/dist) folder. For security reason, only download Octotree from this location. - -__Note__: Firefox 43+ requires add-ons to be signed. Therefore, you should install Octotree from the Mozilla store. For some reason if you want to install the prebuilt package instead, you have to [disable sign-check](https://github.com/buunguyen/octotree/issues/220#issuecomment-166012724). - -## Settings -### Access Token - -__Note for the paranoids (like me!)__: Octotree stores access tokens in your browser local storage and never transmits it anywhere. If you want to verify, check out the source, starting with [this line](https://github.com/buunguyen/octotree/blob/master/src/view.options.js#L77). - -#### GitHub -Octotree uses [GitHub API](https://developer.github.com/v3/) to retrieve repository metadata. By default, it makes unauthenticated requests to the GitHub API. However, there are two situations when requests must be authenticated: - -* You access a private repository -* You exceed the [rate limit of unauthenticated requests](https://developer.github.com/v3/#rate-limiting) - -When that happens, Octotree will ask for your [GitHub personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use). If you don't already have one, [create one](https://github.com/settings/tokens/new), then copy and paste it into the textbox. Note that the minimal scopes that should be granted are `public_repo` and `repo` (if you need access to private repositories). - -#### Bitbucket -Octotree uses [Bitbucket API](https://confluence.atlassian.com/bitbucket/repositories-endpoint-1-0-296092719.html) to retrieve repository metadata. By defualt, Octotree will ask for your [Bitbucket App password](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html). If you don't already have one, [create one](https://bitbucket.org/account/admin/app-passwords) (the minimal requirement is `Repositories`'s `Read` permission), then copy and paste it into the textbox. - -Note that Octotree extract your username from your current page by default for calling Bitbucket API. If fail to extract, Octotree will ask you for a token update, then you just need to prepend your username to the token, separated by a colon, i.e. `USERNAME:TOKEN`. - -### Enterprise URLs -By default, Octotree only works on `github.com`. To support enterprise version (Chrome and Opera only), you must grant Octotree sufficient permissions. Follow these steps to do so: - -* Go to any GitHub repo -* Open the Octotree settings panel - -![Settings](docs/settings.jpg) - -* Fill in the GitHub Enterprise URLs textbox, _one URL per line_ -* Click Save and accept the permission prompt -* Navigate to your GitHub Enterprise site -* You might be asked to create an [access token](#access-token) - -### Others -* __Hotkeys__: Octotree uses [keymaster](https://github.com/madrobby/keymaster) to register hotkeys. Checkout the [supported keys](https://github.com/madrobby/keymaster#supported-keys). -* __Remember sidebar visibility__: if checked, show or hide Octotree based on its last visibility. -* __Show in non-code pages__: if checked, allow Octotree to show in non-code pages such as Issues and Pull Requests. -* __Load entire tree at once__: if checked, load and render the entire code tree at once. To avoid long loading, this should be unchecked if you frequently work with very large repos. - -## Credits -* [@crashbell](https://github.com/crashbell) for helping with GitLab and others -* [@Ephemera](https://github.com/Ephemera) for fixing many bugs -* [@athaeryn](https://github.com/athaeryn) and [@letunglam](https://github.com/letunglam) for helping with UI design -* And many other people who submit bug fixes and reports - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/octotree#backer)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/octotree#sponsor)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/README.md b/README.md index a4b9c538ce30963c442277773cc29b67072726e0..947cd3d4746e220c1cc03dc33d6ea3bcac527451 100644 --- a/README.md +++ b/README.md @@ -1,78 +1,76 @@ [![OpenCollective](https://opencollective.com/octotree/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/octotree/sponsors/badge.svg)](#sponsors) +## Octotree +Browser extension (Chrome, Firefox, Opera and Safari) to show a code tree on GitHub. Awesome for exploring project source without having to pull every single repository to your machine. Features: -## GitCodeTree -fork from [https://github.com/buunguyen/octotree](https://github.com/buunguyen/octotree) +* Easy-to-navigate code tree, just like in IDEs +* Fast browsing with pjax +* Support private repositories (see [instructions](#access-token)) +* Support GitHub Enterprise (Chrome and Opera only, see [instructions](#enterprise-urls)) -## 安装 -### 从预先构建的包安装(适用于所有浏览器) - **鉴于国内墙的原因,你可以通过下载已经构建好的包来安装** +![Octotree on GitHub](docs/chrome-github.jpg) -预先构建的包可以从 [https://gitee.com/oschina/GitCodeTree/tree/master/dist](https://gitee.com/oschina/GitCodeTree/tree/master/dist) 下载。出于安全原因,请不要从其它地方下载。 +### Install on Chrome, Firefox and Opera +* Install Octotree from [Chrome Web Store](https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc), [Mozilla Add-ons Store](https://addons.mozilla.org/en-US/firefox/addon/octotree/) or [Opera Add-ons Store](https://addons.opera.com/en/extensions/details/octotree/) +* Navigate to any GitHub repository (or just refresh this page as an example) +* The code tree should show on the left-hand side of the screen -__注意__: Firefox 43 + 需要签名。因此您需要从Mozilla商店安装GitCodeTree。出于某种原因,如果你想安装预先构建的包,请参考 [disable sign-check](https://github.com/buunguyen/octotree/issues/220#issuecomment-166012724)。 +__Note__: to configure Octotree for GitHub Enteprise, see [instructions](#enterprise-urls) -### 在 Chrome, Firefox 和 Opera 上安装 -* 从 [Chrome Web Store](https://chrome.google.com/webstore/detail/gitcodetree/inaaldjpdbkaodlmdcplgpoibohcmmlj),[Mozilla Add-ons Store](https://addons.mozilla.org/zh-CN/firefox/addon/GitCodeTree/) or [Opera Add-ons Store](https://addons.opera.com/en/extensions/details/gitcodetree/) 安装GitCodeTree -* 导航到任何Gitee、GitHub库(或者刷新这个页面作为一个例子) -* 代码树将显示在页面左边 +### Install on Safari -### 在 Safari 上安装 +Octotree is not available on the Safari gallery. You have to build from source. Download this repo and run the following command: -GitCodeTree在Safari gallery中不可用;所以,您必须使用预先构建的包 或者 从源代码构建一个。 +```bash +gulp safari +``` -* 下载 [Safari 预先构建的包](https://gitee.com/oschina/GitCodeTree/blob/master/dist/safari.safariextz?raw=true) -* 双击或者拖拽到Safari窗口 +Find the extension folder in `tmp/safari`. Follow Apple instructions to install the extension to your browser. +### Install from prebuilt packages (all browsers) +Prebuilt packages are available in the [dist](https://github.com/buunguyen/octotree/tree/master/dist) folder. For security reason, only download Octotree from this location. -## 介绍 +__Note__: Firefox 43+ requires add-ons to be signed. Therefore, you should install Octotree from the Mozilla store. For some reason if you want to install the prebuilt package instead, you have to [disable sign-check](https://github.com/buunguyen/octotree/issues/220#issuecomment-166012724). -浏览器插件 (Chrome, Firefox, Opera and Safari) 在Gitee、GitHub上显示代码树。不用clone到本地就能查看项目结构. 特性: - -* 就像在IDE一样简单易用的代码树 -* 快速浏览文件,不刷新页面 -* 支持私人存储库 (Gitee登录后就可查看, Github 需要填写[access_token](#access-token)) - -![GitCodeTree on Gitee](docs/chrome-gitee.png) -![GitCodeTree on GitHub](docs/chrome-github.png) - - -### 二次开发 - -* 将项目clone到本地 -* 在`src/adapters/`中为你想要支持的网站添加一个类(可复制`src/adapters/github.js`并修改) -* 根据情况实现 [`_getTree`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/adapters/github.js#L149-154) 或 `_get` 方法,用于获取项目树 -* 实现 [`updateLayout`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/adapters/github.js#L65-73) 方法,用于修改页面布局 -* 实现 [`selectFile`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/adapters/github.js#L135-138) 指定pjax替换的html元素,用于不刷新切换文件 -* 在 [`src/octotree.js`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/octotree.js#L30)中添加你修改好的类 -* 在 `src/config/` 插件配置文件中添加你想要支持的网站 -* __chrome中调试__: 使用`gulp chrome`命令,打开[chrome://extensions/](chrome://extensions/),点击`加载已解压的扩展程度`,选择`src/tmp/chrome` -* __打包__: 使用 `gulp dist` 命令打包 +## Settings +### Access Token +__Note for the paranoids (like me!)__: Octotree stores access tokens in your browser local storage and never transmits it anywhere. +#### GitHub +Octotree uses [GitHub API](https://developer.github.com/v3/) to retrieve repository metadata. By default, it makes unauthenticated requests to the GitHub API. However, there are two situations when requests must be authenticated: +* You access a private repository +* You exceed the [rate limit of unauthenticated requests](https://developer.github.com/v3/#rate-limiting) -## 设置 -### Access Token +When that happens, Octotree will ask for your [GitHub personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use). If you don't already have one, [create one](https://github.com/settings/tokens/new), then copy and paste it into the textbox. Note that the minimal scopes that should be granted are `public_repo` and `repo` (if you need access to private repositories). -__注意__: GitCodeTree 访问令牌在浏览器本地存储并不会上传到任何地方。如果你想验证,查看源代码,开始 [请参考这里](https//gitee.com/inu1255/GitCodeTree/blob/master/src/view.options.js#L77). +#### Bitbucket (experimental) +Octotree uses [Bitbucket API](https://confluence.atlassian.com/bitbucket/repositories-endpoint-1-0-296092719.html) to retrieve repository metadata. By default, Octotree asks for your [Bitbucket App password](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html). If you don't already have one, [create one](https://bitbucket.org/account/admin/app-passwords) (the minimal requirement is `Repositories`'s `Read` permission), then copy and paste it into the textbox. -#### GitHub -GitCodeTree 使用 [GitHub API](https://developer.github.com/v3/) 检索代码树。默认情况下,它使未经身份验证的请求到GitHub API。然而,有两种情况时必须经过身份验证的请求: +Note that Octotree extracts your username from the current page to invoke the Bitbucket API. If fail to do so, Octotree will ask you for a token update, you just need to prepend your username to the token, separated by a colon, i.e. `USERNAME:TOKEN`. -* 你访问一个私人存储库 -* 你超过 [请求频率限制限制](https://developer.github.com/v3/#rate-limiting) +### Enterprise URLs +By default, Octotree only works on `github.com`. To support enterprise version (Chrome and Opera only), you must grant Octotree sufficient permissions. Follow these steps to do so: -当这种情况发生时,GitCodeTree会询问你 [GitHub 私人 access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use). 如果你没有,[点此创建](https://github.com/settings/tokens/new), 然后复制粘贴到文本框中。注意,至少要允许"public_repo","repo" (如果你需要访问私人仓库). +* Go to any GitHub repo +* Open the Octotree settings panel ![Settings](docs/settings.jpg) -### 其它 -* __热键__: GitCodeTree 使用 [keymaster](https://github.com/madrobby/keymaster) 注册热键。查看 [支持的按键](https://github.com/madrobby/keymaster#supported-keys). -* __记得栏可见性__: 如果勾选此项,基于其可见性显示或隐藏GitCodeTree. -* __在非代码页__: 如果勾选此项,让GitCodeTree等非代码页的问题和请求. -* __一次加载整个树__: (仅支持github) 如果勾选此项,进入项目页面时GitCodeTree将加载整个项目树。如果您经常访问非常大的项目,为了避免长时间加载,请勿勾选此项. +* Fill in the GitHub Enterprise URLs textbox, __one URL per line__ +* Click Save and accept the permission prompt +* Navigate to your GitHub Enterprise site +* You might be asked to create an [access token](#access-token) + +### Others +* __Hotkeys__: Octotree uses [keymaster](https://github.com/madrobby/keymaster) to register hotkeys. Check out the [supported keys](https://github.com/madrobby/keymaster#supported-keys). +* __Remember sidebar visibility__: if checked, show or hide Octotree based on its last visibility. +* __Show in non-code pages__: if checked, allow Octotree to show in non-code pages such as Issues and Pull Requests. +* __Load entire tree at once__: if checked, load and render the entire code tree at once. To avoid long loading, this should be unchecked if you frequently work with very large repos. +* __Show only pull request changes__ _(new!)_: if checked and in "Pull requests" page, only show the change set of the pull request. ## Credits * [@crashbell](https://github.com/crashbell) for helping with GitLab and others @@ -82,7 +80,9 @@ GitCodeTree 使用 [GitHub API](https://developer.github.com/v3/) 检索代码 ## Backers -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/octotree#backer)] +Loving Octotree? [Donating](https://opencollective.com/octotree) to help us continue working on it. + +[[Become a backer](https://opencollective.com/octotree#backer)] @@ -148,4 +148,4 @@ Become a sponsor and get your logo on our README on Github with a link to your s - + \ No newline at end of file diff --git a/README.zh-cn.md b/README.zh-cn.md new file mode 100644 index 0000000000000000000000000000000000000000..2f6f91394d109889e4d33be037b1edb1799b82e3 --- /dev/null +++ b/README.zh-cn.md @@ -0,0 +1,67 @@ +## GitCodeTree + +fork from [https://github.com/buunguyen/octotree](https://github.com/buunguyen/octotree) + +## 安装 +### 从预先构建的包安装(适用于所有浏览器) + **鉴于国内墙的原因,你可以通过下载已经构建好的包来安装** + +预先构建的包可以从 [https://gitee.com/oschina/GitCodeTree/tree/master/dist](https://gitee.com/oschina/GitCodeTree/tree/master/dist) 下载。出于安全原因,请不要从其它地方下载。 + +__注意__: Firefox 43 + 需要签名。因此您需要从Mozilla商店安装GitCodeTree。出于某种原因,如果你想安装预先构建的包,请参考 [disable sign-check](https://github.com/buunguyen/octotree/issues/220#issuecomment-166012724)。 + +### 在 Chrome, Firefox 和 Opera 上安装 +* 从 [Chrome Web Store](https://chrome.google.com/webstore/detail/gitcodetree/inaaldjpdbkaodlmdcplgpoibohcmmlj),[Mozilla Add-ons Store](https://addons.mozilla.org/zh-CN/firefox/addon/GitCodeTree/) or [Opera Add-ons Store](https://addons.opera.com/en/extensions/details/gitcodetree/) 安装GitCodeTree +* 导航到任何Gitee、GitHub库(或者刷新这个页面作为一个例子) +* 代码树将显示在页面左边 + +### 在 Safari 上安装 + +GitCodeTree在Safari gallery中不可用;所以,您必须使用预先构建的包 或者 从源代码构建一个。 + +* 下载 [Safari 预先构建的包](https://gitee.com/oschina/GitCodeTree/blob/master/dist/safari.safariextz?raw=true) +* 双击或者拖拽到Safari窗口 + +## 介绍 + +浏览器插件 (Chrome, Firefox, Opera and Safari) 在Gitee、GitHub上显示代码树。不用clone到本地就能查看项目结构. 特性: + +* 就像在IDE一样简单易用的代码树 +* 快速浏览文件,不刷新页面 +* 支持私人存储库 (Gitee登录后就可查看, Github 需要填写[access_token](#access-token)) + +![GitCodeTree on Gitee](docs/chrome-gitee.png) +![GitCodeTree on GitHub](docs/chrome-github.png) + +### 二次开发 + +* 将项目clone到本地 +* 在`src/adapters/`中为你想要支持的网站添加一个类(可复制`src/adapters/github.js`并修改) +* 根据情况实现 [`_getTree`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/adapters/github.js#L149-154) 或 `_get` 方法,用于获取项目树 +* 实现 [`updateLayout`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/adapters/github.js#L65-73) 方法,用于修改页面布局 +* 实现 [`selectFile`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/adapters/github.js#L135-138) 指定pjax替换的html元素,用于不刷新切换文件 +* 在 [`src/octotree.js`](https//gitee.com/inu1255/GitCodeTree/blob/master/src/octotree.js#L30)中添加你修改好的类 +* 在 `src/config/` 插件配置文件中添加你想要支持的网站 +* __chrome中调试__: 使用`gulp chrome`命令,打开[chrome://extensions/](chrome://extensions/),点击`加载已解压的扩展程度`,选择`src/tmp/chrome` +* __打包__: 使用 `gulp dist` 命令打包 + +## 设置 +### Access Token + +__注意__: GitCodeTree 访问令牌在浏览器本地存储并不会上传到任何地方。如果你想验证,查看源代码,开始 [请参考这里](https//gitee.com/inu1255/GitCodeTree/blob/master/src/view.options.js#L77). + +#### GitHub +GitCodeTree 使用 [GitHub API](https://developer.github.com/v3/) 检索代码树。默认情况下,它使未经身份验证的请求到GitHub API。然而,有两种情况时必须经过身份验证的请求: + +* 你访问一个私人存储库 +* 你超过 [请求频率限制限制](https://developer.github.com/v3/#rate-limiting) + +当这种情况发生时,GitCodeTree会询问你 [GitHub 私人 access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use). 如果你没有,[点此创建](https://github.com/settings/tokens/new), 然后复制粘贴到文本框中。注意,至少要允许"public_repo","repo" (如果你需要访问私人仓库). + +![Settings](docs/settings.jpg) + +### 其它 +* __热键__: GitCodeTree 使用 [keymaster](https://github.com/madrobby/keymaster) 注册热键。查看 [支持的按键](https://github.com/madrobby/keymaster#supported-keys). +* __记得栏可见性__: 如果勾选此项,基于其可见性显示或隐藏GitCodeTree. +* __在非代码页__: 如果勾选此项,让GitCodeTree等非代码页的问题和请求. +* __一次加载整个树__: (仅支持github) 如果勾选此项,进入项目页面时GitCodeTree将加载整个项目树。如果您经常访问非常大的项目,为了避免长时间加载,请勿勾选此项. diff --git a/dist/chrome.crx b/dist/chrome.crx index b4c2720678d8847f2c9cc67ef9eb4dc4a965145b..04a24ecea6a2c6df603dad92eb070349cde8afab 100644 Binary files a/dist/chrome.crx and b/dist/chrome.crx differ diff --git a/dist/chrome.zip b/dist/chrome.zip index b2f2b3f4a464411862b63288691f38a40dcea037..9193bb8497a8adc7b30b24a1c55914c3a720469f 100644 Binary files a/dist/chrome.zip and b/dist/chrome.zip differ diff --git a/dist/firefox.zip b/dist/firefox.zip index 731dd203edcd5c41c1e049b66ca56d0b8adb988f..9d122a6d3e089e34fc007d3c43bbbe05f236d3c5 100644 Binary files a/dist/firefox.zip and b/dist/firefox.zip differ diff --git a/dist/opera.nex b/dist/opera.nex index b4c2720678d8847f2c9cc67ef9eb4dc4a965145b..04a24ecea6a2c6df603dad92eb070349cde8afab 100644 Binary files a/dist/opera.nex and b/dist/opera.nex differ diff --git a/docs/chrome-github.jpg b/docs/chrome-github.jpg index 27f8effb821b32eca2197bdf9875755208724531..1700c247fcbcbaf578cccd78d9423b1fedfdf722 100644 Binary files a/docs/chrome-github.jpg and b/docs/chrome-github.jpg differ diff --git a/docs/opera-github.jpg b/docs/opera-github.jpg deleted file mode 100644 index 8a6efca8a745706717a7136efcaa4544c3e34925..0000000000000000000000000000000000000000 Binary files a/docs/opera-github.jpg and /dev/null differ diff --git a/docs/settings.jpg b/docs/settings.jpg index 1e63c2722bc5a76217e628cabe7580911ee2d340..374fc8963d4bf89cdddf88488880130e8c030b7c 100644 Binary files a/docs/settings.jpg and b/docs/settings.jpg differ diff --git a/gulpfile.babel.js b/gulpfile.babel.js index d3fd0bc0c5762ebada03318c37e00bc8cb978f22..546aaa7fbc017050fae124d355164f3443b10434 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -129,11 +129,11 @@ gulp.task('firefox:zip', () => { // Safari gulp.task('safari:template', () => { - return buildTemplate({}) + return buildTemplate({SUPPORT_FILE_ICONS: true}) }) gulp.task('safari:js', ['safari:template', 'lib:ondemand'], () => { - return buildJs([], {}) + return buildJs([], {SUPPORT_FILE_ICONS: true}) }) gulp.task('safari', ['safari:js'], () => { @@ -143,6 +143,7 @@ gulp.task('safari', ['safari:js'], () => { ['./libs/**/*', '!./libs/ondemand{,/**}', './tmp/octotree.*', './tmp/ondemand.js'], './tmp/safari/octotree.safariextension/' ), + pipe('./libs/file-icons.css', $.replace('../fonts', 'fonts'), './tmp/safari/octotree.safariextension/'), pipe('./src/config/safari/Info.plist', $.replace('$VERSION', getVersion()), './tmp/safari/octotree.safariextension') ) }) diff --git a/package.json b/package.json index bd4f8e08e2f247ad08a1066890e01f205bcf9bcb..d64dc0cc406569a5c5d3671c608e575b2f011147 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "octotree", - "version": "2.4.3", + "version": "2.4.6", "description": "Code tree for GitHub", "main": "inject.js", "scripts": { diff --git a/src/adapters/oschina.less b/src/adapters/oschina.less index e0e78e3e549b423cb12a9f83a6e3427d18871deb..031819e311c4896d35106fa6de347627c57673a4 100644 --- a/src/adapters/oschina.less +++ b/src/adapters/oschina.less @@ -71,18 +71,21 @@ top: 2px; content: data-uri('image/svg+xml;charset=UTF-8', './octicons/git-branch.svg'); } - .jstree-icon { + .jstree-icon.tree, .jstree-icon.commit, .jstree-icon.blob.file-generic { margin-top: 3px; } .jstree-icon.tree:before { content: data-uri('image/svg+xml;charset=UTF-8', './octicons/file-directory.svg'); } - .jstree-icon.blob:before { + .jstree-icon.file-generic:before { content: data-uri('image/svg+xml;charset=UTF-8', './octicons/file-text.svg'); } .jstree-node.jstree-leaf:hover { - .jstree-icon.blob:before { - content: data-uri('image/svg+xml;charset=UTF-8', './octicons/cloud-download.svg'); + .jstree-icon.blob { + margin-top: 1px; + &:before { + content: data-uri('image/svg+xml;charset=UTF-8', './octicons/cloud-download.svg'); + } } } .jstree-icon.commit:before { @@ -134,7 +137,7 @@ &:not(.octotree_loading):hover > span:after { content: data-uri('image/svg+xml;charset=UTF-8', './octicons/chevron-right-hover.svg'); } - &.btn{ + &.btn{ position: relative; display: inline-block; padding: 6px 12px; diff --git a/src/adapters/pjax.js b/src/adapters/pjax.js index 9278cda0446a011ddbbcbc1b5e1865efc8d7902a..686e874d1bf28060ea469c89e276e67dbe51a95d 100644 --- a/src/adapters/pjax.js +++ b/src/adapters/pjax.js @@ -2,10 +2,10 @@ class PjaxAdapter extends Adapter { constructor(store) { super(['jquery.pjax.js'], store) - $.pjax.defaults.timeout = 0 // no timeout $(document) - .on('pjax:send', () => $(document).trigger(EVENT.REQ_START)) + .on('pjax:start', () => $(document).trigger(EVENT.REQ_START)) .on('pjax:end', () => $(document).trigger(EVENT.REQ_END)) + .on('pjax:timeout', (e) => e.preventDefault()) } // @override @@ -77,7 +77,8 @@ class PjaxAdapter extends Adapter { // needs full path for pjax to work with Firefox as per cross-domain-content setting url: location.protocol + '//' + location.host + path, container: $pjaxContainer, - fragment: fragment + fragment: fragment, + timeout: 0 // global timeout doesn't seem to work, use this instead }) } else { diff --git a/src/config/firefox/manifest.json b/src/config/firefox/manifest.json index ef47340d925e4d6cac8159af874972ac4b859eae..a6e14f7c106b487d20f9e95c27349876d7dd2e49 100755 --- a/src/config/firefox/manifest.json +++ b/src/config/firefox/manifest.json @@ -1,5 +1,5 @@ { - "name": "Octotree", + "name": "GitCodeTree", "version": "$VERSION", "manifest_version": 2, "author": "inu1255", @@ -10,8 +10,12 @@ "64": "icons/icon64.png" }, "permissions": [ - "https://*.github.com/*", - "https://*.bitbucket.org/*", + "https://github.com/*", + "http://git.oschina.net/*", + "https://git.oschina.net/*", + "http://gitee.com/*", + "https://gitee.com/*", + "https://bitbucket.org/*", "storage" ], "web_accessible_resources": ["*.woff2"], @@ -19,6 +23,7 @@ { "matches": [ "https://github.com/*", + "https://gitee.com/*", "https://bitbucket.org/*" ], "js": [ diff --git a/src/config/safari/Info.plist b/src/config/safari/Info.plist index de42024d6273cfd1c0de700e5bebb8a046676d10..d8bf9002982c4ed90336a86000765a6bdc03dad3 100755 --- a/src/config/safari/Info.plist +++ b/src/config/safari/Info.plist @@ -29,12 +29,14 @@ jstree.js keymaster.js ondemand.js + file-icons.js octotree.js Stylesheets jstree.css + file-icons.css octotree.css Whitelist diff --git a/src/styles/base.less b/src/styles/base.less index 6814d2632660380d87064dc1cce0edc84b2642af..eae72a853e1e866f5ff6b4f7fea77e238eaefc62 100755 --- a/src/styles/base.less +++ b/src/styles/base.less @@ -177,6 +177,15 @@ font-size: 12px; margin-left: 17px; } + + .octotree_opts_backing { + color: gray; + font-size: 12px; + margin-left: 2px; + a { + float: none; + } + } } } diff --git a/src/template.html b/src/template.html index 83f1e6d392e43c406976144385060087fbeea903..28f561713f626a2f9a9b87c805ac45357ab79964 100644 --- a/src/template.html +++ b/src/template.html @@ -7,9 +7,9 @@ @@ -29,11 +29,11 @@
- +
- 为什么需要填写token? + 为什么它是必填的?
@@ -43,8 +43,8 @@
设置
- - + + @@ -57,6 +57,22 @@
+ +
+
+ +
+ +
+ + + +
+ +
+ +
@@ -66,20 +82,24 @@
- +
+ +
+ 感觉很棒? 捐赠 支持 Octotree 的作者继续他的开发工作。 +