Quantcast

Re: [pyamf-commits] r1155 - in examples/trunk: . google_appengine google_appengine/echo google_appengine/static google_appengine/static/swfobject google_appengine/static/swfobject/src google_appengine/templates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pyamf-commits] r1155 - in examples/trunk: . google_appengine google_appengine/echo google_appengine/static google_appengine/static/swfobject google_appengine/static/swfobject/src google_appengine/templates

Arnar Birgisson
Hey Nick,

I think there's no need for the overhead of a script for
crossdomain.xml. Just use "static_files" in the app.yaml:

- url: /crossdomain.xml
  static_files: crossdomain.xml

Arnar

On Thu, Apr 10, 2008 at 2:25 PM, SVN commit logs for PyAMF
<[hidden email]> wrote:

> Author: nick
>  Date: 2008-04-10 16:25:48 +0200 (Thu, 10 Apr 2008)
>  New Revision: 1155
>
>  Added:
>    examples/trunk/google_appengine/
>    examples/trunk/google_appengine/app.yaml
>    examples/trunk/google_appengine/crossdomain.py
>    examples/trunk/google_appengine/echo/
>    examples/trunk/google_appengine/echo/__init__.py
>    examples/trunk/google_appengine/echo/__init__.pyc
>    examples/trunk/google_appengine/echo/gateway.py
>    examples/trunk/google_appengine/echo/index.py
>    examples/trunk/google_appengine/index.html
>    examples/trunk/google_appengine/index.py
>    examples/trunk/google_appengine/static/
>    examples/trunk/google_appengine/static/echo_test.swf
>    examples/trunk/google_appengine/static/swfobject/
>    examples/trunk/google_appengine/static/swfobject/expressInstall.swf
>    examples/trunk/google_appengine/static/swfobject/index.html
>    examples/trunk/google_appengine/static/swfobject/index_dynamic.html
>    examples/trunk/google_appengine/static/swfobject/src/
>    examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
>    examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
>    examples/trunk/google_appengine/static/swfobject/src/swfobject.js
>    examples/trunk/google_appengine/static/swfobject/swfobject.js
>    examples/trunk/google_appengine/static/swfobject/test.swf
>    examples/trunk/google_appengine/templates/
>    examples/trunk/google_appengine/templates/base.html
>    examples/trunk/google_appengine/templates/swf.html
>  Log:
>  Adding working EchoTest Google AppEngine example
>
>
>  Property changes on: examples/trunk/google_appengine
>  ___________________________________________________________________
>  Name: svn:ignore
>    + *.pyc
>  pyamf
>
>
>  Added: examples/trunk/google_appengine/app.yaml
>  ===================================================================
>  --- examples/trunk/google_appengine/app.yaml                            (rev 0)
>  +++ examples/trunk/google_appengine/app.yaml    2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,22 @@
>  +application: pyamf
>  +version: 1
>  +runtime: python
>  +api_version: 1
>  +
>  +handlers:
>  +- url: /
>  +  script: index.py
>  +
>  +- url: /crossdomain.xml
>  +  script: crossdomain.py
>  +
>  +# Echo demo urls
>  +
>  +- url: /echo
>  +  script: echo/index.py
>  +
>  +- url: /gateway/echo
>  +  script: echo/gateway.py
>  +
>  +- url: /static
>  +  static_dir: static
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/crossdomain.py
>  ===================================================================
>  --- examples/trunk/google_appengine/crossdomain.py                              (rev 0)
>  +++ examples/trunk/google_appengine/crossdomain.py      2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,7 @@
>  +print 'Content-Type: application/xml'
>  +print
>  +print """<?xml version="1.0"?>
>  +<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
>  +<cross-domain-policy>
>  +   <allow-access-from domain="*" />
>  +</cross-domain-policy>"""
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/echo/__init__.py
>  ===================================================================
>  --- examples/trunk/google_appengine/echo/__init__.py                            (rev 0)
>  +++ examples/trunk/google_appengine/echo/__init__.py    2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,111 @@
>  +# -*- encoding: utf-8 -*-
>  +#
>  +# Copyright (c) 2007-2008 The PyAMF Project.
>  +# See LICENSE for details.
>  +
>  +"""
>  +Echo test core functionality. This module sets up the class
>  +mappings related to the echo_test.swf client on the
>  +U{EchoTest<http://pyamf.org/wiki/EchoTest>} wiki page.
>  +
>  +@author: U{Nick Joyce<mailto:[hidden email]>}
>  +@since: 0.1.0
>  +"""
>  +
>  +from pyamf import register_class
>  +
>  +ECHO_NS = 'org.red5.server.webapp.echo'
>  +
>  +class RemoteClass(object):
>  +    """
>  +    This Python class is mapped to the clientside ActionScript class.
>  +    """
>  +    pass
>  +
>  +class ExternalizableClass(object):
>  +    """
>  +    An example of an externalizable class.
>  +    """
>  +    def __readamf__(self, input):
>  +        """
>  +        This function is invoked when the C{obj} needs to be deserialized.
>  +
>  +        @type obj: L{ExternalizableClass}
>  +        @param obj: The object in question.
>  +        @param input: The input stream to read from.
>  +        @type input L{DataInput<pyamf.amf3.DataInput>}
>  +        """
>  +        assert input.readBoolean() == True
>  +        assert input.readBoolean() == False
>  +        assert input.readByte() == 0
>  +        assert input.readByte() == -1
>  +        assert input.readByte() == 1
>  +        assert input.readByte() == 127
>  +        assert input.readByte() == -127
>  +        assert input.readDouble() == 1.0
>  +        assert input.readFloat() == 2.0
>  +        assert input.readInt() == 0
>  +        assert input.readInt() == -1
>  +        assert input.readInt() == 1
>  +        input.readMultiByte(7, 'iso-8859-1')
>  +        input.readMultiByte(14, 'utf8')
>  +        assert input.readObject() == [1, 'one', 1.0]
>  +        assert input.readShort() == 0
>  +        assert input.readShort() == -1
>  +        assert input.readShort() == 1
>  +        assert input.readUnsignedInt() == 0
>  +        assert input.readUnsignedInt() == 1
>  +        assert input.readUTF() == "Hello world!"
>  +        assert input.readUTFBytes(12) == "Hello world!"
>  +
>  +    def __writeamf__(self, output):
>  +        """
>  +        This function is invoked when the C{obj} needs to be serialized.
>  +
>  +        @type obj: L{ExternalizableClass}
>  +        @param obj: The object in question.
>  +        @param input: The output stream to write to.
>  +        @type input L{DataOutput<pyamf.amf3.DataOutput>}
>  +        """
>  +        output.writeBoolean(True)
>  +        output.writeBoolean(False)
>  +        output.writeByte(0)
>  +        output.writeByte(-1)
>  +        output.writeByte(1)
>  +        output.writeByte(127)
>  +        output.writeByte(-127)
>  +        output.writeDouble(1.0)
>  +        output.writeFloat(2.0)
>  +        output.writeInt(0)
>  +        output.writeInt(-1)
>  +        output.writeInt(1)
>  +        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf", 'iso-8859-1')
>  +        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf", 'utf8')
>  +        output.writeObject([1, 'one', 1])
>  +        output.writeShort(0)
>  +        output.writeShort(-1)
>  +        output.writeShort(1)
>  +        output.writeUnsignedInt(0)
>  +        output.writeUnsignedInt(1)
>  +        output.writeUTF("Hello world!")
>  +        output.writeUTFBytes("Hello world!")
>  +
>  +def echo(data):
>  +    """
>  +    Return data back to the client.
>  +
>  +    @type data: C{mixed}
>  +    @param data: Decoded AS->Python data.
>  +    """
>  +    return data
>  +
>  +# Map ActionScript class to Python class
>  +try:
>  +    register_class(RemoteClass, '%s.%s' % (ECHO_NS, 'RemoteClass'))
>  +except ValueError:
>  +    pass
>  +try:
>  +    register_class(ExternalizableClass, '%s.%s' % (ECHO_NS,
>  +        'ExternalizableClass'), metadata=['external'])
>  +except ValueError:
>  +    pass
>
>  Added: examples/trunk/google_appengine/echo/__init__.pyc
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on: examples/trunk/google_appengine/echo/__init__.pyc
>  ___________________________________________________________________
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/echo/gateway.py
>  ===================================================================
>  --- examples/trunk/google_appengine/echo/gateway.py                             (rev 0)
>  +++ examples/trunk/google_appengine/echo/gateway.py     2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,17 @@
>  +from pyamf.remoting.gateway.wsgi import WSGIGateway
>  +from google.appengine.ext.webapp import util
>  +
>  +from echo import echo
>  +
>  +services = {
>  +    'echo': echo,
>  +    'echo.echo': echo
>  +}
>  +
>  +def main():
>  +    gateway = WSGIGateway(services)
>  +
>  +    util.run_wsgi_app(gateway)
>  +
>  +if __name__ == "__main__":
>  +    main()
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/echo/index.py
>  ===================================================================
>  --- examples/trunk/google_appengine/echo/index.py                               (rev 0)
>  +++ examples/trunk/google_appengine/echo/index.py       2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,10 @@
>  +from google.appengine.ext.webapp import template
>  +
>  +print "Content-Type: text/html"
>  +print
>  +print template.render('../templates/swf.html', {
>  +    'swf_url': '/static/echo_test.swf',
>  +    'width': '100%',
>  +    'height': '100%',
>  +    'flash_ver': '9.0.0'
>  +})
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/index.html
>  ===================================================================
>  --- examples/trunk/google_appengine/index.html                          (rev 0)
>  +++ examples/trunk/google_appengine/index.html  2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,11 @@
>  +{% extends "templates/base.html" %}
>  +
>  +{% block title %}PyAMF/Google App Engine Demo Application{% endblock %}
>  +
>  +{% block body %}
>  +<h1><a href="http://pyamf.org">PyAMF</a>/<a href="">Google App Engine</a> Demo Application</h1>
>  +<h2>Available demos:</h2>
>  +<ul>
>  +       <li><a href="/echo">EchoTest</a> - Tests all parts of the AMF specification, including AMF0, AMF3 and RemoteObject</li>
>  +</ul>
>  +{% endblock %}
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/index.py
>  ===================================================================
>  --- examples/trunk/google_appengine/index.py                            (rev 0)
>  +++ examples/trunk/google_appengine/index.py    2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,5 @@
>  +from google.appengine.ext.webapp import template
>  +
>  +print "Content-Type: text/html"
>  +print
>  +print template.render('index.html', {})
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/static/echo_test.swf
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on: examples/trunk/google_appengine/static/echo_test.swf
>  ___________________________________________________________________
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/static/swfobject/expressInstall.swf
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on: examples/trunk/google_appengine/static/swfobject/expressInstall.swf
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/static/swfobject/index.html
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/index.html                         (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/index.html 2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,28 @@
>  +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>  +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
>  +       <head>
>  +               <title>SWFObject v2.0 sample page</title>
>  +               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
>  +               <script type="text/javascript" src="swfobject.js"></script>
>  +               <script type="text/javascript">
>  +               swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
>  +               </script>
>  +       </head>
>  +       <body>
>  +               <div>
>  +                       <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="120">
>  +                               <param name="movie" value="test.swf" />
>  +                       <!--[if !IE]>-->
>  +                               <object type="application/x-shockwave-flash" data="test.swf" width="300" height="120">
>  +                               <!--<![endif]-->
>  +                               <div>
>  +                                       <h1>Alternative content</h1>
>  +                                       <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
>  +                               </div>
>  +                               <!--[if !IE]>-->
>  +                               </object>
>  +                               <!--<![endif]-->
>  +                       </object>
>  +               </div>
>  +       </body>
>  +</html>
>
>
>  Property changes on: examples/trunk/google_appengine/static/swfobject/index.html
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>
>  Added: examples/trunk/google_appengine/static/swfobject/index_dynamic.html
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/index_dynamic.html                         (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/index_dynamic.html 2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,17 @@
>  +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>  +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
>  +       <head>
>  +               <title>SWFObject v2.0 dynamic embed sample page</title>
>  +               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
>  +               <script type="text/javascript" src="swfobject.js"></script>
>  +               <script type="text/javascript">
>  +               swfobject.embedSWF("test.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf");
>  +               </script>
>  +       </head>
>  +       <body>
>  +               <div id="myContent">
>  +                       <h1>Alternative content</h1>
>  +                       <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
>  +               </div>
>  +       </body>
>  +</html>
>
>
>  Property changes on: examples/trunk/google_appengine/static/swfobject/index_dynamic.html
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>
>  Added: examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/src/expressInstall.as                              (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/src/expressInstall.as      2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,76 @@
>  +/*     =============================
>  +       SWFObject v2.0 <http://code.google.com/p/swfobject/>
>  +       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
>  +       This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
>  +       =============================
>  +       Express Install
>  +       Copyright (c) 2005-2007 Adobe Systems Incorporated and its licensors. All Rights Reserved.
>  +       =============================
>  +       AS1 version
>  +       =============================
>  +*/
>  +
>  +System.security.allowDomain("fpdownload.macromedia.com");
>  +
>  +var cacheBuster        = Math.random();
>  +var updateSWF  = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+cacheBuster;
>  +var bytes              = loaderClip.getBytesTotal();
>  +loaderClip.loadMovie(updateSWF);
>  +
>  +var time               = 0;
>  +var timeOut            = 5;    // expressed in seconds
>  +var delay              = 10;   // expressed in milliseconds
>  +var id                 = setInterval(checkLoaded, delay);
>  +
>  +function checkLoaded(){
>  +       if(loaderClip.startUpdate.toString() == "[type Function]"){
>  +               // updater has loaded successfully
>  +               clearInterval(id);
>  +               loadComplete();
>  +               return;
>  +       }
>  +       else if(time > timeOut){
>  +               // updater did not load in time, abort load and force alternative content
>  +               clearInterval(id);
>  +               loaderClip.unloadMovie();
>  +               loadTimeOut();
>  +               return;
>  +       }
>  +       time += delay/1000;
>  +}
>  +
>  +function loadComplete(){
>  +       loaderClip.redirectURL  = _root.MMredirectURL;
>  +       loaderClip.MMplayerType = _root.MMplayerType;
>  +       loaderClip.MMdoctitle   = _root.MMdoctitle;
>  +       loaderClip.startUpdate();
>  +}
>  +
>  +function loadTimeOut(){
>  +       callbackSWFObject();
>  +}
>  +
>  +function installStatus(statusValue){
>  +       switch(statusValue){
>  +               case "Download.Complete":
>  +                       // Installation is complete.
>  +                       // In most cases the browser window that this SWF is hosted in will be closed by the installer or
>  +                       // otherwise it has to be closed manually by the end user.
>  +                       // The Adobe Flash installer will reopen the browser window and reload the page containing the SWF.
>  +               break;
>  +               case "Download.Cancelled":
>  +                       // The end user chose "NO" when prompted to install the new player.
>  +                       // By default the SWFObject callback function is called to force alternative content.
>  +                       callbackSWFObject();
>  +               break;
>  +               case "Download.Failed":
>  +                       // The end user failed to download the installer due to a network failure.
>  +                       // By default the SWFObject callback function is called to force alternative content.
>  +                       callbackSWFObject();
>  +               break;
>  +       }
>  +}
>  +
>  +function callbackSWFObject(){
>  +       getURL("javascript:swfobject.expressInstallCallback();");
>  +}
>  \ No newline at end of file
>
>
>  Property changes on: examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>
>  Added: examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on: examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/static/swfobject/src/swfobject.js
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/src/swfobject.js                           (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/src/swfobject.js   2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,631 @@
>  +/*!    SWFObject v2.0 <http://code.google.com/p/swfobject/>
>  +       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
>  +       This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
>  +*/
>  +
>  +var swfobject = function() {
>  +
>  +       var UNDEF = "undefined",
>  +               OBJECT = "object",
>  +               SHOCKWAVE_FLASH = "Shockwave Flash",
>  +               SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
>  +               FLASH_MIME_TYPE = "application/x-shockwave-flash",
>  +               EXPRESS_INSTALL_ID = "SWFObjectExprInst",
>  +
>  +               win = window,
>  +               doc = document,
>  +               nav = navigator,
>  +
>  +               domLoadFnArr = [],
>  +               regObjArr = [],
>  +               timer = null,
>  +               storedAltContent = null,
>  +               storedAltContentId = null,
>  +               isDomLoaded = false,
>  +               isExpressInstallActive = false;
>  +
>  +       /* Centralized function for browser feature detection
>  +               - Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
>  +               - User agent string detection is only used when no alternative is possible
>  +               - Is executed directly for optimal performance
>  +       */
>  +       var ua = function() {
>  +               var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
>  +                       playerVersion = [0,0,0],
>  +                       d = null;
>  +               if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
>  +                       d = nav.plugins[SHOCKWAVE_FLASH].description;
>  +                       if (d) {
>  +                               d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
>  +                               playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
>  +                               playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
>  +                               playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
>  +                       }
>  +               }
>  +               else if (typeof win.ActiveXObject != UNDEF) {
>  +                       var a = null, fp6Crash = false;
>  +                       try {
>  +                               a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
>  +                       }
>  +                       catch(e) {
>  +                               try {
>  +                                       a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
>  +                                       playerVersion = [6,0,21];
>  +                                       a.AllowScriptAccess = "always";  // Introduced in fp6.0.47
>  +                               }
>  +                               catch(e) {
>  +                                       if (playerVersion[0] == 6) {
>  +                                               fp6Crash = true;
>  +                                       }
>  +                               }
>  +                               if (!fp6Crash) {
>  +                                       try {
>  +                                               a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
>  +                                       }
>  +                                       catch(e) {}
>  +                               }
>  +                       }
>  +                       if (!fp6Crash && a) { // a will return null when ActiveX is disabled
>  +                               try {
>  +                                       d = a.GetVariable("$version");  // Will crash fp6.0.21/23/29
>  +                                       if (d) {
>  +                                               d = d.split(" ")[1].split(",");
>  +                                               playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
>  +                                       }
>  +                               }
>  +                               catch(e) {}
>  +                       }
>  +               }
>  +               var u = nav.userAgent.toLowerCase(),
>  +                       p = nav.platform.toLowerCase(),
>  +                       webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
>  +                       ie = false,
>  +                       windows = p ? /win/.test(p) : /win/.test(u),
>  +                       mac = p ? /mac/.test(p) : /mac/.test(u);
>  +               /*@cc_on
>  +                       ie = true;
>  +                       @if (@_win32)
>  +                               windows = true;
>  +                       @elif (@_mac)
>  +                               mac = true;
>  +                       @end
>  +               @*/
>  +               return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
>  +       }();
>  +
>  +       /* Cross-browser onDomLoad
>  +               - Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
>  +               - Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
>  +       */
>  +       var onDomLoad = function() {
>  +               if (!ua.w3cdom) {
>  +                       return;
>  +               }
>  +               addDomLoadEvent(main);
>  +               if (ua.ie && ua.win) {
>  +                       try {  // Avoid a possible Operation Aborted error
>  +                               doc.write("<scr" + "ipt id=__ie_ondomload defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid Norton AV to add code that can cause errors
>  +                               var s = getElementById("__ie_ondomload");
>  +                               if (s) {
>  +                                       s.onreadystatechange = function() {
>  +                                               if (this.readyState == "complete") {
>  +                                                       this.parentNode.removeChild(this);
>  +                                                       callDomLoadFunctions();
>  +                                               }
>  +                                       };
>  +                               }
>  +                       }
>  +                       catch(e) {}
>  +               }
>  +               if (ua.webkit && typeof doc.readyState != UNDEF) {
>  +                       timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
>  +               }
>  +               if (typeof doc.addEventListener != UNDEF) {
>  +                       doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
>  +               }
>  +               addLoadEvent(callDomLoadFunctions);
>  +       }();
>  +
>  +       function callDomLoadFunctions() {
>  +               if (isDomLoaded) {
>  +                       return;
>  +               }
>  +               if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
>  +                       var s = createElement("span");
>  +                       try { // Avoid a possible Operation Aborted error
>  +                               var t = doc.getElementsByTagName("body")[0].appendChild(s);
>  +                               t.parentNode.removeChild(t);
>  +                       }
>  +                       catch (e) {
>  +                               return;
>  +                       }
>  +               }
>  +               isDomLoaded = true;
>  +               if (timer) {
>  +                       clearInterval(timer);
>  +                       timer = null;
>  +               }
>  +               var dl = domLoadFnArr.length;
>  +               for (var i = 0; i < dl; i++) {
>  +                       domLoadFnArr[i]();
>  +               }
>  +       }
>  +
>  +       function addDomLoadEvent(fn) {
>  +               if (isDomLoaded) {
>  +                       fn();
>  +               }
>  +               else {
>  +                       domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
>  +               }
>  +       }
>  +
>  +       /* Cross-browser onload
>  +               - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
>  +               - Will fire an event as soon as a web page including all of its assets are loaded
>  +        */
>  +       function addLoadEvent(fn) {
>  +               if (typeof win.addEventListener != UNDEF) {
>  +                       win.addEventListener("load", fn, false);
>  +               }
>  +               else if (typeof doc.addEventListener != UNDEF) {
>  +                       doc.addEventListener("load", fn, false);
>  +               }
>  +               else if (typeof win.attachEvent != UNDEF) {
>  +                       win.attachEvent("onload", fn);
>  +               }
>  +               else if (typeof win.onload == "function") {
>  +                       var fnOld = win.onload;
>  +                       win.onload = function() {
>  +                               fnOld();
>  +                               fn();
>  +                       };
>  +               }
>  +               else {
>  +                       win.onload = fn;
>  +               }
>  +       }
>  +
>  +       /* Main function
>  +               - Will preferably execute onDomLoad, otherwise onload (as a fallback)
>  +       */
>  +       function main() { // Static publishing only
>  +               var rl = regObjArr.length;
>  +               for (var i = 0; i < rl; i++) { // For each registered object element
>  +                       var id = regObjArr[i].id;
>  +                       if (ua.pv[0] > 0) {
>  +                               var obj = getElementById(id);
>  +                               if (obj) {
>  +                                       regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
>  +                                       regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
>  +                                       if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
>  +                                               if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
>  +                                                       fixParams(obj);
>  +                                               }
>  +                                               setVisibility(id, true);
>  +                                       }
>  +                                       else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
>  +                                               showExpressInstall(regObjArr[i]);
>  +                                       }
>  +                                       else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
>  +                                               displayAltContent(obj);
>  +                                       }
>  +                               }
>  +                       }
>  +                       else {  // If no fp is installed, we let the object element do its job (show alternative content)
>  +                               setVisibility(id, true);
>  +                       }
>  +               }
>  +       }
>  +
>  +       /* Fix nested param elements, which are ignored by older webkit engines
>  +               - This includes Safari up to and including version 1.2.2 on Mac OS 10.3
>  +               - Fall back to the proprietary embed element
>  +       */
>  +       function fixParams(obj) {
>  +               var nestedObj = obj.getElementsByTagName(OBJECT)[0];
>  +               if (nestedObj) {
>  +                       var e = createElement("embed"), a = nestedObj.attributes;
>  +                       if (a) {
>  +                               var al = a.length;
>  +                               for (var i = 0; i < al; i++) {
>  +                                       if (a[i].nodeName.toLowerCase() == "data") {
>  +                                               e.setAttribute("src", a[i].nodeValue);
>  +                                       }
>  +                                       else {
>  +                                               e.setAttribute(a[i].nodeName, a[i].nodeValue);
>  +                                       }
>  +                               }
>  +                       }
>  +                       var c = nestedObj.childNodes;
>  +                       if (c) {
>  +                               var cl = c.length;
>  +                               for (var j = 0; j < cl; j++) {
>  +                                       if (c[j].nodeType == 1 && c[j].nodeName.toLowerCase() == "param") {
>  +                                               e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
>  +                                       }
>  +                               }
>  +                       }
>  +                       obj.parentNode.replaceChild(e, obj);
>  +               }
>  +       }
>  +
>  +       /* Fix hanging audio/video threads and force open sockets and NetConnections to disconnect
>  +               - Occurs when unloading a web page in IE using fp8+ and innerHTML/outerHTML
>  +               - Dynamic publishing only
>  +       */
>  +       function fixObjectLeaks(id) {
>  +               if (ua.ie && ua.win && hasPlayerVersion("8.0.0")) {
>  +                       win.attachEvent("onunload", function () {
>  +                               var obj = getElementById(id);
>  +                               if (obj) {
>  +                                       for (var i in obj) {
>  +                                               if (typeof obj[i] == "function") {
>  +                                                       obj[i] = function() {};
>  +                                               }
>  +                                       }
>  +                                       obj.parentNode.removeChild(obj);
>  +                               }
>  +                       });
>  +               }
>  +       }
>  +
>  +       /* Show the Adobe Express Install dialog
>  +               - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
>  +       */
>  +       function showExpressInstall(regObj) {
>  +               isExpressInstallActive = true;
>  +               var obj = getElementById(regObj.id);
>  +               if (obj) {
>  +                       if (regObj.altContentId) {
>  +                               var ac = getElementById(regObj.altContentId);
>  +                               if (ac) {
>  +                                       storedAltContent = ac;
>  +                                       storedAltContentId = regObj.altContentId;
>  +                               }
>  +                       }
>  +                       else {
>  +                               storedAltContent = abstractAltContent(obj);
>  +                       }
>  +                       if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
>  +                               regObj.width = "310";
>  +                       }
>  +                       if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
>  +                               regObj.height = "137";
>  +                       }
>  +                       doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
>  +                       var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
>  +                               dt = doc.title,
>  +                               fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
>  +                               replaceId = regObj.id;
>  +                       // For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
>  +                       // In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
>  +                       if (ua.ie && ua.win && obj.readyState != 4) {
>  +                               var newObj = createElement("div");
>  +                               replaceId += "SWFObjectNew";
>  +                               newObj.setAttribute("id", replaceId);
>  +                               obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
>  +                               obj.style.display = "none";
>  +                               win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
>  +                       }
>  +                       createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
>  +               }
>  +       }
>  +
>  +       /* Functions to abstract and display alternative content
>  +       */
>  +       function displayAltContent(obj) {
>  +               if (ua.ie && ua.win && obj.readyState != 4) {
>  +                       // For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
>  +                       // In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
>  +                       var el = createElement("div");
>  +                       obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
>  +                       el.parentNode.replaceChild(abstractAltContent(obj), el);
>  +                       obj.style.display = "none";
>  +                       win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
>  +               }
>  +               else {
>  +                       obj.parentNode.replaceChild(abstractAltContent(obj), obj);
>  +               }
>  +       }
>  +
>  +       function abstractAltContent(obj) {
>  +               var ac = createElement("div");
>  +               if (ua.win && ua.ie) {
>  +                       ac.innerHTML = obj.innerHTML;
>  +               }
>  +               else {
>  +                       var nestedObj = obj.getElementsByTagName(OBJECT)[0];
>  +                       if (nestedObj) {
>  +                               var c = nestedObj.childNodes;
>  +                               if (c) {
>  +                                       var cl = c.length;
>  +                                       for (var i = 0; i < cl; i++) {
>  +                                               if (!(c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param") && !(c[i].nodeType == 8)) {
>  +                                                       ac.appendChild(c[i].cloneNode(true));
>  +                                               }
>  +                                       }
>  +                               }
>  +                       }
>  +               }
>  +               return ac;
>  +       }
>  +
>  +       /* Cross-browser dynamic SWF creation
>  +       */
>  +       function createSWF(attObj, parObj, id) {
>  +               var r, el = getElementById(id);
>  +               if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
>  +                       attObj.id = id;
>  +               }
>  +               if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
>  +                       var att = "";
>  +                       for (var i in attObj) {
>  +                               if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
>  +                                       if (i == "data") {
>  +                                               parObj.movie = attObj[i];
>  +                                       }
>  +                                       else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
>  +                                               att += ' class="' + attObj[i] + '"';
>  +                                       }
>  +                                       else if (i != "classid") {
>  +                                               att += ' ' + i + '="' + attObj[i] + '"';
>  +                                       }
>  +                               }
>  +                       }
>  +                       var par = "";
>  +                       for (var j in parObj) {
>  +                               if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
>  +                                       par += '<param name="' + j + '" value="' + parObj[j] + '" />';
>  +                               }
>  +                       }
>  +                       el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
>  +                       fixObjectLeaks(attObj.id); // This bug affects dynamic publishing only
>  +                       r = getElementById(attObj.id);
>  +               }
>  +               else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
>  +                       var e = createElement("embed");
>  +                       e.setAttribute("type", FLASH_MIME_TYPE);
>  +                       for (var k in attObj) {
>  +                               if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
>  +                                       if (k == "data") {
>  +                                               e.setAttribute("src", attObj[k]);
>  +                                       }
>  +                                       else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
>  +                                               e.setAttribute("class", attObj[k]);
>  +                                       }
>  +                                       else if (k != "classid") { // Filter out IE specific attribute
>  +                                               e.setAttribute(k, attObj[k]);
>  +                                       }
>  +                               }
>  +                       }
>  +                       for (var l in parObj) {
>  +                               if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
>  +                                       if (l != "movie") { // Filter out IE specific param element
>  +                                               e.setAttribute(l, parObj[l]);
>  +                                       }
>  +                               }
>  +                       }
>  +                       el.parentNode.replaceChild(e, el);
>  +                       r = e;
>  +               }
>  +               else { // Well-behaving browsers
>  +                       var o = createElement(OBJECT);
>  +                       o.setAttribute("type", FLASH_MIME_TYPE);
>  +                       for (var m in attObj) {
>  +                               if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
>  +                                       if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
>  +                                               o.setAttribute("class", attObj[m]);
>  +                                       }
>  +                                       else if (m != "classid") { // Filter out IE specific attribute
>  +                                               o.setAttribute(m, attObj[m]);
>  +                                       }
>  +                               }
>  +                       }
>  +                       for (var n in parObj) {
>  +                               if (parObj[n] != Object.prototype[n] && n != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
>  +                                       createObjParam(o, n, parObj[n]);
>  +                               }
>  +                       }
>  +                       el.parentNode.replaceChild(o, el);
>  +                       r = o;
>  +               }
>  +               return r;
>  +       }
>  +
>  +       function createObjParam(el, pName, pValue) {
>  +               var p = createElement("param");
>  +               p.setAttribute("name", pName);
>  +               p.setAttribute("value", pValue);
>  +               el.appendChild(p);
>  +       }
>  +
>  +       function getElementById(id) {
>  +               return doc.getElementById(id);
>  +       }
>  +
>  +       function createElement(el) {
>  +               return doc.createElement(el);
>  +       }
>  +
>  +       function hasPlayerVersion(rv) {
>  +               var pv = ua.pv, v = rv.split(".");
>  +               v[0] = parseInt(v[0], 10);
>  +               v[1] = parseInt(v[1], 10);
>  +               v[2] = parseInt(v[2], 10);
>  +               return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
>  +       }
>  +
>  +       /* Cross-browser dynamic CSS creation
>  +               - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
>  +       */
>  +       function createCSS(sel, decl) {
>  +               if (ua.ie && ua.mac) {
>  +                       return;
>  +               }
>  +               var h = doc.getElementsByTagName("head")[0], s = createElement("style");
>  +               s.setAttribute("type", "text/css");
>  +               s.setAttribute("media", "screen");
>  +               if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
>  +                       s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
>  +               }
>  +               h.appendChild(s);
>  +               if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
>  +                       var ls = doc.styleSheets[doc.styleSheets.length - 1];
>  +                       if (typeof ls.addRule == OBJECT) {
>  +                               ls.addRule(sel, decl);
>  +                       }
>  +               }
>  +       }
>  +
>  +       function setVisibility(id, isVisible) {
>  +               var v = isVisible ? "visible" : "hidden";
>  +               if (isDomLoaded) {
>  +                       getElementById(id).style.visibility = v;
>  +               }
>  +               else {
>  +                       createCSS("#" + id, "visibility:" + v);
>  +               }
>  +       }
>  +
>  +       return {
>  +               /* Public API
>  +                       - Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
>  +               */
>  +               registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
>  +                       if (!ua.w3cdom || !objectIdStr || !swfVersionStr) {
>  +                               return;
>  +                       }
>  +                       var regObj = {};
>  +                       regObj.id = objectIdStr;
>  +                       regObj.swfVersion = swfVersionStr;
>  +                       regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : false;
>  +                       regObjArr[regObjArr.length] = regObj;
>  +                       setVisibility(objectIdStr, false);
>  +               },
>  +
>  +               getObjectById: function(objectIdStr) {
>  +                       var r = null;
>  +                       if (ua.w3cdom && isDomLoaded) {
>  +                               var o = getElementById(objectIdStr);
>  +                               if (o) {
>  +                                       var n = o.getElementsByTagName(OBJECT)[0];
>  +                                       if (!n || (n && typeof o.SetVariable != UNDEF)) {
>  +                                       r = o;
>  +                                       }
>  +                                       else if (typeof n.SetVariable != UNDEF) {
>  +                                               r = n;
>  +                                       }
>  +                               }
>  +                       }
>  +                       return r;
>  +               },
>  +
>  +               embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
>  +                       if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
>  +                               return;
>  +                       }
>  +                       widthStr += ""; // Auto-convert to string to make it idiot proof
>  +                       heightStr += "";
>  +                       if (hasPlayerVersion(swfVersionStr)) {
>  +                               setVisibility(replaceElemIdStr, false);
>  +                               var att = (typeof attObj == OBJECT) ? attObj : {};
>  +                               att.data = swfUrlStr;
>  +                               att.width = widthStr;
>  +                               att.height = heightStr;
>  +                               var par = (typeof parObj == OBJECT) ? parObj : {};
>  +                               if (typeof flashvarsObj == OBJECT) {
>  +                                       for (var i in flashvarsObj) {
>  +                                               if (flashvarsObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
>  +                                                       if (typeof par.flashvars != UNDEF) {
>  +                                                               par.flashvars += "&" + i + "=" + flashvarsObj[i];
>  +                                                       }
>  +                                                       else {
>  +                                                               par.flashvars = i + "=" + flashvarsObj[i];
>  +                                                       }
>  +                                               }
>  +                                       }
>  +                               }
>  +                               addDomLoadEvent(function() {
>  +                                       createSWF(att, par, replaceElemIdStr);
>  +                                       if (att.id == replaceElemIdStr) {
>  +                                               setVisibility(replaceElemIdStr, true);
>  +                                       }
>  +                               });
>  +                       }
>  +                       else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
>  +                               setVisibility(replaceElemIdStr, false);
>  +                               addDomLoadEvent(function() {
>  +                                       var regObj = {};
>  +                                       regObj.id = regObj.altContentId = replaceElemIdStr;
>  +                                       regObj.width = widthStr;
>  +                                       regObj.height = heightStr;
>  +                                       regObj.expressInstall = xiSwfUrlStr;
>  +                                       showExpressInstall(regObj);
>  +                               });
>  +                       }
>  +               },
>  +
>  +               getFlashPlayerVersion: function() {
>  +                       return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
>  +               },
>  +
>  +               hasFlashPlayerVersion:hasPlayerVersion,
>  +
>  +               createSWF: function(attObj, parObj, replaceElemIdStr) {
>  +                       if (ua.w3cdom && isDomLoaded) {
>  +                               return createSWF(attObj, parObj, replaceElemIdStr);
>  +                       }
>  +                       else {
>  +                               return undefined;
>  +                       }
>  +               },
>  +
>  +               createCSS: function(sel, decl) {
>  +                       if (ua.w3cdom) {
>  +                               createCSS(sel, decl);
>  +                       }
>  +               },
>  +
>  +               addDomLoadEvent:addDomLoadEvent,
>  +
>  +               addLoadEvent:addLoadEvent,
>  +
>  +               getQueryParamValue: function(param) {
>  +                       var q = doc.location.search || doc.location.hash;
>  +                       if (param == null) {
>  +                               return q;
>  +                       }
>  +                       if(q) {
>  +                               var pairs = q.substring(1).split("&");
>  +                               for (var i = 0; i < pairs.length; i++) {
>  +                                       if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
>  +                                               return pairs[i].substring((pairs[i].indexOf("=") + 1));
>  +                                       }
>  +                               }
>  +                       }
>  +                       return "";
>  +               },
>  +
>  +               // For internal usage only
>  +               expressInstallCallback: function() {
>  +                       if (isExpressInstallActive && storedAltContent) {
>  +                               var obj = getElementById(EXPRESS_INSTALL_ID);
>  +                               if (obj) {
>  +                                       obj.parentNode.replaceChild(storedAltContent, obj);
>  +                                       if (storedAltContentId) {
>  +                                               setVisibility(storedAltContentId, true);
>  +                                               if (ua.ie && ua.win) {
>  +                                                       storedAltContent.style.display = "block";
>  +                                               }
>  +                                       }
>  +                                       storedAltContent = null;
>  +                                       storedAltContentId = null;
>  +                                       isExpressInstallActive = false;
>  +                               }
>  +                       }
>  +               }
>  +
>  +       };
>  +
>  +}();
>
>
>  Property changes on: examples/trunk/google_appengine/static/swfobject/src/swfobject.js
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>
>  Added: examples/trunk/google_appengine/static/swfobject/swfobject.js
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/swfobject.js                               (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/swfobject.js       2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,5 @@
>  +/*     SWFObject v2.0 <http://code.google.com/p/swfobject/>
>  +       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
>  +       This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
>  +*/
>  +var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k
 ){}
