Skip to content

Commit

Permalink
updated loader url: pages, version switcher, templates (compressed) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
theodoravraimakis authored Feb 3, 2025
1 parent 6fe7c96 commit af4d905
Show file tree
Hide file tree
Showing 33 changed files with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { product } = Astro.props;
class="px-2 py-1 rounded bg-transparent text-stone-400 font-medium"
id="version-switcher"
>
<option value="cheerpj3" selected={product.id === "cheerpj3"}>v3.0</option>
<option value="cheerpj3" selected={product.id === "cheerpj3"}>v3.1</option>
<option value="cheerpj2" selected={product.id === "cheerpj2"}>v2.3</option>
</select>
</div>
Expand Down
Binary file not shown.
Binary file modified sites/cheerpj/public/cheerpj3/tutorials/FoilSim-Applet.zip
Binary file not shown.
Binary file not shown.
Binary file modified sites/cheerpj/public/cheerpj3/tutorials/applet-template.zip
Binary file not shown.
Binary file modified sites/cheerpj/public/cheerpj3/tutorials/browserTutorial.zip
Binary file not shown.
Binary file modified sites/cheerpj/public/cheerpj3/tutorials/swingset3-template.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sites/cheerpj/src/content/docs/00-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import AppletRunnerButton from "@leaningtech/astro-theme/components/AppletRunner
</div>

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

<div class="mx-24">![](./explanation-diagram.png)</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Let's create a basic HTML file like the following example. Please notice the Che
<head>
<meta charset="utf-8" />
<title>CheerpJ test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In order to integrate CheerpJ, you just need to add:
1. A simple `<script>` within the `<head>` of your page with the CheerpJ runtime loader.

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

2. A second script calling [`cheerpjInit()`] to initialize CheerpJ's runtime environment.
Expand All @@ -57,7 +57,7 @@ For example:
<head>
<meta charset="utf-8" />
<title>CheerpJ applet test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<applet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Use Java classes in JavaScript
## 1. Include CheerpJ on your page

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

## 2. Initialize CheerpJ and load your Java library
Expand Down
4 changes: 2 additions & 2 deletions sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Example of an HTML file for an app where the class name is included in the manif
<head>
<meta charset="utf-8" />
<title>CheerpJ test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down Expand Up @@ -164,7 +164,7 @@ The HTML for an applet would look like this:
<head>
<meta charset="utf-8" />
<title>CheerpJ applet test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<applet
Expand Down
2 changes: 1 addition & 1 deletion sites/cheerpj/src/content/docs/11-guides/cheerpj-debug.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The reason your application isn't working could be quite simple. Try these check
- You integrated CheerpJ into your web page by adding a `<script>` tag like this:

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

