GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add files via upload · DroidScript/Plugin-JavaScript@18e375c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • MyPlugin
    • MyPlugin.html
    • MyPlugin.inc
    • Version.txt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎MyPlugin/MyPlugin.html‎

Copy file name to clipboard
+107Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
2+
<!DOCTYPE html>
3+
<html>
4+
5+
<head>
6+
<title>MyPlugin</title>
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<style type="text/css">
9+
</style>
10+
</head>
11+
12+
<body>
13+
14+
<div data-role="page" data-theme="a">
15+
16+
<div data-role="header" data-position="fixed">
17+
<a href='#' class='ui-btn-left' data-icon='arrow-l' data-theme="c" onclick="history.back(); return false">Back</a>
18+
<h1>MyPlugin</h1>
19+
</div><!-- /header -->
20+
21+
<div data-role="content">
22+
23+
<p> Todo: Documentation for MyPlugin</p>
24+
25+
<p>In order to use MyPlugin, you must first load the plugin at the top of your script
26+
using the <b>LoadPlugin</b> method like this:</p>
27+
28+
<div class="samp">&nbsp;app.LoadPlugin( "MyPlugin" );</div>
29+
30+
<p>Then you can create an instance of the plugin object when you need it like this:</p>
31+
32+
<div class="samp">&nbsp;plg = app.CreateObject( "MyPlugin" );</div>
33+
34+
<br>
35+
<p>Examples:</p>
36+
37+
<div data-role="collapsible" data-collapsed="true" data-mini="true" data-theme="a" data-content-theme="b">
38+
<h3>Example - Get Version</h3>
39+
<div id="examp1" style="font-size:70%">
40+
app.LoadPlugin( "MyPlugin" );<br>
41+
<br>
42+
function OnStart()<br>
43+
{<br>
44+
&nbsp;&nbsp;lay = app.CreateLayout( "Linear", "VCenter,FillXY" );<br><br>
45+
&nbsp;&nbsp;btn = app.CreateButton( "Press Me" );<br>
46+
&nbsp;&nbsp;btn.SetOnTouch( CallPlugin );<br>
47+
&nbsp;&nbsp;lay.AddChild( btn );<br><br>
48+
<b id="snip1" style="font-size:100%">
49+
&nbsp;&nbsp;plg = app.CreateObject( "MyPlugin" );<br>
50+
</b><br>
51+
&nbsp;&nbsp;app.AddLayout( lay );<br>
52+
}<br>
53+
<br>
54+
function CallPlugin()<br>
55+
{<br>
56+
&nbsp;&nbsp;alert( plg.GetVersion() );<br>
57+
}<br><br>
58+
59+
</div>
60+
<div name="divCopy" align="right">
61+
<a href="#" data-role="button" data-mini="true" data-inline="true" onclick="copy(snip1)">&nbsp;&nbsp;Copy&nbsp;&nbsp;</a>
62+
<a href="#" data-role="button" data-mini="true" data-inline="true" onclick="copy(examp1)">Copy All</a>
63+
<a href="#" data-role="button" data-mini="true" data-inline="true" onclick="demo(examp1)">&nbsp;&nbsp;&nbsp;Run&nbsp;&nbsp;&nbsp;</a>
64+
</div>
65+
</div>
66+
67+
68+
<div data-role="collapsible" data-collapsed="true" data-mini="true" data-theme="a" data-content-theme="b">
69+
<h3>Example - Test Callback</h3>
70+
<div id="examp2" style="font-size:70%">
71+
app.LoadPlugin( "MyPlugin" );<br>
72+
<br>
73+
function OnStart()<br>
74+
{<br>
75+
&nbsp;&nbsp;lay = app.CreateLayout( "Linear", "VCenter,FillXY" );<br><br>
76+
&nbsp;&nbsp;btn = app.CreateButton( "Press Me" );<br>
77+
&nbsp;&nbsp;btn.SetOnTouch( CallPlugin );<br>
78+
&nbsp;&nbsp;lay.AddChild( btn );<br><br>
79+
<b id="snip2" style="font-size:100%">
80+
&nbsp;&nbsp;plg = app.CreateObject( "MyPlugin" );<br>
81+
&nbsp;&nbsp;plg.SetOnMyReply( OnMyReply );<br>
82+
</b><br>
83+
&nbsp;&nbsp;app.AddLayout( lay );<br>
84+
}<br>
85+
<br>
86+
function CallPlugin()<br>
87+
{<br>
88+
&nbsp;&nbsp;plg.MyFunc( "hello", 21, true );<br>
89+
}<br><br>
90+
function OnMyReply( txt, num, bool )<br>
91+
{<br>
92+
&nbsp;&nbsp;alert( "txt=" + txt + " num=" + num + " bool=" + bool );<br>
93+
}<br>
94+
</div>
95+
<div name="divCopy" align="right">
96+
<a href="#" data-role="button" data-mini="true" data-inline="true" onclick="copy(snip2)">&nbsp;&nbsp;Copy&nbsp;&nbsp;</a>
97+
<a href="#" data-role="button" data-mini="true" data-inline="true" onclick="copy(examp2)">Copy All</a>
98+
<a href="#" data-role="button" data-mini="true" data-inline="true" onclick="demo(examp2)">&nbsp;&nbsp;&nbsp;Run&nbsp;&nbsp;&nbsp;</a>
99+
</div>
100+
</div>
101+
102+
</div><!-- /content -->
103+
104+
</div><!-- /page -->
105+
106+
</body>
107+
</html>
Collapse file

‎MyPlugin/MyPlugin.inc‎

Copy file name to clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
function MyPlugin()
3+
{
4+
this.callback = null;
5+
6+
this.GetVersion = function( num, txt )
7+
{
8+
return 1.0;
9+
}
10+
11+
this.MyFunc = function( txt, num, bool )
12+
{
13+
this.callback( txt + " World!!", num+20, !bool );
14+
}
15+
16+
this.SetOnMyReply = function( cb )
17+
{
18+
this.callback = cb;
19+
}
20+
}
Collapse file

‎MyPlugin/Version.txt‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.00

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.