Skip to content

Commit

Permalink
💡 chore: rename
Browse files Browse the repository at this point in the history
Signed-off-by: SimonShiki <[email protected]>
  • Loading branch information
SimonShiki committed Nov 11, 2023
1 parent 16112b8 commit 05d1ea6
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 159 deletions.
10 changes: 5 additions & 5 deletions README-ja_JP.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<div align="center">

<img alt="logo" src="./assets/chibi.png" width="200px">
<img alt="logo" src="./assets/eureka.svg" width="200px">

# Chibi (チビ)
# Eureka

#### とあるユニバーサル Scratch 拡張機能ローダーです。

</div>

---

Chibi は Tampermonkey/GreasyMonkey に対応するユーザースクリプトであり、「どのエディターでも拡張機能が使える」という仕様が搭載されています(理論的に)。
Eureka は Tampermonkey/GreasyMonkey に対応するユーザースクリプトであり、「どのエディターでも拡張機能が使える」という仕様が搭載されています(理論的に)。

# ✨ 仕様

Expand Down Expand Up @@ -42,12 +42,12 @@ Chibi は Tampermonkey/GreasyMonkey に対応するユーザースクリプト
> うん…エディターによって、ボタンが正常に現れない場合もあります。その時は DevTools で拡張機能をロードできます。
1. 'Ctrl + Shift + J' (Windows) / 'Cmd + Opt + J' (MacOS) で DevTools を開きます。
2. コンソールで ``chibi.openFrontend()````chibi.loader.load([extensionURL], [load mode, like 'unsandboxed'])'``を実行します。
2. コンソールで ``eureka.openFrontend()````eureka.loader.load([extensionURL], [load mode, like 'unsandboxed'])'``を実行します。
3. これで完成。

# 🥰 拡張機能の投稿

Chibi のダッシュボードには拡張機能のギャラリーがあります。どうぞ自由に好きな拡張機能を使ってください。
Eureka のダッシュボードには拡張機能のギャラリーがあります。どうぞ自由に好きな拡張機能を使ってください。