>   }}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return }J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return }if(
 a.i
>   e&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return }}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=Z){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=Z){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=Z){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getEl
 eme
>   ntsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX"
 :"P
>   lugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id
 ==Z
>   ){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass
 "){
>   s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return }var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){
 i.a
>   ddRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return }var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return }r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstal
 l=m

>   ;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/static/swfobject/test.swf
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on: examples/trunk/google_appengine/static/swfobject/test.swf
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/templates/base.html
>  ===================================================================
>  --- examples/trunk/google_appengine/templates/base.html                         (rev 0)
>  +++ examples/trunk/google_appengine/templates/base.html 2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,13 @@
>  +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>  +       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>  +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>  +<head>
>  +       <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
>  +       <title>{% block title %}{% endblock %}</title>
>  +       {% block head %}{% endblock %}
>  +</head>
>  +<body>
>  +       {% block body %}
>  +       {% endblock %}
>  +</body>
>  +</html>
>
>  Added: examples/trunk/google_appengine/templates/swf.html
>  ===================================================================
>  --- examples/trunk/google_appengine/templates/swf.html                          (rev 0)
>  +++ examples/trunk/google_appengine/templates/swf.html  2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,16 @@
>  +{% extends "base.html" %}
>  +
>  +{% block title %}PyAMF Echo Test Demo{% endblock %}
>  +
>  +{% block head %}
>  +<script type="text/javascript" src="/static/swfobject/swfobject.js"></script>
>  +<script type="text/javascript">
>  +    swfobject.embedSWF("{{ swf_url }}", "swf", "{{ width }}", "{{ height }}", "{{ flash_ver }}");
>  +</script>
>  +{% endblock %}
>  +
>  +{% block body %}
>  +<div id="swf">
>  +
>  +</div>
>  +{% endblock %}
>  \ No newline at end of file
>
>  _______________________________________________
>  PyAMF commits mailing list - [hidden email]
>  http://lists.pyamf.org/mailman/listinfo/commits
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pyamf-commits] r1155 - in examples/trunk: . google_appengine google_appengine/echo google_appengine/static google_appengine/static/swfobject google_appengine/static/swfobject/src google_appengine/templates

