Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 152 lines (127 sloc) 5.453 kb
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5 <title>inputEx - MapField Usage</title>
6
7 <!-- YUI CSS -->
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
8 <link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
7e3e214 @neyric Moving fields from ext/ to fields/ + Adding the examples on the home pag...
neyric authored
9 <link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css">
10 <link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
11
12 <!-- InputEx CSS -->
7e3e214 @neyric Moving fields from ext/ to fields/ + Adding the examples on the home pag...
neyric authored
13 <link type='text/css' rel='stylesheet' href='../css/inputEx.css' />
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
14
15 <!-- Demo CSS -->
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
16 <link rel="stylesheet" type="text/css" href="css/demo.css"/>
17 <link rel="stylesheet" type="text/css" href="dpSyntaxHighlighter.css">
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
18
19 </head>
20
21 <body class="yui-skin-sam">
22
da2c0c7 @neyric Release 0.5.0
neyric authored
23 <h1>inputEx - MapField Usage</h1>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
24
25 <!-- Example 1 -->
26 <div class='exampleDiv'>
da2c0c7 @neyric Release 0.5.0
neyric authored
27 <h2>Virtual Earth MapField creation</h2>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
28 <p>Use the following code to create a inputEx MapField for Virtual Earth.</p>
29 <div class='demoContainer' id='container1'></div>
30 <div class='codeContainer'>
31 <textarea name="code" class="JScript" cols="60" rows="5">
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
32 var id = 'container1';
33 var api = 'virtualearth';
34 var elExample1 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api});
35
36 var elButton1 = inputEx.cn('button', null, null, "getValue");
37 YAHOO.util.Event.addListener(elButton1, 'click', function() {
38 alert(YAHOO.lang.JSON.stringify(elExample1.getValue()) );
39 });
40 YAHOO.util.Dom.get(id).appendChild(elButton1);
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
41 </textarea>
42 </div>
43 </div>
44
45 <!-- Example 2 -->
46 <div class='exampleDiv'>
da2c0c7 @neyric Release 0.5.0
neyric authored
47 <h2>Yahoo Maps MapField creation</h2>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
48 <p>Use the following code to create a inputEx MapField for Yahoo Maps.</p>
49 <div class='demoContainer' id='container2'></div>
50 <div class='codeContainer'>
51 <textarea name="code" class="JScript" cols="60" rows="5">
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
52 var id = 'container2';
53 var api = 'yahoo';
54 var elExample2 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api});
55
56 var elButton2 = inputEx.cn('button', null, null, "getValue");
57 YAHOO.util.Event.addListener(elButton2, 'click', function() {
58 alert( YAHOO.lang.JSON.stringify(elExample2.getValue()) );
59 });
60 YAHOO.util.Dom.get(id).appendChild(elButton2);
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
61 </textarea>
62 </div>
63 </div>
64
65 <!-- Example 3 -->
66 <div class='exampleDiv'>
da2c0c7 @neyric Release 0.5.0
neyric authored
67 <h2>Google Maps MapField creation</h2>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
68 <p>Use the following code to create a inputEx MapField for Google Maps.</p>
69 <div class='demoContainer' id='container3'></div>
70 <div class='codeContainer'>
71 <textarea name="code" class="JScript" cols="60" rows="5">
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
72 var id = 'container3';
73 var api = 'google';
74 var elExample3 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api});
75
76 var elButton3 = inputEx.cn('button', null, null, "getValue");
77 YAHOO.util.Event.addListener(elButton3, 'click', function() {
78 alert( YAHOO.lang.JSON.stringify(elExample3.getValue()) );
79 });
80 YAHOO.util.Dom.get(id).appendChild(elButton3);
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
81 </textarea>
82 </div>
83 </div>
84
85 <!-- Example 4 -->
86 <div class='exampleDiv'>
da2c0c7 @neyric Release 0.5.0
neyric authored
87 <h2>Default MapField creation</h2>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
88 <p>
89 Use the following code to create a inputEx MapField for whatever the default API is.
90 We should complete this example by making buttons to change the default and store
91 that in cookies.
92 </p>
93 <div class='demoContainer' id='container4'></div>
94 <div class='codeContainer'>
95 <textarea name="code" class="JScript" cols="60" rows="5">
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
96 var id = 'container4';
97 var elExample4 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px'});
98
99 var elButton4 = inputEx.cn('button', null, null, "getValue");
100 YAHOO.util.Event.addListener(elButton4, 'click', function() {
101 alert( YAHOO.lang.JSON.stringify(elExample4.getValue()) );
102 });
103 YAHOO.util.Dom.get(id).appendChild(elButton4);
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
104 </textarea>
105 </div>
106 </div>
107
108 <!-- YUI Library -->
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
109 <script type="text/javascript" src="../lib/yui/utilities/utilities.js"></script>
7e3e214 @neyric Moving fields from ext/ to fields/ + Adding the examples on the home pag...
neyric authored
110 <script type="text/javascript" src="../lib/yui/container/container-min.js"></script>
111 <script type="text/javascript" src="../lib/yui/json/json-min.js"></script>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
112
113 <!-- Yahoo Maps AJAX API -->
114 <!--
115 <script type="text/javascript">
116 YMAPPID = 'Nk0DZDzV34FM2CIAsdRAtUgQJRSsJO7x2l5tuDBduamC_gZWkzyTEqcUJxAWjtqxs9Wnxb0-';
117 </script>
118 <script type="text/javascript" src="xhttp://us.js2.yimg.com/us.js.yimg.com/lib/map/js/api/ymapapi_3_8_0_7.js">
119 </script>
120 -->
121
122 <!-- InputEx -->
7e3e214 @neyric Moving fields from ext/ to fields/ + Adding the examples on the home pag...
neyric authored
123 <script src="../js/inputex.js" type='text/javascript'></script>
124 <script src="../js/Field.js" type='text/javascript'></script>
125 <script src="../js/fields/MapField.js" type='text/javascript'></script>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
126
127 <script>
128
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
129 // set up Virtual Earth as the default API
130 inputEx.MapFieldGlobals['api'] = 'virtualearth';
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
131
132 // how to set Google Maps as the default API; note the per-host API keys
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
133 inputEx.MapFieldGlobals['api'] = 'google';
134 inputEx.MapFieldGlobals['api_key'] = {
135 'localhost' : 'ABQIAAAADeqGsYygYHMVWXMDJEowhBRA0pJg_vyJNqxN8QciTwW1nvTY9xTHCJ6F7R04FjG06dKgcV5wpIxzZQ',
136 'code.davidjanes.com' : 'ABQIAAAADeqGsYygYHMVWXMDJEowhBRA0pJg_vyJNqxN8QciTwW1nvTY9xTHCJ6F7R04FjG06dKgcV5wpIxzZQ',
137 'javascript.neyric.com' : ''
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
138 }
139
140 // how to set up Yahoo Maps as the default API
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
141 inputEx.MapFieldGlobals['api'] = 'yahoo';
142 inputEx.MapFieldGlobals['Nk0DZDzV34FM2CIAsdRAtUgQJRSsJO7x2l5tuDBduamC_gZWkzyTEqcUJxAWjtqxs9Wnxb0-'] = 'yahoo';
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
143
144 </script>
145
779f48a @neyric refactor examples using inputex-examples.js
neyric authored
146 <!-- inputEx examples -->
147 <script src="js/dpSyntaxHighlighter.js"></script>
148 <script src="inputex-examples.js"></script>
c42b1a1 @neyric Adding MapField from David Janes
neyric authored
149
150 </body>
151 </html>
Something went wrong with that request. Please try again.