もし良かったら [moth](https://github.com/SimonShiki/moth) で自分の一番好きな拡張機能を投稿してください。

Expand Down
12 changes: 6 additions & 6 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div align="center">

<img alt="logo" src="./assets/chibi.png" width="200px">
<img alt="logo" src="./assets/eureka.svg" width="200px">

# Chibi (琪比)
# Eureka
#### 一个全平台 Scratch 扩展加载器。

</div>

---

Chibi 是一个用户脚本,可以在任何基于 Scratch 的编辑器中加载第三方扩展(理论上)。
Eureka 是一个用户脚本,可以在任何基于 Scratch 的编辑器中加载第三方扩展(理论上)。
# ✨ 功能
- [x] 加载标准 Scratch 扩展
- [x] 加载非沙盒扩展
Expand All @@ -31,17 +31,17 @@ Chibi 是一个用户脚本,可以在任何基于 Scratch 的编辑器中加

# 🔥 使用方法
1. 安装一个用户脚本管理器扩展, 例如 Tampermonkey 或 Greasymonkey。
2. 打开[发布页](https://github.com/SimonShiki/chibi/releases), 点击一个版本来安装。
2. 打开[发布页](https://github.com/SimonShiki/eureka/releases), 点击一个版本来安装。
3. 在'自定义积木'分类栏中找到'Open Frontend'按钮,点击它即可侧载你的扩展。(你可能需要 5 秒来等待按钮出现)

> 嗯...也许因为编辑器差异,按钮并不会正常显示。不过别担心,你还可以通过其他的方式来侧载你的扩展!
1. 按 'F12' 来打开开发者工具。
2. 在控制台输入并执行 ``chibi.openFrontend()````chibi.loader.load([extensionURL], [load mode, like 'unsandboxed'])'``
2. 在控制台输入并执行 ``eureka.openFrontend()````eureka.loader.load([extensionURL], [load mode, like 'unsandboxed'])'``
3. 大功告成!

# 🥰 贡献扩展
Chibi 的前端提供了一个扩展橱窗,你可以在其中任意挑选你喜欢的扩展。我们同样欢迎你将自己的扩展投稿至橱窗中。欲知详情请访问[moth](https://github.com/SimonShiki/moth)
Eureka 的前端提供了一个扩展橱窗,你可以在其中任意挑选你喜欢的扩展。我们同样欢迎你将自己的扩展投稿至橱窗中。欲知详情请访问[moth](https://github.com/SimonShiki/moth)

# ⚓ 许可证
AGPL-3.0, 请看 [LICENSE](./LICENSE).
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<div align="center">

<img alt="logo" src="./assets/chibi.png" width="200px">
<img alt="logo" src="./assets/eureka.svg" width="200px">

# Chibi
#### Load Scratch extensions everywhere.
# Eureka
#### Universal Scratch extension loader

</div>

---

Chibi is a userscript which can load 3rd-party extensions in any Scratch-based editors (theoretically).
Eureka is a userscript which can load 3rd-party extensions in any Scratch-based editors (theoretically).
# ✨ Features
- [x] Load Scratch standard extensions
- [x] Unsandboxed extensions
Expand All @@ -33,17 +33,17 @@ Chibi is a userscript which can load 3rd-party extensions in any Scratch-based e

# 🔥 Usage
1. Install UserScript Manager like Tampermonkey or Greasymonkey.
2. Open [release](https://github.com/SimonShiki/chibi/releases), Then click one release to install.
2. Open [release](https://github.com/SimonShiki/eureka/releases), Then click one release to install.
3. Find 'Open Frontend' button in 'My Blocks' category. you can sideload your extension by clicking it. You may have to wait 5 seconds to make the button appeared.

> Or... Due to editor differences, the button may not appear. There are other ways you can sideload extensions.
1. Press 'F12' on your keyboard to open Developer Tools.
2. Input ``chibi.openFrontend()`` or ``chibi.loader.load([extensionURL], [load mode, like 'unsandboxed'])'`` In your console, then enter to execute.
2. Input ``eureka.openFrontend()`` or ``eureka.loader.load([extensionURL], [load mode, like 'unsandboxed'])'`` In your console, then enter to execute.
3. Your extension got loaded!

# 🥰 Contribute extensions
Chibi's front-end provides an extension gallary where you can pick any extension you like. You are also welcome to contribute your own extensions to the gallary. For more information please visit [moth](https://github.com/SimonShiki/moth)
Eureka's front-end provides an extension gallary where you can pick any extension you like. You are also welcome to contribute your own extensions to the gallary. For more information please visit [moth](https://github.com/SimonShiki/moth)

# ⚓ License
AGPL-3.0, see [LICENSE](./LICENSE).
Binary file removed assets/chibi.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/eureka.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "chibi",
"displayName": "Chibi",
"name": "eureka-loader",
"displayName": "Eureka",
"version": "6",
"description": "Load scratch extension everywhere.",
"repository": "https://github.com/SimonShiki/chibi",
"description": "Universal scratch extension loader.",
"repository": "https://github.com/SimonShiki/eureka",
"author": "SimonShiki",
"license": "AGPL-3.0-only",
"private": true,
Expand Down
6 changes: 3 additions & 3 deletions scripts/generate-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const manifest = {
],
web_accessible_resources: [
{
resources: ['scripts/chibi.user.js'],
resources: ['scripts/eureka-loader.user.js'],
matches: pathFiltered()
}
]
Expand Down Expand Up @@ -61,8 +61,8 @@ function zipDirectory (sourceDir, outPath) {
(async function pack () {
console.log(`Packing extension for ${env}`);
fs.copyFileSync(
path.resolve(__dirname, '../dist/chibi.user.js'),
path.resolve(__dirname, '../extension/scripts/chibi.user.js')
path.resolve(__dirname, '../dist/eureka-loader.user.js'),
path.resolve(__dirname, '../extension/scripts/eureka-loader.user.js')
);
fs.writeFileSync(
path.resolve(__dirname, '../extension/manifest.json'),
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type MothDispatched = MothDispatchedAllocate | MothDispatchedLoad | MothDispatch
*/
function getExtensionInfo () {
const processedExtInfo: MothExtensionInfo[] = [];
for (const [extId, ext] of window.chibi.loader.loadedScratchExtension.entries()) {
for (const [extId, ext] of window.eureka.loader.loadedScratchExtension.entries()) {
processedExtInfo.push({
name: extId,
sandboxed: ext.env === 'sandboxed'
Expand All @@ -59,7 +59,7 @@ async function messageHandler (event: MessageEvent) {
{
type: 'handshake',
clientInfo: {
version: Number(window.chibi.version),
version: Number(window.eureka.version),
url: window.location.host
}
},
Expand All @@ -82,7 +82,7 @@ async function messageHandler (event: MessageEvent) {
break;
case 'load':
// Load an extension.
await window.chibi.loader.load(
await window.eureka.loader.load(
event.data.info.url,
event.data.info.sandboxed ? 'sandboxed' : 'unsandboxed'
);
Expand All @@ -95,7 +95,7 @@ async function messageHandler (event: MessageEvent) {
);
break;
case 'updateSettings':
window.chibi.settings[event.data.item.name] = event.data.item.value;
window.eureka.settings[event.data.item.name] = event.data.item.value;
dashboardWindow?.postMessage(
{
type: 'settings',
Expand All @@ -116,8 +116,8 @@ window.addEventListener('message', messageHandler);
*/
function openFrontend (open: typeof window.open) {
dashboardWindow = open(
'https://chibi.codingclip.cc/#manage',
'Chibi',
'https://eureka.codingclip.cc/#manage',
'Eureka',
'popup=yes,status=no,location=no,toolbar=no,menubar=no'
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

declare interface Window {
Blockly?: Partial<ScratchBlocks>;
chibi: {
eureka: {
version: string;
vm?: VM;
blockly?: ScratchBlocks | null;
loader?: ChibiLoader;
loader?: EurekaLoader;
settings: Settings;
registeredExtension: Record<
string,
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { trap, inject } from './injector/inject';
import { log } from './util/log';
const open = window.open;
// @ts-expect-error defined in webpack define plugin
log(`Chibi ${__CHIBI_VERSION__}`);
log(`eureka-loader ${__EUREKA_VERSION__}`);
// Try injecting chibi into the page.
await trap(open);
if (typeof window.chibi.vm !== 'undefined') {
if (typeof window.eureka.vm !== 'undefined') {
// Alright we got the virtual machine, start the injection.
inject(window.chibi.vm);
inject(window.eureka.vm);
} else {
// This is not a Scratch page, stop injecting.
log(`Cannot find vm in this page, stop injecting.`);
Expand Down
Loading

0 comments on commit 05d1ea6

Please sign in to comment.