Nick Joyce
Hey Arnar,

How's it going? Hope you are still enjoying the course ..

Been on irc much? We moved server! <a href="irc://irc.collab.eu/collab">irc://irc.collab.eu/collab

Thanks for the tip, committed in r1156.

Cheers,

Nick

On 10 Apr 2008, at 15:30, Arnar Birgisson wrote:
Hey Nick,

I think there's no need for the overhead of a script for
crossdomain.xml. Just use "static_files" in the app.yaml:

- url: /crossdomain.xml
 static_files: crossdomain.xml

Arnar

On Thu, Apr 10, 2008 at 2:25 PM, SVN commit logs for PyAMF
<[hidden email]> wrote:
Author: nick
Date: 2008-04-10 16:25:48 +0200 (Thu, 10 Apr 2008)
New Revision: 1155

Added:
  examples/trunk/google_appengine/
  examples/trunk/google_appengine/app.yaml
  examples/trunk/google_appengine/crossdomain.py
  examples/trunk/google_appengine/echo/
  examples/trunk/google_appengine/echo/__init__.py
  examples/trunk/google_appengine/echo/__init__.pyc
  examples/trunk/google_appengine/echo/gateway.py
  examples/trunk/google_appengine/echo/index.py
  examples/trunk/google_appengine/index.html
  examples/trunk/google_appengine/index.py
  examples/trunk/google_appengine/static/
  examples/trunk/google_appengine/static/echo_test.swf
  examples/trunk/google_appengine/static/swfobject/
  examples/trunk/google_appengine/static/swfobject/expressInstall.swf
  examples/trunk/google_appengine/static/swfobject/index.html
  examples/trunk/google_appengine/static/swfobject/index_dynamic.html
  examples/trunk/google_appengine/static/swfobject/src/
  examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
  examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
  examples/trunk/google_appengine/static/swfobject/src/swfobject.js
  examples/trunk/google_appengine/static/swfobject/swfobject.js
  examples/trunk/google_appengine/static/swfobject/test.swf
  examples/trunk/google_appengine/templates/
  examples/trunk/google_appengine/templates/base.html
  examples/trunk/google_appengine/templates/swf.html
Log:
Adding working EchoTest Google AppEngine example


Property changes on: examples/trunk/google_appengine
___________________________________________________________________
Name: svn:ignore
  + *.pyc
pyamf


Added: examples/trunk/google_appengine/app.yaml
===================================================================
--- examples/trunk/google_appengine/app.yaml                            (rev 0)
+++ examples/trunk/google_appengine/app.yaml    2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,22 @@
+application: pyamf
+version: 1
+runtime: python
+api_version: 1
+
+handlers:
+- url: /
+  script: index.py
+
+- url: /crossdomain.xml
+  script: crossdomain.py
+
+# Echo demo urls
+
+- url: /echo
+  script: echo/index.py
+
+- url: /gateway/echo
+  script: echo/gateway.py
+
+- url: /static
+  static_dir: static
\ No newline at end of file

Added: examples/trunk/google_appengine/crossdomain.py
===================================================================
--- examples/trunk/google_appengine/crossdomain.py                              (rev 0)
+++ examples/trunk/google_appengine/crossdomain.py      2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,7 @@
+print 'Content-Type: application/xml'
+print
+print """<?xml version="1.0"?>
+<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
+<cross-domain-policy>
+   <allow-access-from domain="*" />
+</cross-domain-policy>"""
\ No newline at end of file

Added: examples/trunk/google_appengine/echo/__init__.py
===================================================================
--- examples/trunk/google_appengine/echo/__init__.py                            (rev 0)
+++ examples/trunk/google_appengine/echo/__init__.py    2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,111 @@
+# -*- encoding: utf-8 -*-
+#
+# Copyright (c) 2007-2008 The PyAMF Project.
+# See LICENSE for details.
+
+"""
+Echo test core functionality. This module sets up the class
+mappings related to the echo_test.swf client on the
+U{EchoTest<http://pyamf.org/wiki/EchoTest>} wiki page.
+
+@author: U{Nick Joyce<[hidden email]>}
+@since: 0.1.0
+"""
+
+from pyamf import register_class
+
+ECHO_NS = 'org.red5.server.webapp.echo'
+
+class RemoteClass(object):
+    """
+    This Python class is mapped to the clientside ActionScript class.
+    """
+    pass
+
+class ExternalizableClass(object):
+    """
+    An example of an externalizable class.
+    """
+    def __readamf__(self, input):
+        """
+        This function is invoked when the C{obj} needs to be deserialized.
+
+        @type obj: L{ExternalizableClass}
+        @param obj: The object in question.
+        @param input: The input stream to read from.
+        @type input L{DataInput<pyamf.amf3.DataInput>}
+        """
+        assert input.readBoolean() == True
+        assert input.readBoolean() == False
+        assert input.readByte() == 0
+        assert input.readByte() == -1
+        assert input.readByte() == 1
+        assert input.readByte() == 127
+        assert input.readByte() == -127
+        assert input.readDouble() == 1.0
+        assert input.readFloat() == 2.0
+        assert input.readInt() == 0
+        assert input.readInt() == -1
+        assert input.readInt() == 1
+        input.readMultiByte(7, 'iso-8859-1')
+        input.readMultiByte(14, 'utf8')
+        assert input.readObject() == [1, 'one', 1.0]
+        assert input.readShort() == 0
+        assert input.readShort() == -1
+        assert input.readShort() == 1
+        assert input.readUnsignedInt() == 0
+        assert input.readUnsignedInt() == 1
+        assert input.readUTF() == "Hello world!"
+        assert input.readUTFBytes(12) == "Hello world!"
+
+    def __writeamf__(self, output):
+        """
+        This function is invoked when the C{obj} needs to be serialized.
+
+        @type obj: L{ExternalizableClass}
+        @param obj: The object in question.
+        @param input: The output stream to write to.
+        @type input L{DataOutput<pyamf.amf3.DataOutput>}
+        """
+        output.writeBoolean(True)
+        output.writeBoolean(False)
+        output.writeByte(0)
+        output.writeByte(-1)
+        output.writeByte(1)
+        output.writeByte(127)
+        output.writeByte(-127)
+        output.writeDouble(1.0)
+        output.writeFloat(2.0)
+        output.writeInt(0)
+        output.writeInt(-1)
+        output.writeInt(1)
+        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf", 'iso-8859-1')
+        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf", 'utf8')
+        output.writeObject([1, 'one', 1])
+        output.writeShort(0)
+        output.writeShort(-1)
+        output.writeShort(1)
+        output.writeUnsignedInt(0)
+        output.writeUnsignedInt(1)
+        output.writeUTF("Hello world!")
+        output.writeUTFBytes("Hello world!")
+
+def echo(data):
+    """
+    Return data back to the client.
+
+    @type data: C{mixed}
+    @param data: Decoded AS->Python data.
+    """
+    return data
+
+# Map ActionScript class to Python class
+try:
+    register_class(RemoteClass, '%s.%s' % (ECHO_NS, 'RemoteClass'))
+except ValueError:
+    pass
+try:
+    register_class(ExternalizableClass, '%s.%s' % (ECHO_NS,
+        'ExternalizableClass'), metadata=['external'])
+except ValueError:
+    pass

Added: examples/trunk/google_appengine/echo/__init__.pyc
===================================================================
(Binary files differ)


Property changes on: examples/trunk/google_appengine/echo/__init__.pyc
___________________________________________________________________
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/echo/gateway.py
===================================================================
--- examples/trunk/google_appengine/echo/gateway.py                             (rev 0)
+++ examples/trunk/google_appengine/echo/gateway.py     2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,17 @@
+from pyamf.remoting.gateway.wsgi import WSGIGateway
+from google.appengine.ext.webapp import util
+
+from echo import echo
+
+services = {
+    'echo': echo,
+    'echo.echo': echo
+}
+
+def main():
+    gateway = WSGIGateway(services)
+
+    util.run_wsgi_app(gateway)
+
+if __name__ == "__main__":
+    main()
\ No newline at end of file

Added: examples/trunk/google_appengine/echo/index.py
===================================================================
--- examples/trunk/google_appengine/echo/index.py                               (rev 0)
+++ examples/trunk/google_appengine/echo/index.py       2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,10 @@
+from google.appengine.ext.webapp import template
+
+print "Content-Type: text/html"
+print
+print template.render('../templates/swf.html', {
+    'swf_url': '/static/echo_test.swf',
+    'width': '100%',
+    'height': '100%',
+    'flash_ver': '9.0.0'
+})
\ No newline at end of file

Added: examples/trunk/google_appengine/index.html
===================================================================
--- examples/trunk/google_appengine/index.html                          (rev 0)
+++ examples/trunk/google_appengine/index.html  2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,11 @@
+{% extends "templates/base.html" %}
+
+{% block title %}PyAMF/Google App Engine Demo Application{% endblock %}
+
+{% block body %}
+<h1><a href="http://pyamf.org">PyAMF</a>/<a href="">Google App Engine</a> Demo Application</h1>
+<h2>Available demos:</h2>
+<ul>
+       <li><a href="/echo">EchoTest</a> - Tests all parts of the AMF specification, including AMF0, AMF3 and RemoteObject</li>
+</ul>
+{% endblock %}
\ No newline at end of file

