Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 551 lines (246 sloc) 12.151 kb
3f9785e @jasonlau Added valid_key function.
authored
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
5
6
7 <head>
8
9 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
10
11 <meta name="author" content="JasonLau.biz" />
12
13 <!-- /*
14
15
16
17 SWF-Capabilities
18
19 ==================================================================
20
21 ©2011 JasonLau.biz
22
23 ==================================================================
24
25 This program is free software: you can redistribute it and/or modify
26
27 it under the terms of the GNU General Public License as published by
28
29 the Free Software Foundation, either version 3 of the License, or
30
31 (at your option) any later version.
32
33
34
35 This program is distributed in the hope that it will be useful,
36
37 but WITHOUT ANY WARRANTY; without even the implied warranty of
38
39 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40
41 GNU General Public License for more details.
42
43
44
45 You should have received a copy of the GNU General Public License
46
47 along with this program. If not, see <http://www.gnu.org/licenses/>.
48
49
50
51 */ -->
52
53
54
55 <title>SWF-Capabilities Demo</title>
56
57 <!-- BEGIN SWF-Capabilities -->
58
59 <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
60
61 <script type="text/javascript" src="http://swfobject.googlecode.com/svn/trunk/swfobject/swfobject.js"></script>
62
63 <script type="text/javascript">
64
65 $(function(){
66
67
68
69 var params = {
70
71 allowscriptaccess: 'local',
72
73 swliveconnect: 'true',
74
75 wmode: 'transparent'
76
77 };
78
79 var attributes = {
80
81 id: 'capabilities'
82
83 };
84
85 swfobject.embedSWF('swf_capabilities.swf?version=' + Math.floor(Math.random()*1000) + '', 'container-div', '1', '1', '10', 'http://swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf', null, params, attributes);
86
87
88
89
90
91 var cn = "test" + Math.floor(Math.random()*1000),
92
93 cv = Math.floor(Math.random()*10000);
94
95 $("#cookie-name").val(cn);
96
97 $("#cookie-value").val(cv);
98
99 $(".cookie-name").html(cn);
100
101 $(".cookie-value").html(cv);
102
103
104
105 $("#cookies-accepted").mouseup(function(){
106
107 if(capabilities.cookies_accepted()){
108
109 alert("Cookies Accepted!");
110
111 } else {
112
113 alert("Cookies Not Accepted! Reinstall Flash or check your Flash settings!");
114
115 }
116
117 });
118
119
120
121 $("#system-capabilities-full").mouseup(function(){
122
123 var sc = capabilities.get_capabilities(false);
124
125 if(sc){
126
127 var data = 'This is the contents of the Capabilities object - \n\n';
128
129 $.each(sc, function(key, value) {
130
131 data += key + '=>' + value + '\n';
132
133 });
134
135 alert(data);
136
137 } else {
138
139 alert("Failed to fetch system capabilities!");
140
141 }
142
143 });
144
145
146
147 $("#system-capabilities-str").mouseup(function(){
148
149 var sc = capabilities.get_capabilities(true);
150
151 if(sc){
152
153 alert(sc);
154
155 } else {
156
157 alert("Failed to fetch system capabilities!");
158
159 }
160
161 });
162
163
164
165 $("#system-capabilities-one").mouseup(function(){
166
167 var sc = capabilities.get_capabilities($(this).attr('rel'));
168
169 if(sc){
170
171 alert(sc);
172
173 } else {
174
175 alert("Failed to fetch system capability!");
176
177 }
178
179 });
180
181
182
183 $("#is-match").mouseup(function(){
184
185 c = capabilities.get_capabilities();
186
187 var match = capabilities.is_match(c);
188
189 if(match){
190
191 alert("We have a match!");
192
193 } else {
194
195 alert("Not a match!");
196
197 }
198
199 });
200
201
202
203 $("#set-cookie").mouseup(function(){
204
205 var sc = capabilities.set_cookie($("#cookie-name").val(),$("#cookie-value").val());
206
207 if(sc){
208
209 var c_data = capabilities.get_cookie($("#cookie-name").val());
210
211 alert("Cookie successfully set. Cookie Name: " + $("#cookie-name").val());
212
213 } else {
214
215 alert("Failed to set cookie!");
216
217 }
218
219 });
220
221
222
223 $("#get-cookie").mouseup(function(){
224
225 var sc = capabilities.get_cookie($("#cookie-name").val());
226
227 if(sc){
228
229 alert("Cookie successfully fetched! Cookie Name: " + $("#cookie-name").val() + " Cookie Value: " + sc);
230
231 } else {
232
233 alert("Failed to fetch cookie!");
234
235 }
236
237 });
238
239
240
241 $("#unset-cookie").mouseup(function(){
242
243 var sc = capabilities.unset_cookie($("#cookie-name").val());
244
245 if(sc){
246
247 alert("Cookie successfully deleted! ");
248
249 } else {
250
251 alert("Failed to delete cookie or no cookie existed!");
252
253 }
254
255 });
256
257
258
259 $("#set-key").mouseup(function(){
260
261 var k = capabilities.set_key(150,"abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789");
262
263 if(k){
264
265 var k_data = capabilities.get_key();
266
267 alert("Random key successfully set. Cookie Name: " + k);
268
269 } else {
270
271 alert("Failed to set cookie!");
272
273 }
274
275 });
50b3b2c @jasonlau Added demo.html
authored
276
Something went wrong with that request. Please try again.