- The location of your JARs is correct and the prefix `/app/` is added when passing it to [`cheerpjRunJar`] or [`cheerpjRunMain`]. For more information visit the [virtual filesystem] guide.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default {
<html>
<head>
<title>Native Method Example</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Here, we provide an implementation for the `nativeAlert` method in the `Example`
<html>
<head>
<title>Native Method Example</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Visit the URL shown in the terminal and you should see a blank page. Leave Vite
Let's add CheerpJ to the page by adding this script tag to the `<head>`:

```html title="index.html"
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

## 3. Initialise CheerpJ and run the jar
Expand Down
2 changes: 1 addition & 1 deletion sites/cheerpj/src/content/docs/13-tutorials/01-applet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Your document will look like this:
<head>
<meta charset="utf-8" />
<title>FoilSim applet (CheerpJ)</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<style>
div {
Expand Down
8 changes: 4 additions & 4 deletions sites/cheerpj/src/content/docs/13-tutorials/02-jnlp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Inside our project directory `cheerpj-example-swingset3` we will create a basic
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>SwingSet3 (CheerpJ)</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
<style>
html,
body {
Expand Down Expand Up @@ -146,7 +146,7 @@ Inside our project directory `cheerpj-example-swingset3` we will create a basic
- The CheerpJ runtime environment is being integrated at:

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

- [`cheerpjInit()`] initializes the CheerpJ runtime environment
Expand Down Expand Up @@ -262,7 +262,7 @@ Inside the project directory, create an HTML file called `index.html` like the f
<head>
<meta charset="utf-8" />
<title>Pitch applet (CheerpJ)</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<style>
div {
Expand Down Expand Up @@ -317,7 +317,7 @@ Inside the project directory, create an HTML file called `index.html` like the f
- The CheerpJ runtime environment is being integrated at:

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

- The `<cheerpj-applet>` tag contains the applet `.jar` location, size and class name. This tag prevents conflicts with native java, the classic `<applet>` tag can also be used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Copy and paste this code in your `browser.html` file:
<head>
<meta charset="utf-8" />
<title>Browser</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mkdir -p ServerClientTutorial/{Server, Client}
<head>
<meta charset="utf-8" />
<title>Server</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<input type="text" id="ip"></input>
Expand Down Expand Up @@ -126,7 +126,7 @@ http-server -p 8080
<head>
<meta charset="utf-8" />
<title>Client</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<input type="text" id="ip"></input>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The `sendInputToJava` function:
To use CheerpJ, include the following script in the `<head>` section of `index.html`:

```js title="index.html"
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

To load CheerpJ, we initialize it in the HTML file with specific configurations for native methods.
Expand Down
4 changes: 2 additions & 2 deletions sites/cheerpj/src/content/docs/21-migrating-from-cheerpj2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CheerpJ 3 is a complete reimplementation of CheerpJ 2, and as such it is not ful
Include CheerpJ 3 on your page with the following snippet:

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

## Breaking changes
Expand Down Expand Up @@ -37,7 +37,7 @@ This feature had no real use case because when using `java -jar`, the JAR file i
CheerpJ can now be imported in a Web Worker without any special setup. Simply call [`importScripts`](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts) from a worker to load CheerpJ, then use CheerpJ as usual. The `CheerpJWorker` class has been removed.

```js
importScripts("https://cjrtnc.leaningtech.com/3.0/cj3loader.js");
importScripts("https://cjrtnc.leaningtech.com/3.1/cj3loader.js");

// Use CheerpJ as usual
(async () => {
Expand Down
4 changes: 2 additions & 2 deletions sites/cheerpj/src/content/docs/ja/00-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { DISCORD_URL } from "@/consts.ts";
</div>

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

<div class="text-stone-400">
Expand Down Expand Up @@ -185,4 +185,4 @@ CheerpJを使用しているコミュニティプロジェクトには、次の
[Javaライブラリ]: /docs/ja/getting-started/Java-library
[ネットワーキング]: /docs/ja/guides/Networking
[仮想ファイルシステム]: /docs/ja/guides/File-System-support
[クリップボード]: /docs/ja/reference/cheerpjInit#clipboardmode
[クリップボード]: /docs/ja/reference/cheerpjInit#clipboardmode
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mkdir directory_name
<head>
<meta charset="utf-8" />
<title>CheerpJ test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CheerpJを統合するには、次の手順を実行するだけです:
1. ページの`<head>`内にCheerpJランタイムローダーを含むシンプルな`<script>`を追加します。

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

2. CheerpJのランタイム環境を初期化するために、2番目の`<script>`[`cheerpjInit()`]を呼び出します。
Expand All @@ -48,7 +48,7 @@ CheerpJを統合するには、次の手順を実行するだけです:
<head>
<meta charset="utf-8" />
<title>CheerpJ applet test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<applet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: JavaScriptでJavaクラスを使用する
## 1. ページにCheerpJを含める

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

## 2. CheerpJを初期化し、Javaライブラリを読み込む
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ CheerpJランタイムが統合され、Javaアプリケーションが表示さ
<head>
<meta charset="utf-8" />
<title>CheerpJ test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down Expand Up @@ -154,7 +154,7 @@ cheerpjRunMain(
<head>
<meta charset="utf-8" />
<title>CheerpJ applet test</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<applet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ npx vite
次に、`<head>`に以下のスクリプトタグを追加して、CheerpJをページに追加しましょう:

```html title="index.html"
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

## 3. CheerpJを初期化し、jarを実行する
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ http-server -p 8080
<head>
<meta charset="utf-8" />
<title>FoilSim applet (CheerpJ)</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<style>
div {
Expand Down
8 changes: 4 additions & 4 deletions sites/cheerpj/src/content/docs/ja/13-tutorials/02-jnlp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ JNLPのディレクトリ構造に従って、このディレクトリ内にア
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>SwingSet3 (CheerpJ)</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
<style>
html,
body {
Expand Down Expand Up @@ -145,7 +145,7 @@ JNLPのディレクトリ構造に従って、このディレクトリ内にア
- CheerpJランタイム環境は次のように統合されています:

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

- [`cheerpjInit()`] はCheerpJランタイム環境を初期化します。
Expand Down Expand Up @@ -259,7 +259,7 @@ mkdir cheerpj-example-applet
<head>
<meta charset="utf-8" />
<title>Pitch applet (CheerpJ)</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<style>
div {
Expand Down Expand Up @@ -314,7 +314,7 @@ mkdir cheerpj-example-applet
- CheerpJランタイム環境は次のように統合されています:

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

- `<cheerpj-applet>` タグには、アプレットの `.jar` の場所、サイズ、クラス名が含まれています。 このタグはネイティブのJavaとの衝突を防ぐもので、古典的な `<applet>` タグも使用できます。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CheerpJとTailscaleがどのように連携するかに詳しくない場合は
<head>
<meta charset="utf-8" />
<title>Browser</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mkdir -p ServerClientTutorial/{Server, Client}
<head>
<meta charset="utf-8" />
<title>Server</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<input type="text" id="ip"></input>
Expand Down Expand Up @@ -126,7 +126,7 @@ http-server -p 8080
<head>
<meta charset="utf-8" />
<title>Client</title>
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
</head>
<body>
<input type="text" id="ip"></input>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CheerpJ 3はCheerpJ 2の完全な再実装であり、そのため後方互換
CheerpJ 3をページに含めるには、以下のコードを使用してください:

```html
<script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script>
<script src="https://cjrtnc.leaningtech.com/3.1/cj3loader.js"></script>
```

## 互換性の破壊的変更
Expand Down Expand Up @@ -37,7 +37,7 @@ JavaからJavaScript関数を呼び出すには、`cheerpjInit`の`natives` オ
CheerpJは、特別な設定なしでWeb Workerにインポートできるようになりました。単にワーカーから[`importScripts`](https://developer.mozilla.org/ja/docs/Web/API/WorkerGlobalScope/importScripts) を呼び出してCheerpJをロードし、通常通りCheerpJを使用してください。`CheerpJWorker` クラスは削除されました。

```js
importScripts("https://cjrtnc.leaningtech.com/3.0/cj3loader.js");
importScripts("https://cjrtnc.leaningtech.com/3.1/cj3loader.js");

// 通常通りCheerpJを使用
(async () => {
Expand Down

0 comments on commit af4d905

Please sign in to comment.