Added: examples/trunk/google_appengine/index.py
===================================================================
--- examples/trunk/google_appengine/index.py                            (rev 0)
+++ examples/trunk/google_appengine/index.py    2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,5 @@
+from google.appengine.ext.webapp import template
+
+print "Content-Type: text/html"
+print
+print template.render('index.html', {})
\ No newline at end of file

Added: examples/trunk/google_appengine/static/echo_test.swf
===================================================================
(Binary files differ)


Property changes on: examples/trunk/google_appengine/static/echo_test.swf
___________________________________________________________________
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/static/swfobject/expressInstall.swf
===================================================================
(Binary files differ)


Property changes on: examples/trunk/google_appengine/static/swfobject/expressInstall.swf
___________________________________________________________________
Name: svn:executable
  + *
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/static/swfobject/index.html
===================================================================
--- examples/trunk/google_appengine/static/swfobject/index.html                         (rev 0)
+++ examples/trunk/google_appengine/static/swfobject/index.html 2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+       <head>
+               <title>SWFObject v2.0 sample page</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+               <script type="text/javascript" src="swfobject.js"></script>
+               <script type="text/javascript">
+               swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
+               </script>
+       </head>
+       <body>
+               <div>
+                       <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="120">
+                               <param name="movie" value="test.swf" />
+                       <!--[if !IE]>-->
+                               <object type="application/x-shockwave-flash" data="test.swf" width="300" height="120">
+                               <!--<![endif]-->
+                               <div>
+                                       <h1>Alternative content</h1>
+                                       <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
+                               </div>
+                               <!--[if !IE]>-->
+                               </object>
+                               <!--<![endif]-->
+                       </object>
+               </div>
+       </body>
+</html>


Property changes on: examples/trunk/google_appengine/static/swfobject/index.html
___________________________________________________________________
Name: svn:executable
  + *

Added: examples/trunk/google_appengine/static/swfobject/index_dynamic.html
===================================================================
--- examples/trunk/google_appengine/static/swfobject/index_dynamic.html                         (rev 0)
+++ examples/trunk/google_appengine/static/swfobject/index_dynamic.html 2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+       <head>
+               <title>SWFObject v2.0 dynamic embed sample page</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+               <script type="text/javascript" src="swfobject.js"></script>
+               <script type="text/javascript">
+               swfobject.embedSWF("test.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf");
+               </script>
+       </head>
+       <body>
+               <div id="myContent">
+                       <h1>Alternative content</h1>
+                       <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
+               </div>
+       </body>
+</html>


Property changes on: examples/trunk/google_appengine/static/swfobject/index_dynamic.html
___________________________________________________________________
Name: svn:executable
  + *

Added: examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
===================================================================
--- examples/trunk/google_appengine/static/swfobject/src/expressInstall.as                              (rev 0)
+++ examples/trunk/google_appengine/static/swfobject/src/expressInstall.as      2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,76 @@
+/*     =============================
+       SWFObject v2.0 <http://code.google.com/p/swfobject/>
+       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
+       This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+       =============================
+       Express Install
+       Copyright (c) 2005-2007 Adobe Systems Incorporated and its licensors. All Rights Reserved.
+       =============================
+       AS1 version
+       =============================
+*/
+
+System.security.allowDomain("fpdownload.macromedia.com");
+
+var cacheBuster        = Math.random();
+var updateSWF  = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+cacheBuster;
+var bytes              = loaderClip.getBytesTotal();
+loaderClip.loadMovie(updateSWF);
+
+var time               = 0;
+var timeOut            = 5;    // expressed in seconds
+var delay              = 10;   // expressed in milliseconds
+var id                 = setInterval(checkLoaded, delay);
+
+function checkLoaded(){
+       if(loaderClip.startUpdate.toString() == "[type Function]"){
+               // updater has loaded successfully
+               clearInterval(id);
+               loadComplete();
+               return;
+       }
+       else if(time > timeOut){
+               // updater did not load in time, abort load and force alternative content
+               clearInterval(id);
+               loaderClip.unloadMovie();
+               loadTimeOut();
+               return;
+       }
+       time += delay/1000;
+}
+
+function loadComplete(){
+       loaderClip.redirectURL  = _root.MMredirectURL;
+       loaderClip.MMplayerType = _root.MMplayerType;
+       loaderClip.MMdoctitle   = _root.MMdoctitle;
+       loaderClip.startUpdate();
+}
+
+function loadTimeOut(){
+       callbackSWFObject();
+}
+
+function installStatus(statusValue){
+       switch(statusValue){
+               case "Download.Complete":
+                       // Installation is complete.
+                       // In most cases the browser window that this SWF is hosted in will be closed by the installer or
+                       // otherwise it has to be closed manually by the end user.
+                       // The Adobe Flash installer will reopen the browser window and reload the page containing the SWF.
+               break;
+               case "Download.Cancelled":
+                       // The end user chose "NO" when prompted to install the new player.
+                       // By default the SWFObject callback function is called to force alternative content.
+                       callbackSWFObject();
+               break;
+               case "Download.Failed":
+                       // The end user failed to download the installer due to a network failure.
+                       // By default the SWFObject callback function is called to force alternative content.
+                       callbackSWFObject();
+               break;
+       }
+}
+
+function callbackSWFObject(){
+       getURL("javascript:swfobject.expressInstallCallback();");
+}
\ No newline at end of file


Property changes on: examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
___________________________________________________________________
Name: svn:executable
  + *

Added: examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
===================================================================
(Binary files differ)


Property changes on: examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
___________________________________________________________________
Name: svn:executable
  + *
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/static/swfobject/src/swfobject.js
===================================================================
--- examples/trunk/google_appengine/static/swfobject/src/swfobject.js                           (rev 0)
+++ examples/trunk/google_appengine/static/swfobject/src/swfobject.js   2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,631 @@
+/*!    SWFObject v2.0 <http://code.google.com/p/swfobject/>
+       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
+       This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+
+var swfobject = function() {
+
+       var UNDEF = "undefined",
+               OBJECT = "object",
+               SHOCKWAVE_FLASH = "Shockwave Flash",
+               SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+               FLASH_MIME_TYPE = "application/x-shockwave-flash",
+               EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+
+               win = window,
+               doc = document,
+               nav = navigator,
+
+               domLoadFnArr = [],
+               regObjArr = [],
+               timer = null,
+               storedAltContent = null,
+               storedAltContentId = null,
+               isDomLoaded = false,
+               isExpressInstallActive = false;
+
+       /* Centralized function for browser feature detection
+               - Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
+               - User agent string detection is only used when no alternative is possible
+               - Is executed directly for optimal performance
+       */
+       var ua = function() {
+               var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
+                       playerVersion = [0,0,0],
+                       d = null;
+               if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+                       d = nav.plugins[SHOCKWAVE_FLASH].description;
+                       if (d) {
+                               d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+                               playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+                               playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+                               playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
+                       }
+               }
+               else if (typeof win.ActiveXObject != UNDEF) {
+                       var a = null, fp6Crash = false;
+                       try {
+                               a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
+                       }
+                       catch(e) {
+                               try {
+                                       a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
+                                       playerVersion = [6,0,21];
+                                       a.AllowScriptAccess = "always";  // Introduced in fp6.0.47
+                               }
+                               catch(e) {
+                                       if (playerVersion[0] == 6) {
+                                               fp6Crash = true;
+                                       }
+                               }
+                               if (!fp6Crash) {
+                                       try {
+                                               a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+                                       }
+                                       catch(e) {}
+                               }
+                       }
+                       if (!fp6Crash && a) { // a will return null when ActiveX is disabled
+                               try {
+                                       d = a.GetVariable("$version");  // Will crash fp6.0.21/23/29
+                                       if (d) {
+                                               d = d.split(" ")[1].split(",");
+                                               playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+                                       }
+                               }
+                               catch(e) {}
+                       }
+               }
+               var u = nav.userAgent.toLowerCase(),
+                       p = nav.platform.toLowerCase(),
+                       webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+                       ie = false,
+                       windows = p ? /win/.test(p) : /win/.test(u),
+                       mac = p ? /mac/.test(p) : /mac/.test(u);
+               /*@cc_on
+                       ie = true;
+                       @if (@_win32)
+                               windows = true;
+                       @elif (@_mac)
+                               mac = true;
+                       @end
+               @*/
+               return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
+       }();
+
+       /* Cross-browser onDomLoad
+               - Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
+               - Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
+       */
+       var onDomLoad = function() {
+               if (!ua.w3cdom) {
+                       return;
+               }
+               addDomLoadEvent(main);
+               if (ua.ie && ua.win) {
+                       try {  // Avoid a possible Operation Aborted error
+                               doc.write("<scr" + "ipt id=__ie_ondomload defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid Norton AV to add code that can cause errors
+                               var s = getElementById("__ie_ondomload");
+                               if (s) {
+                                       s.onreadystatechange = function() {
+                                               if (this.readyState == "complete") {
+                                                       this.parentNode.removeChild(this);
+                                                       callDomLoadFunctions();
+                                               }
+                                       };
+                               }
+                       }
+                       catch(e) {}
+               }
+               if (ua.webkit && typeof doc.readyState != UNDEF) {
+                       timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
+               }
+               if (typeof doc.addEventListener != UNDEF) {
+                       doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
+               }
+               addLoadEvent(callDomLoadFunctions);
+       }();
+
+       function callDomLoadFunctions() {
+               if (isDomLoaded) {
+                       return;
+               }
+               if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
+                       var s = createElement("span");
+                       try { // Avoid a possible Operation Aborted error
+                               var t = doc.getElementsByTagName("body")[0].appendChild(s);
+                               t.parentNode.removeChild(t);
+                       }
+                       catch (e) {
+                               return;
+                       }
+               }
+               isDomLoaded = true;
+               if (timer) {
+                       clearInterval(timer);
+                       timer = null;
+               }
+               var dl = domLoadFnArr.length;
+               for (var i = 0; i < dl; i++) {
+                       domLoadFnArr[i]();
+               }
+       }
+
+       function addDomLoadEvent(fn) {
+               if (isDomLoaded) {
+                       fn();
+               }
+               else {
+                       domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+               }
+       }
+
+       /* Cross-browser onload
+               - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+               - Will fire an event as soon as a web page including all of its assets are loaded
+        */
+       function addLoadEvent(fn) {
+               if (typeof win.addEventListener != UNDEF) {
+                       win.addEventListener("load", fn, false);
+               }
+               else if (typeof doc.addEventListener != UNDEF) {
+                       doc.addEventListener("load", fn, false);
+               }
+               else if (typeof win.attachEvent != UNDEF) {
+                       win.attachEvent("onload", fn);
+               }
+               else if (typeof win.onload == "function") {
+                       var fnOld = win.onload;
+                       win.onload = function() {
+                               fnOld();
+                               fn();
+                       };
+               }
+               else {
+                       win.onload = fn;
+               }
+       }
+
+       /* Main function
+               - Will preferably execute onDomLoad, otherwise onload (as a fallback)
+       */
+       function main() { // Static publishing only
+               var rl = regObjArr.length;
+               for (var i = 0; i < rl; i++) { // For each registered object element
+                       var id = regObjArr[i].id;
+                       if (ua.pv[0] > 0) {
+                               var obj = getElementById(id);
+                               if (obj) {
+                                       regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
+                                       regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
+                                       if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
+                                               if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
+                                                       fixParams(obj);
+                                               }
+                                               setVisibility(id, true);
+                                       }
+                                       else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
+                                               showExpressInstall(regObjArr[i]);
+                                       }
+                                       else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
+                                               displayAltContent(obj);
+                                       }
+                               }
+                       }
+                       else {  // If no fp is installed, we let the object element do its job (show alternative content)
+                               setVisibility(id, true);
+                       }
+               }
+       }
+
+       /* Fix nested param elements, which are ignored by older webkit engines
+               - This includes Safari up to and including version 1.2.2 on Mac OS 10.3
+               - Fall back to the proprietary embed element
+       */
+       function fixParams(obj) {
+               var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+               if (nestedObj) {
+                       var e = createElement("embed"), a = nestedObj.attributes;
+                       if (a) {
+                               var al = a.length;
+                               for (var i = 0; i < al; i++) {
+                                       if (a[i].nodeName.toLowerCase() == "data") {
+                                               e.setAttribute("src", a[i].nodeValue);
+                                       }
+                                       else {
+                                               e.setAttribute(a[i].nodeName, a[i].nodeValue);
+                                       }
+                               }
+                       }
+                       var c = nestedObj.childNodes;
+                       if (c) {
+                               var cl = c.length;
+                               for (var j = 0; j < cl; j++) {
+                                       if (c[j].nodeType == 1 && c[j].nodeName.toLowerCase() == "param") {
+                                               e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
+                                       }
+                               }
+                       }
+                       obj.parentNode.replaceChild(e, obj);
+               }
+       }
+
+       /* Fix hanging audio/video threads and force open sockets and NetConnections to disconnect
+               - Occurs when unloading a web page in IE using fp8+ and innerHTML/outerHTML
+               - Dynamic publishing only
+       */
+       function fixObjectLeaks(id) {
+               if (ua.ie && ua.win && hasPlayerVersion("8.0.0")) {
+                       win.attachEvent("onunload", function () {
+                               var obj = getElementById(id);
+                               if (obj) {
+                                       for (var i in obj) {
+                                               if (typeof obj[i] == "function") {
+                                                       obj[i] = function() {};
+                                               }
+                                       }
+                                       obj.parentNode.removeChild(obj);
+                               }
+                       });
+               }
+       }
+
+       /* Show the Adobe Express Install dialog
+               - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+       */
+       function showExpressInstall(regObj) {
+               isExpressInstallActive = true;
+               var obj = getElementById(regObj.id);
+               if (obj) {
+                       if (regObj.altContentId) {
+                               var ac = getElementById(regObj.altContentId);
+                               if (ac) {
+                                       storedAltContent = ac;
+                                       storedAltContentId = regObj.altContentId;
+                               }
+                       }
+                       else {
+                               storedAltContent = abstractAltContent(obj);
+                       }
+                       if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
+                               regObj.width = "310";
+                       }
+                       if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
+                               regObj.height = "137";
+                       }
+                       doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+                       var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+                               dt = doc.title,
+                               fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
+                               replaceId = regObj.id;
+                       // For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
+                       // In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+                       if (ua.ie && ua.win && obj.readyState != 4) {
+                               var newObj = createElement("div");
+                               replaceId += "SWFObjectNew";
+                               newObj.setAttribute("id", replaceId);
+                               obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+                               obj.style.display = "none";
+                               win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
+                       }
+                       createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
+               }
+       }
+
+       /* Functions to abstract and display alternative content
+       */
+       function displayAltContent(obj) {
+               if (ua.ie && ua.win && obj.readyState != 4) {
+                       // For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
+                       // In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+                       var el = createElement("div");
+                       obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
+                       el.parentNode.replaceChild(abstractAltContent(obj), el);
+                       obj.style.display = "none";
+                       win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
+               }
+               else {
+                       obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+               }
+       }
+
+       function abstractAltContent(obj) {
+               var ac = createElement("div");
+               if (ua.win && ua.ie) {
+                       ac.innerHTML = obj.innerHTML;
+               }
+               else {
+                       var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+                       if (nestedObj) {
+                               var c = nestedObj.childNodes;
+                               if (c) {
+                                       var cl = c.length;
+                                       for (var i = 0; i < cl; i++) {
+                                               if (!(c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param") && !(c[i].nodeType == 8)) {
+                                                       ac.appendChild(c[i].cloneNode(true));
+                                               }
+                                       }
+                               }
+                       }
+               }
+               return ac;
+       }
+
+       /* Cross-browser dynamic SWF creation
+       */
+       function createSWF(attObj, parObj, id) {
+               var r, el = getElementById(id);
+               if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+                       attObj.id = id;
+               }
+               if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
+                       var att = "";
+                       for (var i in attObj) {
+                               if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
+                                       if (i == "data") {
+                                               parObj.movie = attObj[i];
+                                       }
+                                       else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+                                               att += ' class="' + attObj[i] + '"';
+                                       }
+                                       else if (i != "classid") {
+                                               att += ' ' + i + '="' + attObj[i] + '"';
+                                       }
+                               }
+                       }
+                       var par = "";
+                       for (var j in parObj) {
+                               if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
+                                       par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+                               }
+                       }
+                       el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+                       fixObjectLeaks(attObj.id); // This bug affects dynamic publishing only
+                       r = getElementById(attObj.id);
+               }
+               else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
+                       var e = createElement("embed");
+                       e.setAttribute("type", FLASH_MIME_TYPE);
+                       for (var k in attObj) {
+                               if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
+                                       if (k == "data") {
+                                               e.setAttribute("src", attObj[k]);
+                                       }
+                                       else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+                                               e.setAttribute("class", attObj[k]);
+                                       }
+                                       else if (k != "classid") { // Filter out IE specific attribute
+                                               e.setAttribute(k, attObj[k]);
+                                       }
+                               }
+                       }
+                       for (var l in parObj) {
+                               if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
+                                       if (l != "movie") { // Filter out IE specific param element
+                                               e.setAttribute(l, parObj[l]);
+                                       }
+                               }
+                       }
+                       el.parentNode.replaceChild(e, el);
+                       r = e;
+               }
+               else { // Well-behaving browsers
+                       var o = createElement(OBJECT);
+                       o.setAttribute("type", FLASH_MIME_TYPE);
+                       for (var m in attObj) {
+                               if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
+                                       if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+                                               o.setAttribute("class", attObj[m]);
+                                       }
+                                       else if (m != "classid") { // Filter out IE specific attribute
+                                               o.setAttribute(m, attObj[m]);
+                                       }
+                               }
+                       }
+                       for (var n in parObj) {
+                               if (parObj[n] != Object.prototype[n] && n != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
+                                       createObjParam(o, n, parObj[n]);
+                               }
+                       }
+                       el.parentNode.replaceChild(o, el);
+                       r = o;
+               }
+               return r;
+       }
+
+       function createObjParam(el, pName, pValue) {
+               var p = createElement("param");
+               p.setAttribute("name", pName);
+               p.setAttribute("value", pValue);
+               el.appendChild(p);
+       }
+
+       function getElementById(id) {
+               return doc.getElementById(id);
+       }
+
+       function createElement(el) {
+               return doc.createElement(el);
+       }
+
+       function hasPlayerVersion(rv) {
+               var pv = ua.pv, v = rv.split(".");
+               v[0] = parseInt(v[0], 10);
+               v[1] = parseInt(v[1], 10);
+               v[2] = parseInt(v[2], 10);
+               return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+       }
+
+       /* Cross-browser dynamic CSS creation
+               - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+       */
+       function createCSS(sel, decl) {
+               if (ua.ie && ua.mac) {
+                       return;
+               }
+               var h = doc.getElementsByTagName("head")[0], s = createElement("style");
+               s.setAttribute("type", "text/css");
+               s.setAttribute("media", "screen");
+               if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
+                       s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+               }
+               h.appendChild(s);
+               if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+                       var ls = doc.styleSheets[doc.styleSheets.length - 1];
+                       if (typeof ls.addRule == OBJECT) {
+                               ls.addRule(sel, decl);
+                       }
+               }
+       }
+
+       function setVisibility(id, isVisible) {
+               var v = isVisible ? "visible" : "hidden";
+               if (isDomLoaded) {
+                       getElementById(id).style.visibility = v;
+               }
+               else {
+                       createCSS("#" + id, "visibility:" + v);
+               }
+       }
+
+       return {
+               /* Public API
+                       - Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
+               */
+               registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
+                       if (!ua.w3cdom || !objectIdStr || !swfVersionStr) {
+                               return;
+                       }
+                       var regObj = {};
+                       regObj.id = objectIdStr;
+                       regObj.swfVersion = swfVersionStr;
+                       regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : false;
+                       regObjArr[regObjArr.length] = regObj;
+                       setVisibility(objectIdStr, false);
+               },
+
+               getObjectById: function(objectIdStr) {
+                       var r = null;
+                       if (ua.w3cdom && isDomLoaded) {
+                               var o = getElementById(objectIdStr);
+                               if (o) {
+                                       var n = o.getElementsByTagName(OBJECT)[0];
+                                       if (!n || (n && typeof o.SetVariable != UNDEF)) {
+                                       r = o;
+                                       }
+                                       else if (typeof n.SetVariable != UNDEF) {
+                                               r = n;
+                                       }
+                               }
+                       }
+                       return r;
+               },
+
+               embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
+                       if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
+                               return;
+                       }
+                       widthStr += ""; // Auto-convert to string to make it idiot proof
+                       heightStr += "";
+                       if (hasPlayerVersion(swfVersionStr)) {
+                               setVisibility(replaceElemIdStr, false);
+                               var att = (typeof attObj == OBJECT) ? attObj : {};
+                               att.data = swfUrlStr;
+                               att.width = widthStr;
+                               att.height = heightStr;
+                               var par = (typeof parObj == OBJECT) ? parObj : {};
+                               if (typeof flashvarsObj == OBJECT) {
+                                       for (var i in flashvarsObj) {
+                                               if (flashvarsObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
+                                                       if (typeof par.flashvars != UNDEF) {
+                                                               par.flashvars += "&" + i + "=" + flashvarsObj[i];
+                                                       }
+                                                       else {
+                                                               par.flashvars = i + "=" + flashvarsObj[i];
+                                                       }
+                                               }
+                                       }
+                               }
+                               addDomLoadEvent(function() {
+                                       createSWF(att, par, replaceElemIdStr);
+                                       if (att.id == replaceElemIdStr) {
+                                               setVisibility(replaceElemIdStr, true);
+                                       }
+                               });
+                       }
+                       else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
+                               setVisibility(replaceElemIdStr, false);
+                               addDomLoadEvent(function() {
+                                       var regObj = {};
+                                       regObj.id = regObj.altContentId = replaceElemIdStr;
+                                       regObj.width = widthStr;
+                                       regObj.height = heightStr;
+                                       regObj.expressInstall = xiSwfUrlStr;
+                                       showExpressInstall(regObj);
+                               });
+                       }
+               },
+
+               getFlashPlayerVersion: function() {
+                       return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+               },
+
+               hasFlashPlayerVersion:hasPlayerVersion,
+
+               createSWF: function(attObj, parObj, replaceElemIdStr) {
+                       if (ua.w3cdom && isDomLoaded) {
+                               return createSWF(attObj, parObj, replaceElemIdStr);
+                       }
+                       else {
+                               return undefined;
+                       }
+               },
+
+               createCSS: function(sel, decl) {
+                       if (ua.w3cdom) {
+                               createCSS(sel, decl);
+                       }
+               },
+
+               addDomLoadEvent:addDomLoadEvent,
+
+               addLoadEvent:addLoadEvent,
+
+               getQueryParamValue: function(param) {
+                       var q = doc.location.search || doc.location.hash;
+                       if (param == null) {
+                               return q;
+                       }
+                       if(q) {
+                               var pairs = q.substring(1).split("&");
+                               for (var i = 0; i < pairs.length; i++) {
+                                       if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+                                               return pairs[i].substring((pairs[i].indexOf("=") + 1));
+                                       }
+                               }
+                       }
+                       return "";
+               },
+
+               // For internal usage only
+               expressInstallCallback: function() {
+                       if (isExpressInstallActive && storedAltContent) {
+                               var obj = getElementById(EXPRESS_INSTALL_ID);
+                               if (obj) {
+                                       obj.parentNode.replaceChild(storedAltContent, obj);
+                                       if (storedAltContentId) {
+                                               setVisibility(storedAltContentId, true);
+                                               if (ua.ie && ua.win) {
+                                                       storedAltContent.style.display = "block";
+                                               }
+                                       }
+                                       storedAltContent = null;
+                                       storedAltContentId = null;
+                                       isExpressInstallActive = false;
+                               }
+                       }
+               }
+
+       };
+
+}();


