wails/v3/examples/ios/frontend/index.html
Lea Anthony 873848a077 Merge iOS support from v3-alpha-feature/ios-support
This commit integrates iOS platform support for Wails v3, adapting the
iOS-specific code to work with the new transport layer architecture.

Key changes:
- Add iOS-specific application, webview, and runtime files
- Add iOS event types and processing
- Add iOS examples and templates
- Update messageprocessor to handle iOS requests
- Move badge_ios.go to dock package

Note: The iOS branch was based on an older v3-alpha and required
significant conflict resolution due to the transport layer refactor
(PR #4702). Some iOS-specific code may need further adaptation:
- processIOSMethod needs to be implemented with new RuntimeRequest signature
- iOS event generation in tasks/events/generate.go needs updating

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 18:34:21 +11:00

96 lines
5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/wails.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/style.css"/>
<title>Wails App</title>
</head>
<body>
<div class="container">
<div>
<a data-wml-openURL="https://wails.io">
<img src="/wails.png" class="logo" alt="Wails logo"/>
</a>
<a data-wml-openURL="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
<img src="/javascript.svg" class="logo vanilla" alt="JavaScript logo"/>
</a>
</div>
<h1>Wails + Javascript</h1>
<div class="card mobile-pane">
<div class="result">Demo Screens</div>
<div class="p-mobile-tabs-content">
<!-- Screen 1: Bindings -->
<div class="p-mobile-tabs--content active" id="screen-bindings">
<div class="result" id="result">Please enter your name below 👇</div>
<div class="input-box" id="input">
<input class="input" id="name" type="text" autocomplete="off"/>
<button class="p-btn p-prim-col" onclick="doGreet()">Greet</button>
</div>
</div>
<!-- Screen 2: Go Runtime -->
<div class="p-mobile-tabs--content" id="screen-go">
<div class="input-box">
<label><input type="checkbox" id="goScrollEnabled" checked onchange="setGoToggle('ios:setScrollEnabled', this.checked)"> Scroll Enabled (Go)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="goBounceEnabled" checked onchange="setGoToggle('ios:setBounceEnabled', this.checked)"> Bounce Enabled (Go)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="goIndicatorsEnabled" checked onchange="setGoToggle('ios:setScrollIndicatorsEnabled', this.checked)"> Scroll Indicators (Go)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="goNavGesturesEnabled" onchange="setGoToggle('ios:setBackForwardGesturesEnabled', this.checked)"> Back/Forward Gestures (Go)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="goLinkPreviewEnabled" checked onchange="setGoToggle('ios:setLinkPreviewEnabled', this.checked)"> Link Preview (Go)</label>
</div>
<div class="input-box">
<input class="input" id="uaInputGo" type="text" placeholder="Custom User Agent"/>
<button class="p-btn" onclick="emitGo('ios:setCustomUserAgent', {ua: document.getElementById('uaInputGo').value})">Set UA (Go)</button>
</div>
</div>
<!-- Screen 3: JS Runtime -->
<div class="p-mobile-tabs--content" id="screen-js">
<div class="input-box">
<button class="p-btn" onclick="doHaptic('light')">Haptic: Light</button>
<button class="p-btn" onclick="doHaptic('medium')">Haptic: Medium</button>
<button class="p-btn" onclick="doHaptic('heavy')">Haptic: Heavy</button>
<button class="p-btn p-prim-col" onclick="getDeviceInfo();">Get Device Info</button>
</div>
<div class="input-box">
<label><input type="checkbox" id="jsScrollEnabled" checked onchange="setJsToggle('Scroll.SetEnabled', this.checked)"> Scroll Enabled (JS)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="jsBounceEnabled" checked onchange="setJsToggle('Scroll.SetBounceEnabled', this.checked)"> Bounce Enabled (JS)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="jsIndicatorsEnabled" checked onchange="setJsToggle('Scroll.SetIndicatorsEnabled', this.checked)"> Scroll Indicators (JS)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="jsNavGesturesEnabled" onchange="setJsToggle('Navigation.SetBackForwardGesturesEnabled', this.checked)"> Back/Forward Gestures (JS)</label>
</div>
<div class="input-box">
<label><input type="checkbox" id="jsLinkPreviewEnabled" checked onchange="setJsToggle('Links.SetPreviewEnabled', this.checked)"> Link Preview (JS)</label>
</div>
<div class="input-box">
<input class="input" id="uaInputJs" type="text" placeholder="Custom User Agent"/>
<button class="p-btn" onclick="iosJsSet('UserAgent.Set', {ua: document.getElementById('uaInputJs').value})">Set UA</button>
</div>
<pre id="deviceInfo" style="white-space: pre-wrap; word-break: break-word;"></pre>
</div>
</div>
</div>
<div class="footer">
<div><p>Click on the Wails logo to learn more</p></div>
<div><p id="time">Listening for Time event...</p></div>
</div>
</div>
<script type="module" src="/main.js"></script>
</body>
</html>