Property changes on: examples/trunk/google_appengine/static/swfobject/src/swfobject.js
___________________________________________________________________
Name: svn:executable
  + *

Added: examples/trunk/google_appengine/static/swfobject/swfobject.js
===================================================================
--- examples/trunk/google_appengine/static/swfobject/swfobject.js                               (rev 0)
+++ examples/trunk/google_appengine/static/swfobject/swfobject.js       2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,5 @@
+/*     SWFObject v2.0 <http://code.google.com/p/swfobject/>
+       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
+       This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k
){}
 }}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return }J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return }if(
a.i
 e&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return }}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=Z){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=Z){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=Z){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getEl
eme
 ntsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX"
:"P
 lugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id
==Z
 ){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass
"){
 s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return }var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){
i.a
 ddRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return }var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return }r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstal
l=m
 ;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();
\ No newline at end of file

Added: examples/trunk/google_appengine/static/swfobject/test.swf
===================================================================
(Binary files differ)


Property changes on: examples/trunk/google_appengine/static/swfobject/test.swf
___________________________________________________________________
Name: svn:executable
  + *
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/templates/base.html
===================================================================
--- examples/trunk/google_appengine/templates/base.html                         (rev 0)
+++ examples/trunk/google_appengine/templates/base.html 2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+       <title>{% block title %}{% endblock %}</title>
+       {% block head %}{% endblock %}
+</head>
+<body>
+       {% block body %}
+       {% endblock %}
+</body>
+</html>

Added: examples/trunk/google_appengine/templates/swf.html
===================================================================
--- examples/trunk/google_appengine/templates/swf.html                          (rev 0)
+++ examples/trunk/google_appengine/templates/swf.html  2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+
+{% block title %}PyAMF Echo Test Demo{% endblock %}
+
+{% block head %}
+<script type="text/javascript" src="/static/swfobject/swfobject.js"></script>
+<script type="text/javascript">
+    swfobject.embedSWF("{{ swf_url }}", "swf", "{{ width }}", "{{ height }}", "{{ flash_ver }}");
+</script>
+{% endblock %}
+
+{% block body %}
+<div id="swf">
+
+</div>
+{% endblock %}
\ No newline at end of file

_______________________________________________
PyAMF commits mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/commits

_______________________________________________
PyAMF dev mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/dev

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pyamf-commits] r1155 - in examples/trunk: . google_appengine google_appengine/echo google_appengine/static google_appengine/static/swfobject google_appengine/static/swfobject/src google_appengine/templates

Arnar Birgisson
Hey,

I'm good, thanks for asking. Done with courses, next 12 months I'll be
focusing on my thesis :)

I'll stop by on irc.

cheers,
Arnar

On Thu, Apr 10, 2008 at 3:14 PM, Nick Joyce <[hidden email]> wrote:

> Hey Arnar,
>
> How's it going? Hope you are still enjoying the course ..
>
> Been on irc much? We moved server! irc://irc.collab.eu/collab
>
> Thanks for the tip, committed in r1156.
>
> Cheers,
>
> Nick
>
>
> On 10 Apr 2008, at 15:30, Arnar Birgisson wrote:
> Hey Nick,
>
> I think there's no need for the overhead of a script for
> crossdomain.xml. Just use "static_files" in the app.yaml:
>
> - url: /crossdomain.xml
>   static_files: crossdomain.xml
>
> Arnar
>
> On Thu, Apr 10, 2008 at 2:25 PM, SVN commit logs for PyAMF
> <[hidden email]> wrote:
> Author: nick
>  Date: 2008-04-10 16:25:48 +0200 (Thu, 10 Apr 2008)
>  New Revision: 1155
>
>  Added:
>    examples/trunk/google_appengine/
>    examples/trunk/google_appengine/app.yaml
>    examples/trunk/google_appengine/crossdomain.py
>    examples/trunk/google_appengine/echo/
>    examples/trunk/google_appengine/echo/__init__.py
>    examples/trunk/google_appengine/echo/__init__.pyc
>    examples/trunk/google_appengine/echo/gateway.py
>    examples/trunk/google_appengine/echo/index.py
>    examples/trunk/google_appengine/index.html
>    examples/trunk/google_appengine/index.py
>    examples/trunk/google_appengine/static/
>    examples/trunk/google_appengine/static/echo_test.swf
>    examples/trunk/google_appengine/static/swfobject/
>    examples/trunk/google_appengine/static/swfobject/expressInstall.swf
>    examples/trunk/google_appengine/static/swfobject/index.html
>    examples/trunk/google_appengine/static/swfobject/index_dynamic.html
>    examples/trunk/google_appengine/static/swfobject/src/
>    examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
>    examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
>    examples/trunk/google_appengine/static/swfobject/src/swfobject.js
>    examples/trunk/google_appengine/static/swfobject/swfobject.js
>    examples/trunk/google_appengine/static/swfobject/test.swf
>    examples/trunk/google_appengine/templates/
>    examples/trunk/google_appengine/templates/base.html
>    examples/trunk/google_appengine/templates/swf.html
>  Log:
>  Adding working EchoTest Google AppEngine example
>
>
>  Property changes on: examples/trunk/google_appengine
>  ___________________________________________________________________
>  Name: svn:ignore
>    + *.pyc
>  pyamf
>
>
>  Added: examples/trunk/google_appengine/app.yaml
>  ===================================================================
>  --- examples/trunk/google_appengine/app.yaml
> (rev 0)
>  +++ examples/trunk/google_appengine/app.yaml    2008-04-10 14:25:48 UTC
> (rev 1155)
>  @@ -0,0 +1,22 @@
>  +application: pyamf
>  +version: 1
>  +runtime: python
>  +api_version: 1
>  +
>  +handlers:
>  +- url: /
>  +  script: index.py
>  +
>  +- url: /crossdomain.xml
>  +  script: crossdomain.py
>  +
>  +# Echo demo urls
>  +
>  +- url: /echo
>  +  script: echo/index.py
>  +
>  +- url: /gateway/echo
>  +  script: echo/gateway.py
>  +
>  +- url: /static
>  +  static_dir: static
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/crossdomain.py
>  ===================================================================
>  --- examples/trunk/google_appengine/crossdomain.py
> (rev 0)
>  +++ examples/trunk/google_appengine/crossdomain.py      2008-04-10 14:25:48
> UTC (rev 1155)
>  @@ -0,0 +1,7 @@
>  +print 'Content-Type: application/xml'
>  +print
>  +print """<?xml version="1.0"?>
>  +<!DOCTYPE cross-domain-policy SYSTEM
> "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
>  +<cross-domain-policy>
>  +   <allow-access-from domain="*" />
>  +</cross-domain-policy>"""
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/echo/__init__.py
>  ===================================================================
>  --- examples/trunk/google_appengine/echo/__init__.py
> (rev 0)
>  +++ examples/trunk/google_appengine/echo/__init__.py    2008-04-10 14:25:48
> UTC (rev 1155)
>  @@ -0,0 +1,111 @@
>  +# -*- encoding: utf-8 -*-
>  +#
>  +# Copyright (c) 2007-2008 The PyAMF Project.
>  +# See LICENSE for details.
>  +
>  +"""
>  +Echo test core functionality. This module sets up the class
>  +mappings related to the echo_test.swf client on the
>  +U{EchoTest<http://pyamf.org/wiki/EchoTest>} wiki page.
>  +
>  +@author: U{Nick Joyce<mailto:[hidden email]>}
>  +@since: 0.1.0
>  +"""
>  +
>  +from pyamf import register_class
>  +
>  +ECHO_NS = 'org.red5.server.webapp.echo'
>  +
>  +class RemoteClass(object):
>  +    """
>  +    This Python class is mapped to the clientside ActionScript class.
>  +    """
>  +    pass
>  +
>  +class ExternalizableClass(object):
>  +    """
>  +    An example of an externalizable class.
>  +    """
>  +    def __readamf__(self, input):
>  +        """
>  +        This function is invoked when the C{obj} needs to be deserialized.
>  +
>  +        @type obj: L{ExternalizableClass}
>  +        @param obj: The object in question.
>  +        @param input: The input stream to read from.
>  +        @type input L{DataInput<pyamf.amf3.DataInput>}
>  +        """
>  +        assert input.readBoolean() == True
>  +        assert input.readBoolean() == False
>  +        assert input.readByte() == 0
>  +        assert input.readByte() == -1
>  +        assert input.readByte() == 1
>  +        assert input.readByte() == 127
>  +        assert input.readByte() == -127
>  +        assert input.readDouble() == 1.0
>  +        assert input.readFloat() == 2.0
>  +        assert input.readInt() == 0
>  +        assert input.readInt() == -1
>  +        assert input.readInt() == 1
>  +        input.readMultiByte(7, 'iso-8859-1')
>  +        input.readMultiByte(14, 'utf8')
>  +        assert input.readObject() == [1, 'one', 1.0]
>  +        assert input.readShort() == 0
>  +        assert input.readShort() == -1
>  +        assert input.readShort() == 1
>  +        assert input.readUnsignedInt() == 0
>  +        assert input.readUnsignedInt() == 1
>  +        assert input.readUTF() == "Hello world!"
>  +        assert input.readUTFBytes(12) == "Hello world!"
>  +
>  +    def __writeamf__(self, output):
>  +        """
>  +        This function is invoked when the C{obj} needs to be serialized.
>  +
>  +        @type obj: L{ExternalizableClass}
>  +        @param obj: The object in question.
>  +        @param input: The output stream to write to.
>  +        @type input L{DataOutput<pyamf.amf3.DataOutput>}
>  +        """
>  +        output.writeBoolean(True)
>  +        output.writeBoolean(False)
>  +        output.writeByte(0)
>  +        output.writeByte(-1)
>  +        output.writeByte(1)
>  +        output.writeByte(127)
>  +        output.writeByte(-127)
>  +        output.writeDouble(1.0)
>  +        output.writeFloat(2.0)
>  +        output.writeInt(0)
>  +        output.writeInt(-1)
>  +        output.writeInt(1)
>  +        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf",
> 'iso-8859-1')
>  +        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf", 'utf8')
>  +        output.writeObject([1, 'one', 1])
>  +        output.writeShort(0)
>  +        output.writeShort(-1)
>  +        output.writeShort(1)
>  +        output.writeUnsignedInt(0)
>  +        output.writeUnsignedInt(1)
>  +        output.writeUTF("Hello world!")
>  +        output.writeUTFBytes("Hello world!")
>  +
>  +def echo(data):
>  +    """
>  +    Return data back to the client.
>  +
>  +    @type data: C{mixed}
>  +    @param data: Decoded AS->Python data.
>  +    """
>  +    return data
>  +
>  +# Map ActionScript class to Python class
>  +try:
>  +    register_class(RemoteClass, '%s.%s' % (ECHO_NS, 'RemoteClass'))
>  +except ValueError:
>  +    pass
>  +try:
>  +    register_class(ExternalizableClass, '%s.%s' % (ECHO_NS,
>  +        'ExternalizableClass'), metadata=['external'])
>  +except ValueError:
>  +    pass
>
>  Added: examples/trunk/google_appengine/echo/__init__.pyc
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on: examples/trunk/google_appengine/echo/__init__.pyc
>  ___________________________________________________________________
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/echo/gateway.py
>  ===================================================================
>  --- examples/trunk/google_appengine/echo/gateway.py
> (rev 0)
>  +++ examples/trunk/google_appengine/echo/gateway.py     2008-04-10 14:25:48
> UTC (rev 1155)
>  @@ -0,0 +1,17 @@
>  +from pyamf.remoting.gateway.wsgi import WSGIGateway
>  +from google.appengine.ext.webapp import util
>  +
>  +from echo import echo
>  +
>  +services = {
>  +    'echo': echo,
>  +    'echo.echo': echo
>  +}
>  +
>  +def main():
>  +    gateway = WSGIGateway(services)
>  +
>  +    util.run_wsgi_app(gateway)
>  +
>  +if __name__ == "__main__":
>  +    main()
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/echo/index.py
>  ===================================================================
>  --- examples/trunk/google_appengine/echo/index.py
> (rev 0)
>  +++ examples/trunk/google_appengine/echo/index.py       2008-04-10 14:25:48
> UTC (rev 1155)
>  @@ -0,0 +1,10 @@
>  +from google.appengine.ext.webapp import template
>  +
>  +print "Content-Type: text/html"
>  +print
>  +print template.render('../templates/swf.html', {
>  +    'swf_url': '/static/echo_test.swf',
>  +    'width': '100%',
>  +    'height': '100%',
>  +    'flash_ver': '9.0.0'
>  +})
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/index.html
>  ===================================================================
>  --- examples/trunk/google_appengine/index.html
> (rev 0)
>  +++ examples/trunk/google_appengine/index.html  2008-04-10 14:25:48 UTC
> (rev 1155)
>  @@ -0,0 +1,11 @@
>  +{% extends "templates/base.html" %}
>  +
>  +{% block title %}PyAMF/Google App Engine Demo Application{% endblock %}
>  +
>  +{% block body %}
>  +<h1><a href="http://pyamf.org">PyAMF</a>/<a href="">Google App Engine</a>
> Demo Application</h1>
>  +<h2>Available demos:</h2>
>  +<ul>
>  +       <li><a href="/echo">EchoTest</a> - Tests all parts of the AMF
> specification, including AMF0, AMF3 and RemoteObject</li>
>  +</ul>
>  +{% endblock %}
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/index.py
>  ===================================================================
>  --- examples/trunk/google_appengine/index.py
> (rev 0)
>  +++ examples/trunk/google_appengine/index.py    2008-04-10 14:25:48 UTC
> (rev 1155)
>  @@ -0,0 +1,5 @@
>  +from google.appengine.ext.webapp import template
>  +
>  +print "Content-Type: text/html"
>  +print
>  +print template.render('index.html', {})
>  \ No newline at end of file
>
>  Added: examples/trunk/google_appengine/static/echo_test.swf
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on: examples/trunk/google_appengine/static/echo_test.swf
>  ___________________________________________________________________
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/static/swfobject/expressInstall.swf
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on:
> examples/trunk/google_appengine/static/swfobject/expressInstall.swf
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/static/swfobject/index.html
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/index.html
> (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/index.html 2008-04-10
> 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,28 @@
>  +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>  +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
>  +       <head>
>  +               <title>SWFObject v2.0 sample page</title>
>  +               <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
>  +               <script type="text/javascript" src="swfobject.js"></script>
>  +               <script type="text/javascript">
>  +               swfobject.registerObject("myId", "9.0.0",
> "expressInstall.swf");
>  +               </script>
>  +       </head>
>  +       <body>
>  +               <div>
>  +                       <object id="myId"
> classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300"
> height="120">
>  +                               <param name="movie" value="test.swf" />
>  +                       <!--[if !IE]>-->
>  +                               <object
> type="application/x-shockwave-flash" data="test.swf" width="300"
> height="120">
>  +                               <!--<![endif]-->
>  +                               <div>
>  +                                       <h1>Alternative content</h1>
>  +                                       <p><a
> href="http://www.adobe.com/go/getflashplayer"><img
> src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
> alt="Get Adobe Flash player" /></a></p>
>  +                               </div>
>  +                               <!--[if !IE]>-->
>  +                               </object>
>  +                               <!--<![endif]-->
>  +                       </object>
>  +               </div>
>  +       </body>
>  +</html>
>
>
>  Property changes on:
> examples/trunk/google_appengine/static/swfobject/index.html
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>
>  Added: examples/trunk/google_appengine/static/swfobject/index_dynamic.html
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/index_dynamic.html
> (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/index_dynamic.html
> 2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,17 @@
>  +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>  +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
>  +       <head>
>  +               <title>SWFObject v2.0 dynamic embed sample page</title>
>  +               <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
>  +               <script type="text/javascript" src="swfobject.js"></script>
>  +               <script type="text/javascript">
>  +               swfobject.embedSWF("test.swf", "myContent", "300", "120",
> "9.0.0", "expressInstall.swf");
>  +               </script>
>  +       </head>
>  +       <body>
>  +               <div id="myContent">
>  +                       <h1>Alternative content</h1>
>  +                       <p><a
> href="http://www.adobe.com/go/getflashplayer"><img
> src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
> alt="Get Adobe Flash player" /></a></p>
>  +               </div>
>  +       </body>
>  +</html>
>
>
>  Property changes on:
> examples/trunk/google_appengine/static/swfobject/index_dynamic.html
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>
>  Added:
> examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
> (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
> 2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,76 @@
>  +/*     =============================
>  +       SWFObject v2.0 <http://code.google.com/p/swfobject/>
>  +       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van
> der Sluis
>  +       This software is released under the MIT License
> <http://www.opensource.org/licenses/mit-license.php>
>  +       =============================
>  +       Express Install
>  +       Copyright (c) 2005-2007 Adobe Systems Incorporated and its
> licensors. All Rights Reserved.
>  +       =============================
>  +       AS1 version
>  +       =============================
>  +*/
>  +
>  +System.security.allowDomain("fpdownload.macromedia.com");
>  +
>  +var cacheBuster        = Math.random();
>  +var updateSWF  =
> "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+cacheBuster;
>  +var bytes              = loaderClip.getBytesTotal();
>  +loaderClip.loadMovie(updateSWF);
>  +
>  +var time               = 0;
>  +var timeOut            = 5;    // expressed in seconds
>  +var delay              = 10;   // expressed in milliseconds
>  +var id                 = setInterval(checkLoaded, delay);
>  +
>  +function checkLoaded(){
>  +       if(loaderClip.startUpdate.toString() == "[type Function]"){
>  +               // updater has loaded successfully
>  +               clearInterval(id);
>  +               loadComplete();
>  +               return;
>  +       }
>  +       else if(time > timeOut){
>  +               // updater did not load in time, abort load and force
> alternative content
>  +               clearInterval(id);
>  +               loaderClip.unloadMovie();
>  +               loadTimeOut();
>  +               return;
>  +       }
>  +       time += delay/1000;
>  +}
>  +
>  +function loadComplete(){
>  +       loaderClip.redirectURL  = _root.MMredirectURL;
>  +       loaderClip.MMplayerType = _root.MMplayerType;
>  +       loaderClip.MMdoctitle   = _root.MMdoctitle;
>  +       loaderClip.startUpdate();
>  +}
>  +
>  +function loadTimeOut(){
>  +       callbackSWFObject();
>  +}
>  +
>  +function installStatus(statusValue){
>  +       switch(statusValue){
>  +               case "Download.Complete":
>  +                       // Installation is complete.
>  +                       // In most cases the browser window that this SWF
> is hosted in will be closed by the installer or
>  +                       // otherwise it has to be closed manually by the
> end user.
>  +                       // The Adobe Flash installer will reopen the
> browser window and reload the page containing the SWF.
>  +               break;
>  +               case "Download.Cancelled":
>  +                       // The end user chose "NO" when prompted to install
> the new player.
>  +                       // By default the SWFObject callback function is
> called to force alternative content.
>  +                       callbackSWFObject();
>  +               break;
>  +               case "Download.Failed":
>  +                       // The end user failed to download the installer
> due to a network failure.
>  +                       // By default the SWFObject callback function is
> called to force alternative content.
>  +                       callbackSWFObject();
>  +               break;
>  +       }
>  +}
>  +
>  +function callbackSWFObject(){
>  +       getURL("javascript:swfobject.expressInstallCallback();");
>  +}
>  \ No newline at end of file
>
>
>  Property changes on:
> examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>
>  Added:
> examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
>  ===================================================================
>  (Binary files differ)
>
>
>  Property changes on:
> examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
>  ___________________________________________________________________
>  Name: svn:executable
>    + *
>  Name: svn:mime-type
>    + application/octet-stream
>
>  Added: examples/trunk/google_appengine/static/swfobject/src/swfobject.js
>  ===================================================================
>  --- examples/trunk/google_appengine/static/swfobject/src/swfobject.js
> (rev 0)
>  +++ examples/trunk/google_appengine/static/swfobject/src/swfobject.js
> 2008-04-10 14:25:48 UTC (rev 1155)
>  @@ -0,0 +1,631 @@
>  +/*!    SWFObject v2.0 <http://code.google.com/p/swfobject/>
>  +       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van
> der Sluis
>  +       This software is released under the MIT License
> <http://www.opensource.org/licenses/mit-license.php>
>  +*/
>  +
>  +var swfobject = function() {
>  +
>  +       var UNDEF = "undefined",
>  +               OBJECT = "object",
>  +               SHOCKWAVE_FLASH = "Shockwave Flash",
>  +               SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
>  +               FLASH_MIME_TYPE = "application/x-shockwave-flash",
>  +               EXPRESS_INSTALL_ID = "SWFObjectExprInst",
>  +
>  +               win = window,
>  +               doc = document,
>  +               nav = navigator,
>  +
>  +               domLoadFnArr = [],
>  +               regObjArr = [],
>  +               timer = null,
>  +               storedAltContent = null,
>  +               storedAltContentId = null,
>  +               isDomLoaded = false,
>  +               isExpressInstallActive = false;
>  +
>  +       /* Centralized function for browser feature detection
>  +               - Proprietary feature detection (conditional compiling) is
> used to detect Internet Explorer's features
>  +               - User agent string detection is only used when no
> alternative is possible
>  +               - Is executed directly for optimal performance
>  +       */
>  +       var ua = function() {
>  +               var w3cdom = typeof doc.getElementById != UNDEF && typeof
> doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF &&
> typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF &&
> typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
>  +                       playerVersion = [0,0,0],
>  +                       d = null;
>  +               if (typeof nav.plugins != UNDEF && typeof
> nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
>  +                       d = nav.plugins[SHOCKWAVE_FLASH].description;
>  +                       if (d) {
>  +                               d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
>  +                               playerVersion[0] =
> parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
>  +                               playerVersion[1] =
> parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
>  +                               playerVersion[2] = /r/.test(d) ?
> parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
>  +                       }
>  +               }
>  +               else if (typeof win.ActiveXObject != UNDEF) {
>  +                       var a = null, fp6Crash = false;
>  +                       try {
>  +                               a = new ActiveXObject(SHOCKWAVE_FLASH_AX +
> ".7");
>  +                       }
>  +                       catch(e) {
>  +                               try {
>  +                                       a = new
> ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
>  +                                       playerVersion = [6,0,21];
>  +                                       a.AllowScriptAccess = "always";  //
> Introduced in fp6.0.47
>  +                               }
>  +                               catch(e) {
>  +                                       if (playerVersion[0] == 6) {
>  +                                               fp6Crash = true;
>  +                                       }
>  +                               }
>  +                               if (!fp6Crash) {
>  +                                       try {
>  +                                               a = new
> ActiveXObject(SHOCKWAVE_FLASH_AX);
>  +                                       }
>  +                                       catch(e) {}
>  +                               }
>  +                       }
>  +                       if (!fp6Crash && a) { // a will return null when
> ActiveX is disabled
>  +                               try {
>  +                                       d = a.GetVariable("$version");  //
> Will crash fp6.0.21/23/29
>  +                                       if (d) {
>  +                                               d = d.split("
> ")[1].split(",");
>  +                                               playerVersion =
> [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
>  +                                       }
>  +                               }
>  +                               catch(e) {}
>  +                       }
>  +               }
>  +               var u = nav.userAgent.toLowerCase(),
>  +                       p = nav.platform.toLowerCase(),
>  +                       webkit = /webkit/.test(u) ?
> parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, //
> returns either the webkit version or false if not webkit
>  +                       ie = false,
>  +                       windows = p ? /win/.test(p) : /win/.test(u),
>  +                       mac = p ? /mac/.test(p) : /mac/.test(u);
>  +               /*@cc_on
>  +                       ie = true;
>  +                       @if (@_win32)
>  +                               windows = true;
>  +                       @elif (@_mac)
>  +                               mac = true;
>  +                       @end
>  +               @*/
>  +               return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit,
> ie:ie, win:windows, mac:mac };
>  +       }();
>  +
>  +       /* Cross-browser onDomLoad
>  +               - Based on Dean Edwards' solution:
> http://dean.edwards.name/weblog/2006/06/again/
>  +               - Will fire an event as soon as the DOM of a page is loaded
> (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
>  +       */
>  +       var onDomLoad = function() {
>  +               if (!ua.w3cdom) {
>  +                       return;
>  +               }
>  +               addDomLoadEvent(main);
>  +               if (ua.ie && ua.win) {
>  +                       try {  // Avoid a possible Operation Aborted error
>  +                               doc.write("<scr" + "ipt id=__ie_ondomload
> defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid
> Norton AV to add code that can cause errors
>  +                               var s = getElementById("__ie_ondomload");
>  +                               if (s) {
>  +                                       s.onreadystatechange = function() {
>  +                                               if (this.readyState ==
> "complete") {
>  +
> this.parentNode.removeChild(this);
>  +
> callDomLoadFunctions();
>  +                                               }
>  +                                       };
>  +                               }
>  +                       }
>  +                       catch(e) {}
>  +               }
>  +               if (ua.webkit && typeof doc.readyState != UNDEF) {
>  +                       timer = setInterval(function() { if
> (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
>  +               }
>  +               if (typeof doc.addEventListener != UNDEF) {
>  +                       doc.addEventListener("DOMContentLoaded",
> callDomLoadFunctions, null);
>  +               }
>  +               addLoadEvent(callDomLoadFunctions);
>  +       }();
>  +
>  +       function callDomLoadFunctions() {
>  +               if (isDomLoaded) {
>  +                       return;
>  +               }
>  +               if (ua.ie && ua.win) { // Test if we can really add
> elements to the DOM; we don't want to fire it too early
>  +                       var s = createElement("span");
>  +                       try { // Avoid a possible Operation Aborted error
>  +                               var t =
> doc.getElementsByTagName("body")[0].appendChild(s);
>  +                               t.parentNode.removeChild(t);
>  +                       }
>  +                       catch (e) {
>  +                               return;
>  +                       }
>  +               }
>  +               isDomLoaded = true;
>  +               if (timer) {
>  +                       clearInterval(timer);
>  +                       timer = null;
>  +               }
>  +               var dl = domLoadFnArr.length;
>  +               for (var i = 0; i < dl; i++) {
>  +                       domLoadFnArr[i]();
>  +               }
>  +       }
>  +
>  +       function addDomLoadEvent(fn) {
>  +               if (isDomLoaded) {
>  +                       fn();
>  +               }
>  +               else {
>  +                       domLoadFnArr[domLoadFnArr.length] = fn; //
> Array.push() is only available in IE5.5+
>  +               }
>  +       }
>  +
>  +       /* Cross-browser onload
>  +               - Based on James Edwards' solution:
> http://brothercake.com/site/resources/scripts/onload/
>  +               - Will fire an event as soon as a web page including all of
> its assets are loaded
>  +        */
>  +       function addLoadEvent(fn) {
>  +               if (typeof win.addEventListener != UNDEF) {
>  +                       win.addEventListener("load", fn, false);
>  +               }
>  +               else if (typeof doc.addEventListener != UNDEF) {
>  +                       doc.addEventListener("load", fn, false);
>  +               }
>  +               else if (typeof win.attachEvent != UNDEF) {
>  +                       win.attachEvent("onload", fn);
>  +               }
>  +               else if (typeof win.onload == "function") {
>  +                       var fnOld = win.onload;
>  +                       win.onload = function() {
>  +                               fnOld();
>  +                               fn();
>  +                       };
>  +               }
>  +               else {
>  +                       win.onload = fn;
>  +               }
>  +       }
>  +
>  +       /* Main function
>  +               - Will preferably execute onDomLoad, otherwise onload (as a
> fallback)
>  +       */
>  +       function main() { // Static publishing only
>  +               var rl = regObjArr.length;
>  +               for (var i = 0; i < rl; i++) { // For each registered
> object element
>  +                       var id = regObjArr[i].id;
>  +                       if (ua.pv[0] > 0) {
>  +                               var obj = getElementById(id);
>  +                               if (obj) {
>  +                                       regObjArr[i].width =
> obj.getAttribute("width") ? obj.getAttribute("width") : "0";
>  +                                       regObjArr[i].height =
> obj.getAttribute("height") ? obj.getAttribute("height") : "0";
>  +                                       if
> (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >=
> Flash content version: Houston, we have a match!
>  +                                               if (ua.webkit && ua.webkit
> < 312) { // Older webkit engines ignore the object element's nested param
> elements
>  +                                                       fixParams(obj);
>  +                                               }
>  +                                               setVisibility(id, true);
>  +                                       }
>  +                                       else if
> (regObjArr[i].expressInstall && !isExpressInstallActive &&
> hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe
> Express Install dialog if set by the web page author and if supported
> (fp6.0.65+ on Win/Mac OS only)
>  +
> showExpressInstall(regObjArr[i]);
>  +                                       }
>  +                                       else { // Flash plug-in and Flash
> content version mismatch: display alternative content instead of Flash
> content
>  +                                               displayAltContent(obj);
>  +                                       }
>  +                               }
>  +                       }
>  +                       else {  // If no fp is installed, we let the object
> element do its job (show alternative content)
>  +                               setVisibility(id, true);
>  +                       }
>  +               }
>  +       }
>  +
>  +       /* Fix nested param elements, which are ignored by older webkit
> engines
>  +               - This includes Safari up to and including version 1.2.2 on
> Mac OS 10.3
>  +               - Fall back to the proprietary embed element
>  +       */
>  +       function fixParams(obj) {
>  +               var nestedObj = obj.getElementsByTagName(OBJECT)[0];
>  +               if (nestedObj) {
>  +                       var e = createElement("embed"), a =
> nestedObj.attributes;
>  +                       if (a) {
>  +                               var al = a.length;
>  +                               for (var i = 0; i < al; i++) {
>  +                                       if (a[i].nodeName.toLowerCase() ==
> "data") {
>  +                                               e.setAttribute("src",
> a[i].nodeValue);
>  +                                       }
>  +                                       else {
>  +
> e.setAttribute(a[i].nodeName, a[i].nodeValue);
>  +                                       }
>  +                               }
>  +                       }
>  +                       var c = nestedObj.childNodes;
>  +                       if (c) {
>  +                               var cl = c.length;
>  +                               for (var j = 0; j < cl; j++) {
>  +                                       if (c[j].nodeType == 1 &&
> c[j].nodeName.toLowerCase() == "param") {
>  +
> e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
>  +                                       }
>  +                               }
>  +                       }
>  +                       obj.parentNode.replaceChild(e, obj);
>  +               }
>  +       }
>  +
>  +       /* Fix hanging audio/video threads and force open sockets and
> NetConnecti...
>
> [Message clipped]
> _______________________________________________
>  PyAMF dev mailing list - [hidden email]
>  http://lists.pyamf.org/mailman/listinfo/dev
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pyamf-commits] r1155 - in examples/trunk: . google_appengine google_appengine/echo google_appengine/static google_appengine/static/swfobject google_appengine/static/swfobject/src google_appengine/templates

Thijs Triemstra
Hey Arnar,

<a href="irc://irc.collab.eu/collab">irc://irc.collab.eu/pyamf

would be the place to be :)

Cya around!

Thijs

On 10 apr 2008, at 17:26, Arnar Birgisson wrote:
Hey,

I'm good, thanks for asking. Done with courses, next 12 months I'll be
focusing on my thesis :)

I'll stop by on irc.

cheers,
Arnar

On Thu, Apr 10, 2008 at 3:14 PM, Nick Joyce <[hidden email]> wrote:
Hey Arnar,

How's it going? Hope you are still enjoying the course ..

Been on irc much? We moved server! <a href="irc://irc.collab.eu/collab">irc://irc.collab.eu/collab

Thanks for the tip, committed in r1156.

Cheers,

Nick


On 10 Apr 2008, at 15:30, Arnar Birgisson wrote:
Hey Nick,

I think there's no need for the overhead of a script for
crossdomain.xml. Just use "static_files" in the app.yaml:

- url: /crossdomain.xml
 static_files: crossdomain.xml

Arnar

On Thu, Apr 10, 2008 at 2:25 PM, SVN commit logs for PyAMF
<[hidden email]> wrote:
Author: nick
Date: 2008-04-10 16:25:48 +0200 (Thu, 10 Apr 2008)
New Revision: 1155

Added:
  examples/trunk/google_appengine/
  examples/trunk/google_appengine/app.yaml
  examples/trunk/google_appengine/crossdomain.py
  examples/trunk/google_appengine/echo/
  examples/trunk/google_appengine/echo/__init__.py
  examples/trunk/google_appengine/echo/__init__.pyc
  examples/trunk/google_appengine/echo/gateway.py
  examples/trunk/google_appengine/echo/index.py
  examples/trunk/google_appengine/index.html
  examples/trunk/google_appengine/index.py
  examples/trunk/google_appengine/static/
  examples/trunk/google_appengine/static/echo_test.swf
  examples/trunk/google_appengine/static/swfobject/
  examples/trunk/google_appengine/static/swfobject/expressInstall.swf
  examples/trunk/google_appengine/static/swfobject/index.html
  examples/trunk/google_appengine/static/swfobject/index_dynamic.html
  examples/trunk/google_appengine/static/swfobject/src/
  examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
  examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
  examples/trunk/google_appengine/static/swfobject/src/swfobject.js
  examples/trunk/google_appengine/static/swfobject/swfobject.js
  examples/trunk/google_appengine/static/swfobject/test.swf
  examples/trunk/google_appengine/templates/
  examples/trunk/google_appengine/templates/base.html
  examples/trunk/google_appengine/templates/swf.html
Log:
Adding working EchoTest Google AppEngine example


Property changes on: examples/trunk/google_appengine
___________________________________________________________________
Name: svn:ignore
  + *.pyc
pyamf


Added: examples/trunk/google_appengine/app.yaml
===================================================================
--- examples/trunk/google_appengine/app.yaml
(rev 0)
+++ examples/trunk/google_appengine/app.yaml    2008-04-10 14:25:48 UTC
(rev 1155)
@@ -0,0 +1,22 @@
+application: pyamf
+version: 1
+runtime: python
+api_version: 1
+
+handlers:
+- url: /
+  script: index.py
+
+- url: /crossdomain.xml
+  script: crossdomain.py
+
+# Echo demo urls
+
+- url: /echo
+  script: echo/index.py
+
+- url: /gateway/echo
+  script: echo/gateway.py
+
+- url: /static
+  static_dir: static
\ No newline at end of file

Added: examples/trunk/google_appengine/crossdomain.py
===================================================================
--- examples/trunk/google_appengine/crossdomain.py
(rev 0)
+++ examples/trunk/google_appengine/crossdomain.py      2008-04-10 14:25:48
UTC (rev 1155)
@@ -0,0 +1,7 @@
+print 'Content-Type: application/xml'
+print
+print """<?xml version="1.0"?>
+<!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
+<cross-domain-policy>
+   <allow-access-from domain="*" />
+</cross-domain-policy>"""
\ No newline at end of file

Added: examples/trunk/google_appengine/echo/__init__.py
===================================================================
--- examples/trunk/google_appengine/echo/__init__.py
(rev 0)
+++ examples/trunk/google_appengine/echo/__init__.py    2008-04-10 14:25:48
UTC (rev 1155)
@@ -0,0 +1,111 @@
+# -*- encoding: utf-8 -*-
+#
+# Copyright (c) 2007-2008 The PyAMF Project.
+# See LICENSE for details.
+
+"""
+Echo test core functionality. This module sets up the class
+mappings related to the echo_test.swf client on the
+U{EchoTest<http://pyamf.org/wiki/EchoTest>} wiki page.
+
+@author: U{Nick Joyce<[hidden email]>}
+@since: 0.1.0
+"""
+
+from pyamf import register_class
+
+ECHO_NS = 'org.red5.server.webapp.echo'
+
+class RemoteClass(object):
+    """
+    This Python class is mapped to the clientside ActionScript class.
+    """
+    pass
+
+class ExternalizableClass(object):
+    """
+    An example of an externalizable class.
+    """
+    def __readamf__(self, input):
+        """
+        This function is invoked when the C{obj} needs to be deserialized.
+
+        @type obj: L{ExternalizableClass}
+        @param obj: The object in question.
+        @param input: The input stream to read from.
+        @type input L{DataInput<pyamf.amf3.DataInput>}
+        """
+        assert input.readBoolean() == True
+        assert input.readBoolean() == False
+        assert input.readByte() == 0
+        assert input.readByte() == -1
+        assert input.readByte() == 1
+        assert input.readByte() == 127
+        assert input.readByte() == -127
+        assert input.readDouble() == 1.0
+        assert input.readFloat() == 2.0
+        assert input.readInt() == 0
+        assert input.readInt() == -1
+        assert input.readInt() == 1
+        input.readMultiByte(7, 'iso-8859-1')
+        input.readMultiByte(14, 'utf8')
+        assert input.readObject() == [1, 'one', 1.0]
+        assert input.readShort() == 0
+        assert input.readShort() == -1
+        assert input.readShort() == 1
+        assert input.readUnsignedInt() == 0
+        assert input.readUnsignedInt() == 1
+        assert input.readUTF() == "Hello world!"
+        assert input.readUTFBytes(12) == "Hello world!"
+
+    def __writeamf__(self, output):
+        """
+        This function is invoked when the C{obj} needs to be serialized.
+
+        @type obj: L{ExternalizableClass}
+        @param obj: The object in question.
+        @param input: The output stream to write to.
+        @type input L{DataOutput<pyamf.amf3.DataOutput>}
+        """
+        output.writeBoolean(True)
+        output.writeBoolean(False)
+        output.writeByte(0)
+        output.writeByte(-1)
+        output.writeByte(1)
+        output.writeByte(127)
+        output.writeByte(-127)
+        output.writeDouble(1.0)
+        output.writeFloat(2.0)
+        output.writeInt(0)
+        output.writeInt(-1)
+        output.writeInt(1)
+        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf",
'iso-8859-1')
+        output.writeMultiByte(u"\xe4\xf6\xfc\xc4\xd6\xdc\xdf", 'utf8')
+        output.writeObject([1, 'one', 1])
+        output.writeShort(0)
+        output.writeShort(-1)
+        output.writeShort(1)
+        output.writeUnsignedInt(0)
+        output.writeUnsignedInt(1)
+        output.writeUTF("Hello world!")
+        output.writeUTFBytes("Hello world!")
+
+def echo(data):
+    """
+    Return data back to the client.
+
+    @type data: C{mixed}
+    @param data: Decoded AS->Python data.
+    """
+    return data
+
+# Map ActionScript class to Python class
+try:
+    register_class(RemoteClass, '%s.%s' % (ECHO_NS, 'RemoteClass'))
+except ValueError:
+    pass
+try:
+    register_class(ExternalizableClass, '%s.%s' % (ECHO_NS,
+        'ExternalizableClass'), metadata=['external'])
+except ValueError:
+    pass

Added: examples/trunk/google_appengine/echo/__init__.pyc
===================================================================
(Binary files differ)


Property changes on: examples/trunk/google_appengine/echo/__init__.pyc
___________________________________________________________________
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/echo/gateway.py
===================================================================
--- examples/trunk/google_appengine/echo/gateway.py
(rev 0)
+++ examples/trunk/google_appengine/echo/gateway.py     2008-04-10 14:25:48
UTC (rev 1155)
@@ -0,0 +1,17 @@
+from pyamf.remoting.gateway.wsgi import WSGIGateway
+from google.appengine.ext.webapp import util
+
+from echo import echo
+
+services = {
+    'echo': echo,
+    'echo.echo': echo
+}
+
+def main():
+    gateway = WSGIGateway(services)
+
+    util.run_wsgi_app(gateway)
+
+if __name__ == "__main__":
+    main()
\ No newline at end of file

Added: examples/trunk/google_appengine/echo/index.py
===================================================================
--- examples/trunk/google_appengine/echo/index.py
(rev 0)
+++ examples/trunk/google_appengine/echo/index.py       2008-04-10 14:25:48
UTC (rev 1155)
@@ -0,0 +1,10 @@
+from google.appengine.ext.webapp import template
+
+print "Content-Type: text/html"
+print
+print template.render('../templates/swf.html', {
+    'swf_url': '/static/echo_test.swf',
+    'width': '100%',
+    'height': '100%',
+    'flash_ver': '9.0.0'
+})
\ No newline at end of file

Added: examples/trunk/google_appengine/index.html
===================================================================
--- examples/trunk/google_appengine/index.html
(rev 0)
+++ examples/trunk/google_appengine/index.html  2008-04-10 14:25:48 UTC
(rev 1155)
@@ -0,0 +1,11 @@
+{% extends "templates/base.html" %}
+
+{% block title %}PyAMF/Google App Engine Demo Application{% endblock %}
+
+{% block body %}
+<h1><a href="http://pyamf.org">PyAMF</a>/<a href="">Google App Engine</a>
Demo Application</h1>
+<h2>Available demos:</h2>
+<ul>
+       <li><a href="/echo">EchoTest</a> - Tests all parts of the AMF
specification, including AMF0, AMF3 and RemoteObject</li>
+</ul>
+{% endblock %}
\ No newline at end of file

Added: examples/trunk/google_appengine/index.py
===================================================================
--- examples/trunk/google_appengine/index.py
(rev 0)
+++ examples/trunk/google_appengine/index.py    2008-04-10 14:25:48 UTC
(rev 1155)
@@ -0,0 +1,5 @@
+from google.appengine.ext.webapp import template
+
+print "Content-Type: text/html"
+print
+print template.render('index.html', {})
\ No newline at end of file

Added: examples/trunk/google_appengine/static/echo_test.swf
===================================================================
(Binary files differ)


Property changes on: examples/trunk/google_appengine/static/echo_test.swf
___________________________________________________________________
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/static/swfobject/expressInstall.swf
===================================================================
(Binary files differ)


Property changes on:
examples/trunk/google_appengine/static/swfobject/expressInstall.swf
___________________________________________________________________
Name: svn:executable
  + *
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/static/swfobject/index.html
===================================================================
--- examples/trunk/google_appengine/static/swfobject/index.html
(rev 0)
+++ examples/trunk/google_appengine/static/swfobject/index.html 2008-04-10
14:25:48 UTC (rev 1155)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+       <head>
+               <title>SWFObject v2.0 sample page</title>
+               <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+               <script type="text/javascript" src="swfobject.js"></script>
+               <script type="text/javascript">
+               swfobject.registerObject("myId", "9.0.0",
"expressInstall.swf");
+               </script>
+       </head>
+       <body>
+               <div>
+                       <object id="myId"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300"
height="120">
+                               <param name="movie" value="test.swf" />
+                       <!--[if !IE]>-->
+                               <object
type="application/x-shockwave-flash" data="test.swf" width="300"
height="120">
+                               <!--<![endif]-->
+                               <div>
+                                       <h1>Alternative content</h1>
+                                       <p><a
href="http://www.adobe.com/go/getflashplayer"><img
src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt="Get Adobe Flash player" /></a></p>
+                               </div>
+                               <!--[if !IE]>-->
+                               </object>
+                               <!--<![endif]-->
+                       </object>
+               </div>
+       </body>
+</html>


Property changes on:
examples/trunk/google_appengine/static/swfobject/index.html
___________________________________________________________________
Name: svn:executable
  + *

Added: examples/trunk/google_appengine/static/swfobject/index_dynamic.html
===================================================================
--- examples/trunk/google_appengine/static/swfobject/index_dynamic.html
(rev 0)
+++ examples/trunk/google_appengine/static/swfobject/index_dynamic.html
2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+       <head>
+               <title>SWFObject v2.0 dynamic embed sample page</title>
+               <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+               <script type="text/javascript" src="swfobject.js"></script>
+               <script type="text/javascript">
+               swfobject.embedSWF("test.swf", "myContent", "300", "120",
"9.0.0", "expressInstall.swf");
+               </script>
+       </head>
+       <body>
+               <div id="myContent">
+                       <h1>Alternative content</h1>
+                       <p><a
href="http://www.adobe.com/go/getflashplayer"><img
src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt="Get Adobe Flash player" /></a></p>
+               </div>
+       </body>
+</html>


Property changes on:
examples/trunk/google_appengine/static/swfobject/index_dynamic.html
___________________________________________________________________
Name: svn:executable
  + *

Added:
examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
===================================================================
--- examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
(rev 0)
+++ examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,76 @@
+/*     =============================
+       SWFObject v2.0 <http://code.google.com/p/swfobject/>
+       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van
der Sluis
+       This software is released under the MIT License
<http://www.opensource.org/licenses/mit-license.php>
+       =============================
+       Express Install
+       Copyright (c) 2005-2007 Adobe Systems Incorporated and its
licensors. All Rights Reserved.
+       =============================
+       AS1 version
+       =============================
+*/
+
+System.security.allowDomain("fpdownload.macromedia.com");
+
+var cacheBuster        = Math.random();
+var updateSWF  =
"http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+cacheBuster;
+var bytes              = loaderClip.getBytesTotal();
+loaderClip.loadMovie(updateSWF);
+
+var time               = 0;
+var timeOut            = 5;    // expressed in seconds
+var delay              = 10;   // expressed in milliseconds
+var id                 = setInterval(checkLoaded, delay);
+
+function checkLoaded(){
+       if(loaderClip.startUpdate.toString() == "[type Function]"){
+               // updater has loaded successfully
+               clearInterval(id);
+               loadComplete();
+               return;
+       }
+       else if(time > timeOut){
+               // updater did not load in time, abort load and force
alternative content
+               clearInterval(id);
+               loaderClip.unloadMovie();
+               loadTimeOut();
+               return;
+       }
+       time += delay/1000;
+}
+
+function loadComplete(){
+       loaderClip.redirectURL  = _root.MMredirectURL;
+       loaderClip.MMplayerType = _root.MMplayerType;
+       loaderClip.MMdoctitle   = _root.MMdoctitle;
+       loaderClip.startUpdate();
+}
+
+function loadTimeOut(){
+       callbackSWFObject();
+}
+
+function installStatus(statusValue){
+       switch(statusValue){
+               case "Download.Complete":
+                       // Installation is complete.
+                       // In most cases the browser window that this SWF
is hosted in will be closed by the installer or
+                       // otherwise it has to be closed manually by the
end user.
+                       // The Adobe Flash installer will reopen the
browser window and reload the page containing the SWF.
+               break;
+               case "Download.Cancelled":
+                       // The end user chose "NO" when prompted to install
the new player.
+                       // By default the SWFObject callback function is
called to force alternative content.
+                       callbackSWFObject();
+               break;
+               case "Download.Failed":
+                       // The end user failed to download the installer
due to a network failure.
+                       // By default the SWFObject callback function is
called to force alternative content.
+                       callbackSWFObject();
+               break;
+       }
+}
+
+function callbackSWFObject(){
+       getURL("javascript:swfobject.expressInstallCallback();");
+}
\ No newline at end of file


Property changes on:
examples/trunk/google_appengine/static/swfobject/src/expressInstall.as
___________________________________________________________________
Name: svn:executable
  + *

Added:
examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
===================================================================
(Binary files differ)


Property changes on:
examples/trunk/google_appengine/static/swfobject/src/expressInstall.fla
___________________________________________________________________
Name: svn:executable
  + *
Name: svn:mime-type
  + application/octet-stream

Added: examples/trunk/google_appengine/static/swfobject/src/swfobject.js
===================================================================
--- examples/trunk/google_appengine/static/swfobject/src/swfobject.js
(rev 0)
+++ examples/trunk/google_appengine/static/swfobject/src/swfobject.js
2008-04-10 14:25:48 UTC (rev 1155)
@@ -0,0 +1,631 @@
+/*!    SWFObject v2.0 <http://code.google.com/p/swfobject/>
+       Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van
der Sluis
+       This software is released under the MIT License
<http://www.opensource.org/licenses/mit-license.php>
+*/
+
+var swfobject = function() {
+
+       var UNDEF = "undefined",
+               OBJECT = "object",
+               SHOCKWAVE_FLASH = "Shockwave Flash",
+               SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+               FLASH_MIME_TYPE = "application/x-shockwave-flash",
+               EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+
+               win = window,
+               doc = document,
+               nav = navigator,
+
+               domLoadFnArr = [],
+               regObjArr = [],
+               timer = null,
+               storedAltContent = null,
+               storedAltContentId = null,
+               isDomLoaded = false,
+               isExpressInstallActive = false;
+
+       /* Centralized function for browser feature detection
+               - Proprietary feature detection (conditional compiling) is
used to detect Internet Explorer's features
+               - User agent string detection is only used when no
alternative is possible
+               - Is executed directly for optimal performance
+       */
+       var ua = function() {
+               var w3cdom = typeof doc.getElementById != UNDEF && typeof
doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF &&
typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF &&
typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
+                       playerVersion = [0,0,0],
+                       d = null;
+               if (typeof nav.plugins != UNDEF && typeof
nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+                       d = nav.plugins[SHOCKWAVE_FLASH].description;
+                       if (d) {
+                               d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+                               playerVersion[0] =
parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+                               playerVersion[1] =
parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+                               playerVersion[2] = /r/.test(d) ?
parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
+                       }
+               }
+               else if (typeof win.ActiveXObject != UNDEF) {
+                       var a = null, fp6Crash = false;
+                       try {
+                               a = new ActiveXObject(SHOCKWAVE_FLASH_AX +
".7");
+                       }
+                       catch(e) {
+                               try {
+                                       a = new
ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
+                                       playerVersion = [6,0,21];
+                                       a.AllowScriptAccess = "always";  //
Introduced in fp6.0.47
+                               }
+                               catch(e) {
+                                       if (playerVersion[0] == 6) {
+                                               fp6Crash = true;
+                                       }
+                               }
+                               if (!fp6Crash) {
+                                       try {
+                                               a = new
ActiveXObject(SHOCKWAVE_FLASH_AX);
+                                       }
+                                       catch(e) {}
+                               }
+                       }
+                       if (!fp6Crash && a) { // a will return null when
ActiveX is disabled
+                               try {
+                                       d = a.GetVariable("$version");  //
Will crash fp6.0.21/23/29
+                                       if (d) {
+                                               d = d.split("
")[1].split(",");
+                                               playerVersion =
[parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+                                       }
+                               }
+                               catch(e) {}
+                       }
+               }
+               var u = nav.userAgent.toLowerCase(),
+                       p = nav.platform.toLowerCase(),
+                       webkit = /webkit/.test(u) ?
parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, //
returns either the webkit version or false if not webkit
+                       ie = false,
+                       windows = p ? /win/.test(p) : /win/.test(u),
+                       mac = p ? /mac/.test(p) : /mac/.test(u);
+               /*@cc_on
+                       ie = true;
+                       @if (@_win32)
+                               windows = true;
+                       @elif (@_mac)
+                               mac = true;
+                       @end
+               @*/
+               return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit,
ie:ie, win:windows, mac:mac };
+       }();
+
+       /* Cross-browser onDomLoad
+               - Based on Dean Edwards' solution:
http://dean.edwards.name/weblog/2006/06/again/
+               - Will fire an event as soon as the DOM of a page is loaded
(supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
+       */
+       var onDomLoad = function() {
+               if (!ua.w3cdom) {
+                       return;
+               }
+               addDomLoadEvent(main);
+               if (ua.ie && ua.win) {
+                       try {  // Avoid a possible Operation Aborted error
+                               doc.write("<scr" + "ipt id=__ie_ondomload
defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid
Norton AV to add code that can cause errors
+                               var s = getElementById("__ie_ondomload");
+                               if (s) {
+                                       s.onreadystatechange = function() {
+                                               if (this.readyState ==
"complete") {
+
this.parentNode.removeChild(this);
+
callDomLoadFunctions();
+                                               }
+                                       };
+                               }
+                       }
+                       catch(e) {}
+               }
+               if (ua.webkit && typeof doc.readyState != UNDEF) {
+                       timer = setInterval(function() { if
(/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
+               }
+               if (typeof doc.addEventListener != UNDEF) {
+                       doc.addEventListener("DOMContentLoaded",
callDomLoadFunctions, null);
+               }
+               addLoadEvent(callDomLoadFunctions);
+       }();
+
+       function callDomLoadFunctions() {
+               if (isDomLoaded) {
+                       return;
+               }
+               if (ua.ie && ua.win) { // Test if we can really add
elements to the DOM; we don't want to fire it too early
+                       var s = createElement("span");
+                       try { // Avoid a possible Operation Aborted error
+                               var t =
doc.getElementsByTagName("body")[0].appendChild(s);
+                               t.parentNode.removeChild(t);
+                       }
+                       catch (e) {
+                               return;
+                       }
+               }
+               isDomLoaded = true;
+               if (timer) {
+                       clearInterval(timer);
+                       timer = null;
+               }
+               var dl = domLoadFnArr.length;
+               for (var i = 0; i < dl; i++) {
+                       domLoadFnArr[i]();
+               }
+       }
+
+       function addDomLoadEvent(fn) {
+               if (isDomLoaded) {
+                       fn();
+               }
+               else {
+                       domLoadFnArr[domLoadFnArr.length] = fn; //
Array.push() is only available in IE5.5+
+               }
+       }
+
+       /* Cross-browser onload
+               - Based on James Edwards' solution:
http://brothercake.com/site/resources/scripts/onload/
+               - Will fire an event as soon as a web page including all of
its assets are loaded
+        */
+       function addLoadEvent(fn) {
+               if (typeof win.addEventListener != UNDEF) {
+                       win.addEventListener("load", fn, false);
+               }
+               else if (typeof doc.addEventListener != UNDEF) {
+                       doc.addEventListener("load", fn, false);
+               }
+               else if (typeof win.attachEvent != UNDEF) {
+                       win.attachEvent("onload", fn);
+               }
+               else if (typeof win.onload == "function") {
+                       var fnOld = win.onload;
+                       win.onload = function() {
+                               fnOld();
+                               fn();
+                       };
+               }
+               else {
+                       win.onload = fn;
+               }
+       }
+
+       /* Main function
+               - Will preferably execute onDomLoad, otherwise onload (as a
fallback)
+       */
+       function main() { // Static publishing only
+               var rl = regObjArr.length;
+               for (var i = 0; i < rl; i++) { // For each registered
object element
+                       var id = regObjArr[i].id;
+                       if (ua.pv[0] > 0) {
+                               var obj = getElementById(id);
+                               if (obj) {
+                                       regObjArr[i].width =
obj.getAttribute("width") ? obj.getAttribute("width") : "0";
+                                       regObjArr[i].height =
obj.getAttribute("height") ? obj.getAttribute("height") : "0";
+                                       if
(hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >=
Flash content version: Houston, we have a match!
+                                               if (ua.webkit && ua.webkit
< 312) { // Older webkit engines ignore the object element's nested param
elements
+                                                       fixParams(obj);
+                                               }
+                                               setVisibility(id, true);
+                                       }
+                                       else if
(regObjArr[i].expressInstall && !isExpressInstallActive &&
hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe
Express Install dialog if set by the web page author and if supported
(fp6.0.65+ on Win/Mac OS only)
+
showExpressInstall(regObjArr[i]);
+                                       }
+                                       else { // Flash plug-in and Flash
content version mismatch: display alternative content instead of Flash
content
+                                               displayAltContent(obj);
+                                       }
+                               }
+                       }
+                       else {  // If no fp is installed, we let the object
element do its job (show alternative content)
+                               setVisibility(id, true);
+                       }
+               }
+       }
+
+       /* Fix nested param elements, which are ignored by older webkit
engines
+               - This includes Safari up to and including version 1.2.2 on
Mac OS 10.3
+               - Fall back to the proprietary embed element
+       */
+       function fixParams(obj) {
+               var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+               if (nestedObj) {
+                       var e = createElement("embed"), a =
nestedObj.attributes;
+                       if (a) {
+                               var al = a.length;
+                               for (var i = 0; i < al; i++) {
+                                       if (a[i].nodeName.toLowerCase() ==
"data") {
+                                               e.setAttribute("src",
a[i].nodeValue);
+                                       }
+                                       else {
+
e.setAttribute(a[i].nodeName, a[i].nodeValue);
+                                       }
+                               }
+                       }
+                       var c = nestedObj.childNodes;
+                       if (c) {
+                               var cl = c.length;
+                               for (var j = 0; j < cl; j++) {
+                                       if (c[j].nodeType == 1 &&
c[j].nodeName.toLowerCase() == "param") {
+
e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
+                                       }
+                               }
+                       }
+                       obj.parentNode.replaceChild(e, obj);
+               }
+       }
+
+       /* Fix hanging audio/video threads and force open sockets and
NetConnecti...

[Message clipped]
_______________________________________________
PyAMF dev mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/dev


_______________________________________________
PyAMF dev mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/dev


PGP.sig (194 bytes) Download Attachment
Loading...