1. beyzend
  2. projectace3_gae_app

Commits

beyzend  committed c5ff97a Draft

-added the app files.

  • Participants
  • Parent commits 91981ae
  • Branches default

Comments (0)

Files changed (68)

File app.yaml

View file
  • Ignore whitespace
+application: projectace3
+version: 1
+runtime: python
+api_version: 1
+
+handlers:
+
+# PyAMF Flash Remoting Gateway
+- url: /gateway
+  script: gateway.py    
+
+# Static: Flash files.
+- url: /swfs
+  static_dir: swfs
+# Static: Json files
+- url: /data
+  static_dir: data
+    
+# Static: JS files.
+- url: /js
+  static_dir: js    
+  
+# Static: CSS files
+- url: /css
+  static_dir: css
+    
+# Static: image files
+- url: /images
+  static_dir: images    
+
+# Static: downloads
+- url: /downloads
+  static_dir: downloads
+    
+# Examples, each in the examples folder/name_of_example.
+# Note: All examples share the same templates, flash, and js folders. 
+#- url: /examples/(.*?)(/.*)?
+#  script: examples/\1/main.py
+
+# Everything else goes to the main app.
+- url: /.*
+  script: main.py
+  
+skip_files: |
+ ^(.*/)?(
+ (app\.yaml)|
+ (app\.yml)|
+ (index\.yaml)|
+ (index\.yml)|
+ (swfs/org)|
+ (swfs/.*?\.(css|html|fla|js|ttf))|
+ (swfs/library.swf)|
+ (swfs/misc.swf)|
+ (swfs/yflexskin.swf)|
+ (#.*#)|
+ (.*~)|
+ (.*\.py[co])|
+ (.*/RCS/.*)|
+ (\..*)|
+ (flash/.*)|
+ ^(flex/.*)|
+ (psd/.*)|
+ (pyamf/tests/.*)|
+ (tools/.*)|
+ )$
+

File crossdomain.xml

View file
  • Ignore whitespace
+<?xml version="1.0"?>
+<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
+<cross-domain-policy>
+<!-- Place top level domain name -->
+<allow-access-from domain="http://projectace3.appspot.com" secure="false"/>
+<allow-access-from domain="http://projectace3.appspot.com" to-ports="80,443">projectace3.appspot</allow-access-from>
+<allow-http-request-headers-from domain="localhost" headers="*" />
+<!-- use if you need access from subdomains. testing/www/staging.domain.com -->
+<allow-access-from domain="http://localhost" secure="false" />
+<allow-access-from domain="http://localhost" to-ports="80,443" />
+<allow-http-request-headers-from domain="*.gaeswf.org" headers="*" />
+</cross-domain-policy>

File css/dialog.css

View file
  • Ignore whitespace
+/* 
+	Even more rounded corners with CSS: Base stylesheet
+
+	See: 
+		http://www.schillmania.com/content/projects/even-more-rounded-corners/
+		http://www.schillmania.com/projects/dialog2/	
+
+	Credits
+
+		* Nate Koechley - Standard Module Format
+		* squidfingers.com - tiny tiled background design
+*/
+
+.dialog {
+ position:relative;
+ margin:0px auto;
+ min-width:8em;
+ max-width:760px; /* based on image dimensions - not quite consistent with drip styles yet */
+ z-index:1;
+ margin-left:12px; /* default, width of left corner */
+ margin-bottom:0.5em; /* spacing under dialog */
+}
+
+.dialog .content,
+.dialog .t,
+.dialog .b,
+.dialog .b div {
+ background:transparent url(/images/download_single_piece.gif) no-repeat top right;
+}
+
+.dialog .content {
+ position:relative;
+ zoom:1;
+ _overflow-y:hidden;
+ padding:0px 12px 0px 0px;
+}
+
+.dialog .t {
+ /* top+left vertical slice */
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:12px; /* top slice width */
+ margin-left:-12px;
+ height:100%;
+ _height:1600px; /* arbitrary long height, IE 6 */
+ background-position:top left;
+}
+
+.dialog .b {
+ /* bottom */
+ position:relative;
+ width:100%;
+}
+
+.dialog .b,
+.dialog .b div {
+ height:10px; /* height of bottom cap/shade */
+}
+
+.dialog .b {
+ background-position:bottom right;
+}
+
+.dialog .b div {
+ position:relative;
+ width:12px; /* bottom corner width */
+ margin-left:-12px;
+ background-position:bottom left;
+}
+
+.dialog .hd,
+.dialog .bd,
+.dialog .ft {
+ position:relative;
+}
+
+.dialog .wrapper {
+ /* extra content protector - preventing vertical overflow (past background) */
+ position:static;
+ max-height:1000px;
+ overflow:auto; /* note that overflow:auto causes a rather annoying redraw "lag" in Firefox 2, and may degrade performance. Might be worth trying without if you aren't worried about height/overflow issues. */
+}
+
+.dialog h1,
+.dialog p {
+ margin:0px; /* margins will blow out backgrounds, leaving whitespace. */
+ padding:2.5em 1.5em 0.5em 0pt;
+}
+
+.dialog h1 {
+ padding-bottom:0px;
+}

File css/gae.css

View file
  • Ignore whitespace
+/* 
+	Overrides of YUI Reset-Fonts-Grids specifically for The GAE SWF Project site
+*/
+body {padding: 0px; margin:0px; background-image: url('/images/gaeswf_bg.gif'); background-repeat: repeat-x;}
+h1 {font-size: 197%; /* 26pt */ margin-bottom: .5em; }
+h2 {font-size: 138.5%; /* 18pt */ margin-top: .75em; margin-bottom: .75em;}
+h3 {font-size: 123.1%; /* 16pt */}
+p {margin-top: .75em; margin-bottom: .75em;}
+li {margin-bottom: 2.5%;}
+#hd {padding-bottom:10px; margin: 0pt 20pt 0pt 20pt;}
+#bd {margin: 0pt 20pt 0pt 20pt;}
+#ft {font-size: 85%; /* 11pt */ padding: 20pt 20pt 0pt 20pt; background-image:url('/images/gaeswf_footer_bg.gif'); background-repeat: repeat-x; overflow: visible;}
+#imageRight {position:absolute; right:0;}
+#doc3 {margin:0pt;}
+#download {margin-bottom:-.25em;} /* Just this once */
+#additionalInfo {font-size: 77%;}
+#example{margin-bottom:10pt;}
+#sourceLink{font-size: 138.5%;}
+
+/* Makes the other columns go over the first */
+.yui-g { position:relative;}

File css/reset-fonts-grids.css

View file
  • Ignore whitespace
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.1
+*/
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.first div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}s .yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}

File examples/__init__.pyc

  • Ignore whitespace
Binary file added.

File examples/model.pyc

  • Ignore whitespace
Binary file added.

File examples/photo.pyc

  • Ignore whitespace
Binary file added.

File fpconst.py

View file
  • Ignore whitespace
+"""Utilities for handling IEEE 754 floating point special values
+
+This python module implements constants and functions for working with
+IEEE754 double-precision special values.  It provides constants for
+Not-a-Number (NaN), Positive Infinity (PosInf), and Negative Infinity
+(NegInf), as well as functions to test for these values.
+
+The code is implemented in pure python by taking advantage of the
+'struct' standard module. Care has been taken to generate proper
+results on both big-endian and little-endian machines. Some efficiency
+could be gained by translating the core routines into C.
+
+See <http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html>
+for reference material on the IEEE 754 floating point standard.
+
+Further information on this package is available at
+<http://www.analytics.washington.edu/statcomp/projects/rzope/fpconst/>.
+
+------------------------------------------------------------------
+Author:    Gregory R. Warnes <Gregory.R.Warnes@Pfizer.com>
+Date:      2005-02-24
+Version:   0.7.2
+Copyright: (c) 2003-2005 Pfizer, Licensed to PSF under a Contributor Agreement
+License:   Licensed under the Apache License, Version 2.0 (the"License");
+	   you may not use this file except in compliance with the License.
+	   You may obtain a copy of the License at
+
+	       http://www.apache.org/licenses/LICENSE-2.0
+
+	   Unless required by applicable law or agreed to in
+	   writing, software distributed under the License is
+	   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+	   CONDITIONS OF ANY KIND, either express or implied.  See
+	   the License for the specific language governing
+	   permissions and limitations under the License.
+------------------------------------------------------------------
+"""
+
+__version__ = "0.7.2"
+ident = "$Id: fpconst.py 290 2005-02-24 17:42:03Z warnes $"
+
+import struct, operator
+
+# check endianess
+_big_endian = struct.pack('i',1)[0] != '\x01'
+
+# and define appropriate constants
+if(_big_endian): 
+    NaN    = struct.unpack('d', '\x7F\xF8\x00\x00\x00\x00\x00\x00')[0]
+    PosInf = struct.unpack('d', '\x7F\xF0\x00\x00\x00\x00\x00\x00')[0]
+    NegInf = -PosInf
+else:
+    NaN    = struct.unpack('d', '\x00\x00\x00\x00\x00\x00\xf8\xff')[0]
+    PosInf = struct.unpack('d', '\x00\x00\x00\x00\x00\x00\xf0\x7f')[0]
+    NegInf = -PosInf
+
+def _double_as_bytes(dval):
+    "Use struct.unpack to decode a double precision float into eight bytes"
+    tmp = list(struct.unpack('8B',struct.pack('d', dval)))
+    if not _big_endian:
+        tmp.reverse()
+    return tmp
+
+##
+## Functions to extract components of the IEEE 754 floating point format
+##
+
+def _sign(dval):
+    "Extract the sign bit from a double-precision floating point value"
+    bb = _double_as_bytes(dval)
+    return bb[0] >> 7 & 0x01
+
+def _exponent(dval):
+    """Extract the exponentent bits from a double-precision floating
+    point value.
+
+    Note that for normalized values, the exponent bits have an offset
+    of 1023. As a consequence, the actual exponentent is obtained
+    by subtracting 1023 from the value returned by this function
+    """
+    bb = _double_as_bytes(dval)
+    return (bb[0] << 4 | bb[1] >> 4) & 0x7ff
+
+def _mantissa(dval):
+    """Extract the _mantissa bits from a double-precision floating
+    point value."""
+
+    bb = _double_as_bytes(dval)
+    mantissa =  bb[1] & 0x0f << 48
+    mantissa += bb[2] << 40
+    mantissa += bb[3] << 32
+    mantissa += bb[4]
+    return mantissa 
+
+def _zero_mantissa(dval):
+    """Determine whether the mantissa bits of the given double are all
+    zero."""
+    bb = _double_as_bytes(dval)
+    return ((bb[1] & 0x0f) | reduce(operator.or_, bb[2:])) == 0
+
+##
+## Functions to test for IEEE 754 special values
+##
+
+def isNaN(value):
+    "Determine if the argument is a IEEE 754 NaN (Not a Number) value."
+    return (_exponent(value)==0x7ff and not _zero_mantissa(value))
+
+def isInf(value):
+    """Determine if the argument is an infinite IEEE 754 value (positive
+    or negative inifinity)"""
+    return (_exponent(value)==0x7ff and _zero_mantissa(value))
+
+def isFinite(value):
+    """Determine if the argument is an finite IEEE 754 value (i.e., is
+    not NaN, positive or negative inifinity)"""
+    return (_exponent(value)!=0x7ff)
+
+def isPosInf(value):
+    "Determine if the argument is a IEEE 754 positive infinity value"
+    return (_sign(value)==0 and _exponent(value)==0x7ff and \
+            _zero_mantissa(value))
+
+def isNegInf(value):
+    "Determine if the argument is a IEEE 754 negative infinity value"
+    return (_sign(value)==1 and _exponent(value)==0x7ff and \
+            _zero_mantissa(value))
+
+##
+## Functions to test public functions.
+## 
+
+def test_isNaN():
+    assert( not isNaN(PosInf) )
+    assert( not isNaN(NegInf) )
+    assert(     isNaN(NaN   ) )
+    assert( not isNaN(   1.0) )
+    assert( not isNaN(  -1.0) )
+
+def test_isInf():
+    assert(     isInf(PosInf) )
+    assert(     isInf(NegInf) )
+    assert( not isInf(NaN   ) )
+    assert( not isInf(   1.0) )
+    assert( not isInf(  -1.0) )
+
+def test_isFinite():
+    assert( not isFinite(PosInf) )
+    assert( not isFinite(NegInf) )
+    assert( not isFinite(NaN   ) )
+    assert(     isFinite(   1.0) )
+    assert(     isFinite(  -1.0) )
+
+def test_isPosInf():
+    assert(     isPosInf(PosInf) )
+    assert( not isPosInf(NegInf) )
+    assert( not isPosInf(NaN   ) )
+    assert( not isPosInf(   1.0) )
+    assert( not isPosInf(  -1.0) )
+
+def test_isNegInf():
+    assert( not isNegInf(PosInf) )
+    assert(     isNegInf(NegInf) )
+    assert( not isNegInf(NaN   ) )
+    assert( not isNegInf(   1.0) )
+    assert( not isNegInf(  -1.0) )
+
+# overall test
+def test():
+    test_isNaN()
+    test_isInf()
+    test_isFinite()
+    test_isPosInf()
+    test_isNegInf()
+    
+if __name__ == "__main__":
+    test()
+

File gaeswf/__init__.py

View file
  • Ignore whitespace
+#
+# Base class for handlers that want to implement SWF-based applications
+# that support regular and SWFAddress-style deep links.
+#
+
+from google.appengine.ext import webapp
+from urlparse import urlparse
+
+class BaseSWFHandler (webapp.RequestHandler):
+	def handleDeepLinks(self, appUrl):
+		# Handle calls to a SWF example with deep links.
+		
+		url = self.request.uri
+		parsed_url = urlparse(url)
+		
+		# If the URL deep links but not in the SWFAddress format,
+		# translate the deep link into SWFAddress format (anchor syntax).
+		# We calculate the SWF deep link using the appUrl specified above.
+		# (Keep in mind that the app's URL and its actual location 
+		# on the file system do not have to be in any way related so we
+		# can't use the file system location to automate this.) 
+		#
+		# TODO: Can we get the URL mapping from the YAML file somehow?
+		
+		# Translate regular URLs to SWFAddress URLs 
+		# (So http://my.com/deep/link becomes http://my.com/#/deep/link)
+		
+		path = parsed_url.path
+
+		if appUrl == '/' and path != '/':
+
+			#
+			# Deep link: special case for root. 
+			#
+
+			first_slash = url.find('/',7)
+			url = (url[:first_slash] + "/#" + url[first_slash:])
+			self.redirect(url, True)
+
+		elif path != appUrl and path != appUrl + '/':
+
+			#
+			# Deep link: generic case for any url deeper than root.
+			#
+			
+			# Get the SWF deep link by ignoring everything before the app URL.
+			swf_deep_link_index = url.rfind(appUrl) + len(appUrl)
+			swf_deep_link = url[swf_deep_link_index:]
+		
+			# Create the new (SWFAddress) URL and redirect the browser.
+			url = (url[:swf_deep_link_index] + "/#" + swf_deep_link)
+			self.redirect(url, True)		

File gateway.py

View file
  • Ignore whitespace
+# Google App Engine for Flash projects with PyAMF. 
+# Copyright (c) 2008 Aral Balkan (http://aralbalkan.com)
+# Released under the Open Source MIT License
+#
+# Blog post: http://aralbalkan.com/1307 
+# Google App Engine: http://code.google.com/appengine/
+# PyAMF: http://pyamf.org
+
+# PyAMF Flash Remoting (RPC) gateway.
+
+import wsgiref.handlers
+from pyamf.remoting.gateway.wsgi import WSGIGateway
+
+# You can also use a wildcard to import services here.
+from services import user
+from services import photo
+
+# Service mappings
+s = {
+	'user': user,
+	'photo': photo
+}
+
+def main():
+  application = WSGIGateway(s)
+  wsgiref.handlers.CGIHandler().run(application)
+
+if __name__ == '__main__':
+  main()

File index.yaml

View file
  • Ignore whitespace
+indexes:
+
+# AUTOGENERATED
+
+# This index.yaml is automatically updated whenever the dev_appserver
+# detects that a new type of query is run.  If you want to manage the
+# index.yaml file manually, remove the above marker line (the line
+# saying "# AUTOGENERATED").  If you want to manage some indexes
+# manually, move them above the marker line.  The index.yaml file is
+# automatically uploaded to the admin console when you next deploy
+# your application using appcfg.py.
+
+- kind: UserProfile
+  properties:
+  - name: hasPhoto
+  - name: createdAt
+
+- kind: UserProfile
+  properties:
+  - name: hasPhoto
+  - name: modifiedAt
+
+- kind: UserProfile
+  properties:
+  - name: hasPhoto
+  - name: modifiedAt
+    direction: desc

File js/osxmousewheel.js

View file
  • Ignore whitespace
+/* 
+*  Mouse wheel support for OS X - implemented in javascript because Adobe
+*  hasn't implemented it in the mac version of Flash Player  >:(
+*  
+*  Seems to work on Firefox 2 and Safari 2.
+*  
+*  Copyright (c) 2007 Ali Rantakari ( http://hasseg.org/blog )
+*  
+*  Feel free to use, given that this notice stays intact
+*
+*  update: jan2008 by Pavel fljot:
+*  added statement to support Safari under Windows
+*  
+*/
+
+
+
+
+var mw_keepDeltaAtPlusMinusThree = true; // let's not allow other deltas than +/- 3 because that's what flash player does
+
+var mw_container = null;
+
+
+
+// this function courtesy of the Adobe peepz
+function thisMovie(movieName) {
+    if (navigator.appName.indexOf("Microsoft") != -1) {
+        return window[movieName];
+    } else {
+        return document[movieName];
+    }
+}
+
+
+
+
+function mw_initialize() {
+	// initialize mouse wheel capturing:
+	
+	// fljot 7.01.2008: added statement for Safari (to work in Windows)
+	if (navigator.userAgent.indexOf('Mac') != -1 || navigator.userAgent.indexOf('Safari') != -1) {
+		
+		mw_container = document.getElementById(mw_flashContainerId);
+		if (mw_container != null) {
+			if (mw_container.addEventListener) mw_container.addEventListener('DOMMouseScroll', mw_onWheelHandler, false); // Firefox
+			mw_container.onmousewheel = mw_onWheelHandler; // Safari
+		}else{
+			alert("osxmousewheel: can not find flash container div element");
+		}
+		
+	}
+}
+
+
+// Handler for mouse wheel event:
+function mw_onWheelHandler(event){
+	
+	var delta = 0;
+	if (!event) event = window.event;
+	if (event.wheelDelta) {
+		// Safari
+		delta = event.wheelDelta/120;
+		if (window.opera) delta = -delta;
+	} else if (event.detail) {
+		// Firefox
+		delta = -event.detail*3;
+	}
+	
+	if (mw_keepDeltaAtPlusMinusThree) {
+		if (delta > 0) delta = 3;
+		else if (delta == 0) delta = 0;
+		else delta = -3;
+	}
+	
+	if (delta) {
+		// handle mouse events here:
+		
+		var thisMouse;
+		if ((navigator.userAgent.indexOf('Firefox') != -1) || (navigator.userAgent.indexOf('Camino') != -1)) thisMouse = {x:event.layerX, y:event.layerY};
+		else if (navigator.userAgent.indexOf('Safari') != -1) thisMouse = {x:event.offsetX, y:event.offsetY};
+		else if (navigator.userAgent.indexOf('Opera') != -1) thisMouse = {x:event.offsetX, y:event.offsetY};
+		else thisMouse = {x:event.offsetX, y:event.offsetY};
+		
+		if (thisMovie(mw_flashMovieId).dispatchExternalMouseWheelEvent) thisMovie(mw_flashMovieId).dispatchExternalMouseWheelEvent(delta, thisMouse.x, thisMouse.y);
+		else alert("osxmousewheel: ExternalInferface function dispatchExternalMouseWheelEvent not found");
+		
+	};
+	
+	// Prevent default actions caused by mouse wheel.
+	if (event.preventDefault) event.preventDefault();
+	event.returnValue = false;
+}
+
+

File js/swfaddress-optimizer.js

View file
  • Ignore whitespace
+/**
+ * SWFAddress 2.1: Deep linking for Flash and Ajax - http://www.asual.com/swfaddress/
+ *
+ * SWFAddress is (c) 2006-2007 Rostislav Hristov and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * Uses code from SWFObject 2.0 - http://code.google.com/p/swfobject/
+ * SWFObject is (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis 
+ * and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+ 
+SWFAddressOptimizer = new function() {
+
+    var _hash = location.href.indexOf('#');
+    var _url, _opts = {};
+    
+    var _checkFlash = function(version){
+    
+        var rv = version.toString().split('.');
+        for (var i = 0; i < 3; i++)
+            rv[i] = typeof rv[i] != 'undefined' ? parseInt(rv[i]) : 0;
+
+        var pv = [0,0,0];
+        var d = null;
+        
+        if (typeof navigator.plugins != 'undefined' && typeof navigator.plugins['Shockwave Flash'] == 'object') {
+            d = navigator.plugins['Shockwave Flash'].description;
+            if (d) {
+                d = d.replace(/^.*\s+(\S+\s+\S+$)/, '$1');
+                pv[0] = parseInt(d.replace(/^(.*)\..*$/, '$1'), 10);
+                pv[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, '$1'), 10);
+                pv[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, '$1'), 10) : 0;
+            }
+        } else if (typeof window.ActiveXObject != 'undefined') {
+            var a = null;
+            var fp6Crash = false;
+            try {
+                a = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.7');
+            } catch(e) {
+                try { 
+                    a = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
+                    pv = [6,0,21];
+                    a.AllowScriptAccess = 'always';
+                } catch(e) {
+                    if (pv[0] == 6) {
+                        fp6Crash = true;
+                    }
+                }
+                if (!fp6Crash) {
+                    try {
+                        a = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
+                    } catch(e) {}
+                }
+            }
+            if (!fp6Crash && typeof a == 'object') {
+                try {
+                    d = a.GetVariable('$version');
+                    if (d) {
+                        d = d.split(' ')[1].split(',');
+                        pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+                    }
+                } catch(e) {}
+            }
+        }    
+        
+        return (pv[0] > rv[0] || (pv[0] == rv[0] && pv[1] > rv[1]) || 
+            (pv[0] == rv[0] && pv[1] == rv[1] && pv[2] >= rv[2])) ? true : false;
+    }
+    
+    var _redirect = function(swfaddress, base) {
+        var value = location.href.split(location.hostname)[1].replace(base, '');
+        if (swfaddress != '/' && (_hash == -1 || _hash == location.href.length - 1) && (value != '' && value != '/')) {
+            var xhr;
+            if (window.XMLHttpRequest) {
+                xhr = new XMLHttpRequest();
+            } else if (window.ActiveXObject) {
+                try {
+                    try {
+                        xhr = new ActiveXObject('Msxml2.XMLHTTP');
+                    } catch(e) {
+                        xhr = new ActiveXObject('Microsoft.XMLHTTP');
+                    }
+                } catch(e) {}
+            }
+            if (xhr) {
+                xhr.open('get', ((typeof base != 'undefined') ? base : '') + '/?' + swfaddress, false);                
+                xhr.setRequestHeader('Content-Type', 'application/x-swfaddress');
+                xhr.send('');
+                eval(xhr.responseText);
+            }
+        }
+    }
+    
+    var _searchScript = function(el) {
+        if (el.src && /swfaddress-optimizer\.js(\?.*)?$/.test(el.src)) return el;
+        for (var i = 0, l = el.childNodes.length, s; i < l; i++) {
+            if (s = _searchScript(el.childNodes[i])) return s;
+        }        
+    }
+
+    try {
+        _url = String(_searchScript(document).src);
+        var qi = _url.indexOf('?');
+        if (_url && qi > -1) {
+            var param, params = _url.substr(qi + 1).split('&');
+            for (var i = 0, p; p = params[i]; i++) {
+                param = p.split('=');
+                if (/^(flash|base|swfaddress)$/.test(param[0])) {
+                    _opts[param[0]] = unescape(param[1]);
+                }
+            }
+        }
+    } catch(e) {}
+        
+    if (typeof _opts.flash != 'undefined') {
+        if (_checkFlash(_opts.flash)) {
+            _redirect(_opts.swfaddress, _opts.base);
+        } else if (_hash != -1) {
+            location.replace(location.href.replace(/#(\/)?/, ''));
+        }
+    } else {
+        _redirect(_opts.swfaddress, _opts.base);
+    }
+}

File js/swfaddress.js

View file
  • Ignore whitespace
+/**
+ * SWFAddress 2.1: Deep linking for Flash and Ajax - http://www.asual.com/swfaddress/
+ *
+ * SWFAddress is (c) 2006-2007 Rostislav Hristov and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+
+if (typeof com == "undefined") var com = {};
+if (typeof com.asual == "undefined") com.asual = {};
+if (typeof com.asual.util == "undefined") com.asual.util = {};
+   
+/**
+ * @class Utility class that provides detailed browser information.
+ * @static
+ * @ignore
+ */
+com.asual.util.Browser = new function() {
+
+    var _version = -1;
+    var _agent = navigator.userAgent;
+    var _ie = false, _camino = false, _safari = false, _opera = false, 
+        _firefox = false, _netscape = false, _mozilla = false;
+
+    var _getVersion = function(s, i) {
+        return parseFloat(_agent.substr(_agent.indexOf(s) + i));
+    }
+    
+    if (_ie = /MSIE/.test(_agent))
+        _version = _getVersion('MSIE', 4);
+        
+    if (_safari = /AppleWebKit/.test(_agent))
+        _version = _getVersion('Safari', 7);
+        
+    if (_opera = /Opera/.test(_agent))
+        _version = parseFloat(navigator.appVersion);
+        
+    if (_camino = /Camino/.test(_agent))
+        _version = _getVersion('Camino', 7);
+        
+    if (_firefox = /Firefox/.test(_agent))
+        _version = _getVersion('Firefox', 8);
+        
+    if (_netscape = /Netscape/.test(_agent))
+        _version = _getVersion('Netscape', 9);
+        
+    if (_mozilla = /Mozilla/.test(_agent) && /rv:/.test(_agent))
+        _version = _getVersion('rv:', 3);
+
+
+    /**
+     * Detects the version of the browser.
+     * @return {Number}
+     * @static
+     */
+    this.getVersion = function() {
+        return _version;
+    }
+
+    /**
+     * Detects if the browser is Internet Explorer.
+     * @return {Boolean}
+     * @static
+     */
+    this.isIE = function() {
+        return _ie;
+    }
+
+    /**
+     * Detects if the browser is Safari.
+     * @return {Boolean}
+     * @static
+     */
+    this.isSafari = function() {
+        return _safari;
+    }
+
+    /**
+     * Detects if the browser is Opera.
+     * @return {Boolean}
+     * @static
+     */
+    this.isOpera = function() {
+        return _opera;
+    }
+
+    /**
+     * Detects if the browser is Camino.
+     * @return {Boolean}
+     * @static
+     */
+    this.isCamino = function() {
+        return _camino;
+    }
+
+    /**
+     * Detects if the browser is Firefox.
+     * @return {Boolean}
+     * @static
+     */
+    this.isFirefox = function() {
+        return _firefox;
+    }
+
+    /**
+     * Detects if the browser is Netscape.
+     * @return {Boolean}
+     * @static
+     */
+    this.isNetscape = function() {
+        return _netscape;
+    }
+        
+    /**
+     * Detects if the browser is Mozilla.
+     * @return {Boolean}
+     * @static
+     */
+    this.isMozilla = function() {
+        return _mozilla;
+    }
+}
+
+/**
+ * @class Utility class that provides event helpers.
+ * @static
+ * @ignore
+ */
+com.asual.util.Events = new function() {
+
+    var _cache = [];
+    var _browser = com.asual.util.Browser;
+    var _dcl = 'DOMContentLoaded';
+
+    if (_browser.isIE() || _browser.isSafari()) {
+        (function (){
+            try {
+                if (_browser.isIE() || !/loaded|complete/.test(document.readyState))
+                    document.documentElement.doScroll('left');
+            } catch(e) {
+                return setTimeout(arguments.callee, 0);
+            }
+            for (var i = 0, e; e = _cache[i]; i++)
+                if (e.t == _dcl) e.l.call(null);
+        })();
+    }
+
+    /**
+     * Adds an event listener to an object.
+     * @param {Object} obj The object that provides events.
+     * @param {String} type The type of the event.
+     * @param {Function} listener The event listener function.
+     * @return {void}
+     * @static
+     */
+    this.addListener = function(obj, type, listener) {
+        _cache.push({o: obj, t: type, l: listener});
+        if (!(type == _dcl && (_browser.isIE() || _browser.isSafari()))) {
+            if (obj.addEventListener)
+                obj.addEventListener(type, listener, false);
+            else if (obj.attachEvent)
+                obj.attachEvent('on' + type, listener);
+        }
+    }
+
+    /**
+     * Removes an event listener from an object.
+     * @param {Object} obj The object that provides events.
+     * @param {String} type The type of the event.
+     * @param {Function} listener The event listener function.
+     * @return {void}     
+     * @static
+     */
+    this.removeListener = function(obj, type, listener) {
+        for (var i = 0, e; e = _cache[i]; i++) {
+            if (e.o == obj && e.t == type && e.l == listener) {
+                _cache.splice(i, 1);
+                break;
+            }
+        }
+        if (!(type == _dcl && (_browser.isIE() || _browser.isSafari()))) {
+            if (obj.removeEventListener)
+                obj.removeEventListener(type, listener, false);
+            else if (obj.detachEvent)
+                obj.detachEvent('on' + type, listener);
+        }
+    }
+
+    var _unload = function() {
+        for (var i = 0, evt; evt = _cache[i]; i++) {
+            if (evt.t != _dcl)
+                com.asual.util.Events.removeListener(evt.o, evt.t, evt.l);
+        }
+    }
+
+    this.addListener(window, 'unload', _unload);
+}
+
+/**
+ * Creates a new SWFAddress event.
+ * @class Event class for SWFAddress.
+ * @param {String} type Type of the event.
+ */
+SWFAddressEvent = function(type) {
+    
+    /**
+     * String representation of this object.
+     * @ignore
+     */
+    this.toString = function() {
+        return '[object SWFAddressEvent]';
+    }
+
+    /**
+     * The type of this event.
+     * @type String
+     */
+    this.type = type;
+
+    /**
+     * The target of this event.
+     * @type Function
+     */
+    this.target = [SWFAddress][0];
+
+    /**
+     * The value of this event.
+     * @type String
+     */
+    this.value = SWFAddress.getValue();
+
+    /**
+     * The path of this event.
+     * @type String
+     */
+    this.path = SWFAddress.getPath();
+    
+    /**
+     * The folders in the deep linking path of this event.
+     * @type Array
+     */
+    this.pathNames = SWFAddress.getPathNames();
+
+    /**
+     * The parameters of this event.
+     * @type Object
+     */
+    this.parameters = {};
+
+    var _parametersNames = SWFAddress.getParameterNames();
+    for (var i = 0, l = _parametersNames.length; i < l; i++)
+        this.parameters[_parametersNames[i]] = SWFAddress.getParameter(_parametersNames[i]);
+    
+    /**
+     * The parameters names of this event.
+     * @type Array     
+     */
+     this.parametersNames = _parametersNames;
+}
+
+/**
+ * Init event.
+ * @type String
+ * @memberOf SWFAddressEvent
+ * @static
+ */
+SWFAddressEvent.INIT = 'init';
+
+/**
+ * Change event.
+ * @type String
+ * @memberOf SWFAddressEvent
+ * @static 
+ */
+SWFAddressEvent.CHANGE = 'change';
+
+/**
+ * @class The SWFAddress class can be configured with query parameters using the following format:
+ * swfaddress.js?html=false&history=1&tracker=pageTracker._trackPageview&strict=1.<br /> 
+ * The list of supported options include:<br /><br />
+ * <code>history:Boolean</code> - Enables or disables the creation of history entries.<br />
+ * <code>html:Boolean</code> - Enables or disables the usage of swfaddress.html.<br />
+ * <code>strict:Boolean</code> - Enables or disables the strict mode.<br />
+ * <code>tracker:String</code> - Sets a function for page view tracking.<br />
+ * @static 
+ */ 
+SWFAddress = new function() {
+
+    var _browser = com.asual.util.Browser;
+    var _events = com.asual.util.Events;
+    var _version = _browser.getVersion();
+    var _supported = false;
+
+    if (_browser.isIE()) 
+        _supported = _version >= 6;
+        
+    if (_browser.isSafari())
+        _supported = _version >= 312;
+        
+    if (_browser.isOpera())
+        _supported = _version >= 9.02;
+        
+    if (_browser.isCamino()) 
+        _supported = _version >= 1;
+        
+    if (_browser.isFirefox())
+        _supported = _version >= 1;
+        
+    if (_browser.isNetscape())
+        _supported = _version >= 8;
+        
+    if (_browser.isMozilla())
+        _supported = _version >= 1.8;
+
+    var _t = top;
+    var _d = _t.document;
+    var _h = _t.history;
+    var _l = _t.location;
+    var _st = setTimeout;
+    
+    var FUNCTION = 'function';
+    var UNDEFINED = 'undefined';
+    var SWFADDRESS = 'swfaddress';
+
+    var _iframe, _form, _url;
+    var _title = _d.title;
+    var _length = _h.length;
+    var _silent = false;
+    var _listeners = {};
+    var _stack = [];
+    var _ids = [];
+    
+    var _opts = {};
+    _opts.history = true;
+    _opts.html = false;
+    _opts.strict = true;
+    _opts.tracker = '_trackDefault';
+    
+    if ((!_supported && _l.href.indexOf('#') != -1) || 
+        (_browser.isSafari() && _version < 412 && _l.href.indexOf('#') != -1 && _l.search != '')){
+        _d.open();
+        _d.write('<html><head><meta http-equiv="refresh" content="0;url=' + 
+            _l.href.substr(0, _l.href.indexOf('#')) + '" /></head></html>');
+        _d.close();
+    }
+
+    var _getHash = function() {
+        var index = _l.href.indexOf('#');
+        if (index != -1) {
+            var hash = unescape(_l.href.substr(index + 1));
+            if (/^[a-z0-9 ,=_&\-\.\?\+\/]*$/i.test(hash))
+                return hash;
+            else
+                _l.replace(_l.href.substr(0, index));
+        }
+        return '';
+    }
+
+    var _value = _getHash();
+
+    var _strictCheck = function(value, force) {
+        if (_opts.strict)
+            value = force ? (value.substr(0, 1) != '/' ? '/' + value : value) : (value == '' ? '/' : value);
+        return value;
+    }
+
+    var _ieLocal = function(value) {
+        return (_browser.isIE() && _l.protocol == 'file:') ? _value.replace(/\?/, '%3F') : value;    
+    }
+
+    var _searchScript = function(el) {
+        if (el.src && /swfaddress\.js(\?.*)?$/.test(el.src)) return el;
+        for (var i = 0, l = el.childNodes.length, s; i < l; i++)
+            if (s = _searchScript(el.childNodes[i])) return s;
+    }
+    
+    var _titleCheck = function() {
+        if (_browser.isIE() && _d.title != _title)
+            SWFAddress.setTitle(_title);
+    }
+
+    var _listen = function() {
+        if (!_silent) {
+            var hash = _getHash();
+            if (_browser.isIE()) {
+                if (_value != hash) {
+                    if (_version < 7)
+                        _l.reload();
+                    else
+                        SWFAddress.setValue(hash);
+                }
+            } else if (_browser.isSafari() && _version < 523) {
+                if (_length != _h.length) {
+                    _length = _h.length;
+                    if (typeof _stack[_length - 1] != UNDEFINED)
+                        _value = _stack[_length - 1];
+                    _update();
+                }
+            } else if (_value != hash) {
+                _value = hash;
+                _update();
+            }
+            _titleCheck();
+        }
+    }
+
+    var _jsDispatch = function(type) {
+        if (SWFAddress.hasEventListener(type))
+            SWFAddress.dispatchEvent(new SWFAddressEvent(type));
+        type = type.substr(0, 1).toUpperCase() + type.substr(1);
+        if(typeof SWFAddress['on' + type] == FUNCTION)
+            SWFAddress['on' + type]();
+    }
+
+    var _jsInit = function() {
+        _jsDispatch('init');
+    }
+
+    var _jsChange = function() {
+        _jsDispatch('change');
+    }
+
+    var _swfChange = function() {
+        for (var i = 0, id, value = SWFAddress.getValue(), setter = 'setSWFAddressValue'; id = _ids[i]; i++) {
+            var obj = document.getElementById(id);
+            if (obj) {
+                if (obj.parentNode && typeof obj.parentNode.so != UNDEFINED) {
+                    obj.parentNode.so.call(setter, value);
+                } else {
+                    if (!(obj && typeof obj[setter] != UNDEFINED)) {
+                        var objects = obj.getElementsByTagName('object');
+                        var embeds = obj.getElementsByTagName('embed');
+                        obj = ((objects[0] && typeof objects[0][setter] != UNDEFINED) ? 
+                            objects : ((embeds[0] && typeof embeds[0][setter] != UNDEFINED) ? 
+                                embeds[0] : null));
+                    }
+                    if (obj)
+                        obj[setter](value);
+                } 
+            } else if (obj = document[id]) {
+                if (typeof obj[setter] != UNDEFINED)
+                    obj[setter](value);
+            }
+        }
+    }
+
+    var _update = function() {
+        _swfChange();
+        _jsChange();
+        _st(_track, 10);
+    }
+
+    var _trackDefault = function(value) {
+        if (typeof urchinTracker == FUNCTION) 
+            urchinTracker(value);
+        if (typeof pageTracker != UNDEFINED && typeof pageTracker._trackPageview == FUNCTION)
+            pageTracker._trackPageview(value);
+    }
+    
+    eval('var _trackDefault = ' + _trackDefault + ';');
+    
+    var _track = function() {
+        if (typeof _opts.tracker != UNDEFINED && eval('typeof ' + _opts.tracker + ' != "' + UNDEFINED + '"')) {
+            var fn = eval(_opts.tracker);
+            if (typeof fn == FUNCTION)
+                fn((_l.pathname + (/\/$/.test(_l.pathname) ? '' : '/') + SWFAddress.getValue()).replace(/\/\//, '/').replace(/^\/$/, ''));
+        }
+    }
+    
+    var _htmlWrite = function() {
+        var doc = _iframe.contentWindow.document;
+        doc.open();
+        doc.write('<script>var ' + SWFADDRESS + ' = "' + _getHash() + '";</script>');
+        doc.close();
+    }
+
+    var _htmlLoad = function() {
+        var win = _iframe.contentWindow;
+        if (_opts.html) {
+            var src = win.location.href;
+            _value = (src.indexOf('?') > -1) ? src.substr(src.indexOf('?') + 1) : '';
+        } else {
+            _value = (typeof win[SWFADDRESS] != UNDEFINED) ? win[SWFADDRESS] : '';
+        }
+        win.document.title = _d.title;
+        if (_value != _getHash()) {
+            _update();
+            _l.hash = _ieLocal(_value);
+        }
+    }
+
+    var _load = function() {
+        var attr = 'id="' + SWFADDRESS + '" style="position:absolute;top:-9999px;"';
+        if (_browser.isIE()) {
+            document.body.appendChild(document.createElement('div')).innerHTML = '<iframe ' + attr + ' src="' + 
+                (_opts.html ? _url.replace(/\.js(\?.*)?$/, '.html') + '?' + _getHash() : 'javascript:false;') + 
+                '" width="0" height="0"></iframe>';
+            _iframe = document.getElementById(SWFADDRESS);
+            _st(function() {
+                _events.addListener(_iframe, 'load', _htmlLoad);            
+                if (!_opts.html && typeof _iframe.contentWindow[SWFADDRESS] == UNDEFINED) 
+                    _htmlWrite();
+            }, 10);
+        } else if (_browser.isSafari()) {
+            if (_version < 412) {
+                document.body.innerHTML += '<form ' + attr + ' method="get"></form>';
+                _form = document.getElementById(SWFADDRESS);
+            }
+            if (typeof _l[SWFADDRESS] == UNDEFINED) _l[SWFADDRESS] = {};
+            if (typeof _l[SWFADDRESS][_l.pathname] != UNDEFINED) _stack = _l[SWFADDRESS][_l.pathname].split(',');
+        } else if (_browser.isOpera() && _ids.length == 0 && typeof navigator.plugins['Shockwave Flash'] == 'object') {
+            document.body.innerHTML += '<embed ' + attr + ' src="' + _url.replace(/\.js(\?.*)?$/, '.swf') + 
+                '" type="application/x-shockwave-flash" />';
+        }
+        _st(_jsInit, 1);
+        _st(_jsChange, 2);
+        _st(_track, 10);
+        setInterval(_listen, 50);
+    }
+
+    /**
+     * Init event.
+     * @type Function
+     * @event
+     * @static
+     */
+    this.onInit = null;
+    
+    /**
+     * Change event.
+     * @type Function
+     * @event
+     * @static
+     */
+    this.onChange = null;
+    
+    /**
+     * String representation of this class.
+     * @ignore
+     */
+    this.toString = function() {
+        return '[class SWFAddress]';
+    }
+
+    /**
+     * Loads the previous URL in the history list.
+     * @return {void}
+     * @static
+     */
+    this.back = function() {
+        _h.back();
+    }
+
+    /**
+     * Loads the next URL in the history list.
+     * @return {void}
+     * @static
+     */
+    this.forward = function() {
+        _h.forward();
+    }
+
+    /**
+     * Loads a URL from the history list.
+     * @param {Number} delta An integer representing a relative position in the history list.
+     * @return {void}
+     * @static
+     */
+    this.go = function(delta) {
+        _h.go(delta);
+    }
+
+    /**
+     * Opens a new URL in the browser. 
+     * @param {String} url The resource to be opened.
+     * @param {String} target Target window.
+     * @return {void}
+     * @static
+     */
+    this.href = function(url, target) {
+        target = (typeof target != UNDEFINED) ? target : '_self';     
+        if (target == '_self')
+            self.location.href = url; 
+        if (target == '_top')
+            _l.href = url; 
+        if (target == '_blank')
+            window.open(url); 
+        else
+            _t.frames[target].location.href = url; 
+    }
+
+    /**
+     * Opens a browser popup window. 
+     * @param {String} url Resource location.
+     * @param {String} name Name of the popup window.
+     * @param {String} options Options which get evaluted and passed to the window.open() method.
+     * @param {String} handler Optional JavaScript code for popup handling.    
+     * @return {void}
+     * @static
+     */
+    this.popup = function(url, name, options, handler) {
+        var popup = window.open(url, name, eval(options));
+        eval(handler);
+    }
+
+    /**
+     * Registers an event listener.
+     * @param {String} type Event type.
+     * @param {Function} listener Event listener.
+     * @return {void}
+     * @static
+     */
+    this.addEventListener = function(type, listener) {
+        if (typeof _listeners[type] == UNDEFINED)
+            _listeners[type] = [];
+        _listeners[type].push(listener);
+    }
+
+    /**
+     * Removes an event listener.
+     * @param {String} type Event type.
+     * @param {Function} listener Event listener.
+     * @return {void}
+     * @static     
+     */
+    this.removeEventListener = function(type, listener) {
+        if (typeof _listeners[type] != UNDEFINED) {
+            for (var i = 0, l; l = _listeners[type][i]; i++)
+                if (l == listener) break;
+            _listeners[type].splice(i, 1);
+        }
+    }
+
+    /**
+     * Dispatches an event to all the registered listeners. 
+     * @param {Object} event Event object.
+     * @return {Boolean}
+     * @static
+     */
+    this.dispatchEvent = function(event) {
+        if (typeof _listeners[event.type] != UNDEFINED && _listeners[event.type].length) {
+            event.target = this;
+            for (var i = 0, l; l = _listeners[event.type][i]; i++)
+                l(event);
+            return true;           
+        }
+        return false;
+    }
+
+    /**
+     * Checks the existance of any listeners registered for a specific type of event. 
+     * @param {String} event Event type.
+     * @return {Boolean}
+     * @static
+     */
+    this.hasEventListener = function(type) {
+        return (typeof _listeners[type] != UNDEFINED && _listeners[type].length > 0);
+    }
+    
+    /**
+     * Provides the base address of the document. 
+     * @return {String}
+     * @static
+     */
+    this.getBaseURL = function() {
+        var url = _l.href;
+        if (url.indexOf('#') != -1)
+            url = url.substr(0, url.indexOf('#'));
+        if (url.substr(url.length - 1) == '/')
+            url = url.substr(0, url.length - 1);
+        return url;
+    }
+
+    /**
+     * Provides the state of the strict mode setting. 
+     * @return {Boolean}
+     * @static
+     */
+    this.getStrict = function() {
+        return _opts.strict;
+    }
+
+    /**
+     * Enables or disables the strict mode.
+     * @param {Boolean} strict Strict mode state.
+     * @return {void}
+     * @static
+     */
+    this.setStrict = function(strict) {
+        _opts.strict = strict;
+    }
+
+    /**
+     * Provides the state of the history setting. 
+     * @return {Boolean}
+     * @static
+     */
+    this.getHistory = function() {
+        return _opts.history;
+    }
+
+    /**
+     * Enables or disables the creation of history entries.
+     * @param {Boolean} history History state.
+     * @return {void}
+     * @static
+     */
+    this.setHistory = function(history) {
+        _opts.history = history;
+    }
+
+    /**
+     * Provides the tracker function.
+     * @return {String}
+     * @static
+     */
+    this.getTracker = function() {
+        return _opts.tracker;
+    }
+
+    /**
+     * Sets a function for page view tracking. The default value is 'urchinTracker'.
+     * @param {String} tracker Tracker function.
+     * @return {void}
+     * @static
+     */
+    this.setTracker = function(tracker) {
+        _opts.tracker = tracker;
+    }
+
+    /**
+     * Provides a list of all the Flash objects registered. 
+     * @return {Array}
+     * @static
+     */
+    this.getIds = function() {
+        return _ids;
+    }
+
+    /**
+     * Provides the id the first and probably the only Flash object registered. 
+     * @return {String}
+     * @static
+     */
+    this.getId = function(index) {
+        return _ids[0];
+    }
+
+    /**
+     * Sets the id of a single Flash object which will be registered for deep linking.
+     * @param {String} id ID of the object.
+     * @return {void}
+     * @static
+     */
+    this.setId = function(id) {
+        _ids[0] = id;
+    }
+
+    /**
+     * Adds an id to the list of Flash object registered for deep linking.
+     * @param {String} id ID of the object.
+     * @return {void}
+     * @static
+     */
+    this.addId = function(id) {
+        this.removeId(id);
+        _ids.push(id);
+    }
+
+    /**
+     * Removes an id from the list of Flash object registered for deep linking.
+     * @param {String} id ID of the object.
+     * @return {void}
+     * @static
+     */
+    this.removeId = function(id) {
+        for (var i = 0; i < _ids.length; i++) {
+            if (id == _ids[i]) {
+                _ids.splice(i, 1);
+                break;
+            }
+        }
+    }
+
+    /**
+     * Provides the title of the HTML document.
+     * @return {String}
+     * @static
+     */
+    this.getTitle = function() {
+        return _d.title;
+    }
+
+    /**
+     * Sets the title of the HTML document.
+     * @param {String} title Title value.
+     * @return {void}
+     * @static
+     */
+    this.setTitle = function(title) {
+        if (!_supported) return null;
+        if (typeof title == UNDEFINED) return;
+        if (title == 'null') title = '';
+        _title = _d.title = title;
+        _st(function() {
+            if (_iframe && _iframe.contentWindow && _iframe.contentWindow.document && _iframe.contentWindow.title)
+                _iframe.contentWindow.document.title = _title;
+         }, 1000);
+    }
+
+    /**
+     * Provides the status of the browser window.
+     * @return {String}
+     * @static
+     */
+    this.getStatus = function() {
+        return _t.status;
+    }
+
+    /**
+     * Sets the status of the browser window.
+     * @param {String} status Status value.
+     * @return {void}
+     * @static
+     */
+    this.setStatus = function(status) {
+        if (!_supported) return null;
+        if (typeof status == UNDEFINED) return;
+        if (!_browser.isSafari()) {
+            status = _strictCheck((status != 'null') ? status : '', true);
+            if (status == '/') status = '';
+            if (!(/http(s)?:\/\//.test(status))) {
+                var index = _l.href.indexOf('#');
+                status = (index == -1 ? _l.href : _l.href.substr(0, index)) + '#' + status;
+            }
+            _t.status = status;
+        }
+    }
+
+    /**
+     * Resets the status of the browser window.
+     * @return {void}
+     * @static
+     */
+    this.resetStatus = function() {
+        _t.status = '';
+    }
+
+    /**
+     * Provides the current deep linking value.
+     * @return {String}
+     * @static
+     */
+    this.getValue = function() {
+        if (!_supported) return null;
+        return _strictCheck(_value, false);
+    }
+
+    /**
+     * Sets the current deep linking value.
+     * @param {String} value A value which will be appended to the base link of the HTML document.
+     * @return {void}
+     * @static
+     */
+    this.setValue = function(value) {
+        if (!_supported) return null;
+        if (typeof value == UNDEFINED) return;
+        if (value == 'null') value = ''
+        value = _strictCheck(value, true);
+        if (value == '/') value = '';
+        if (_value == value) return;
+        _value = value;
+        _silent = true;
+        _update();
+        _stack[_h.length] = _value;
+        if (_browser.isSafari()) {
+            if (_opts.history) {
+                _l[SWFADDRESS][_l.pathname] = _stack.toString();
+                _length = _h.length + 1;
+                if (_version < 412) {
+                    if (_l.search == '') {
+                        _form.action = '#' + _value;
+                        _form.submit();
+                    }
+                } else if (_version < 523){
+                    var evt = document.createEvent('MouseEvents');
+                    evt.initEvent('click', true, true);
+                    var anchor = document.createElement('a');
+                    anchor.href = '#' + _value;
+                    anchor.dispatchEvent(evt);                
+                } else {
+                    _l.hash = '#' + _value;
+                }
+            } else {
+                _l.replace('#' + _value);
+            }
+        } else if (_value != _getHash()) {
+            if (_opts.history)
+                _l.hash = '#' + _ieLocal(_value);
+            else
+                _l.replace('#' + _value);
+        }
+        if (_browser.isIE() && _opts.history) {
+            if (_opts.html) {
+                var loc = _iframe.contentWindow.location;
+                loc.assign(loc.pathname + '?' + _getHash());
+            } else {
+                _htmlWrite();
+            }
+        }
+        if (_browser.isSafari())
+            _st(function(){ _silent = false; }, 1);
+        else
+            _silent = false;
+    }
+
+    /**
+     * Provides the deep linking value without the query string.
+     * @return {String}
+     * @static
+     */
+    this.getPath = function() {
+        var value = this.getValue();
+        return (value.indexOf('?') != -1) ? value.split('?')[0] : value;
+    }
+
+    /**
+     * Provides a list of all the folders in the deep linking path.
+     * @return {Array}
+     * @static
+     */
+    this.getPathNames = function() {
+        var path = SWFAddress.getPath();
+        var names = path.split('/');
+        if (path.substr(0, 1) == '/')
+            names.splice(0, 1);
+        if (path.substr(path.length - 1, 1) == '/')
+            names.splice(names.length - 1, 1);
+        return names;
+    }
+
+    /**
+     * Provides the query string part of the deep linking value.
+     * @return {String}
+     * @static
+     */
+    this.getQueryString = function() {
+        var value = this.getValue();
+        var index = value.indexOf('?');
+        return (index != -1 && index < value.length) ? value.substr(index + 1) : '';
+    }
+
+    /**
+     * Provides the value of a specific query parameter.
+     * @param {String} param Parameter name.
+     * @return {String}
+     * @static
+     */
+    this.getParameter = function(param) {
+        var value = this.getValue();
+        var index = value.indexOf('?');
+        if (index != -1) {
+            value = value.substr(index + 1);
+            var params = value.split('&');
+            var p, i = params.length;
+            while(i--) {
+                p = params[i].split('=');
+                if (p[0] == param)
+                    return p[1];
+            }
+        }
+        return '';
+    }
+
+    /**
+     * Provides a list of all the query parameter names.
+     * @return {Array}
+     * @static
+     */
+    this.getParameterNames = function() {
+        var value = this.getValue();
+        var index = value.indexOf('?');
+        var names = [];
+        if (index != -1) {
+            value = value.substr(index + 1);
+            if (value != '' && value.indexOf('=') != -1) {
+                var params = value.split('&');
+                var i = 0;
+                while(i < params.length) {
+                    names.push(params[i].split('=')[0]);
+                    i++;
+                }
+            }
+        }
+        return names;
+    }
+
+    if (_supported) {
+    
+        for (var i = 1; i < _length; i++)
+            _stack.push('');
+            
+        _stack.push(_getHash());
+    
+        if (_browser.isIE() && _l.hash != _getHash())
+            _l.hash = '#' + _ieLocal(_getHash());
+    
+        try {
+            _url = String(_searchScript(document).src);
+            var qi = _url.indexOf('?');
+            if (_url && qi > -1) {
+                var param, params = _url.substr(qi + 1).split('&');
+                for (var i = 0, p; p = params[i]; i++) {
+                    param = p.split('=');
+                    if (/^(history|html|strict)$/.test(param[0]))
+                        _opts[param[0]] = (isNaN(param[1]) ? eval(param[1]) : (parseFloat(param[1]) > 0));
+                    if (/^tracker$/.test(param[0]))
+                        _opts[param[0]] = param[1];
+                }
+            }
+        } catch(e) {}
+        if (/file:\/\//.test(_l.href)) _opts.html = false;
+    
+        _titleCheck();
+        _events.addListener(document, 'DOMContentLoaded', _load);
+    
+    } else {
+        _track();
+    }
+}
+
+/**
+ * SWFAddress embed hooks.
+ * @ignore
+ */
+new function() {
+
+    var _func, _args;
+    var UNDEFINED = 'undefined';
+
+    if (typeof swfobject != UNDEFINED) SWFObject = swfobject;
+    if (typeof FlashObject != UNDEFINED) SWFObject = FlashObject;
+    
+    if (typeof SWFObject != UNDEFINED) {
+        if (SWFObject.prototype && SWFObject.prototype.write) {
+            _func = SWFObject.prototype.write;
+            SWFObject.prototype.write = function() {
+                _args = arguments;
+                if (this.getAttribute('version').major < 8) {
+                    this.addVariable('$swfaddress', SWFAddress.getValue());
+                    ((typeof _args[0] == 'string') ? 
+                        document.getElementById(_args[0]) : _args[0]).so = this;
+                }
+                var success;
+                if (success = _func.apply(this, _args))
+                    SWFAddress.addId(this.getAttribute('id'));
+                return success;
+            }
+        } else {
+            _func = SWFObject.registerObject;
+            SWFObject.registerObject = function() {
+                _args = arguments;
+                _func.apply(this, _args);
+                SWFAddress.addId(_args[0]);            
+            }
+            _func = SWFObject.createSWF;
+            SWFObject.createSWF = function() {
+                _args = arguments;
+                _func.apply(this, _args);
+                SWFAddress.addId(_args[0].id);            
+            }
+            _func = SWFObject.embedSWF;
+            SWFObject.embedSWF = function() {
+                _args = arguments;
+                _func.apply(this, _args);
+                SWFAddress.addId(_args[8].id);            
+            }
+        }
+    }
+    
+    if (typeof UFO != UNDEFINED) {
+        _func = UFO.create;
+        UFO.create = function() {
+            _args = arguments;
+            _func.apply(this, _args);
+            SWFAddress.addId(_args[0].id);        
+        }
+    }
+    
+    if (typeof AC_FL_RunContent != UNDEFINED) {
+        _func = AC_FL_RunContent;
+        AC_FL_RunContent = function() {
+            _args = arguments;        
+            _func.apply(this, _args);
+            for (var i = 0, l = _args.length; i < l; i++)
+                if (_args[i]== 'id') SWFAddress.addId(_args[i+1]);
+        }
+    }
+}

File js/swfobject.js

View file
  • Ignore whitespace
+/**
+ * SWFObject v1.4.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
+ *   legal reasons.
+ */
+if(typeof deconcept=="undefined"){var deconcept=new Object();}
+if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
+if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
+deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
+if(!document.createElement||!document.getElementById){return;}
+this.DETECT_KEY=_b?_b:"detectflash";
+this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
+this.params=new Object();
+this.variables=new Object();
+this.attributes=new Array();
+if(_1){this.setAttribute("swf",_1);}
+if(id){this.setAttribute("id",id);}
+if(w){this.setAttribute("width",w);}
+if(h){this.setAttribute("height",h);}
+if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
+this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
+if(c){this.addParam("bgcolor",c);}
+var q=_8?_8:"high";
+this.addParam("quality",q);
+this.setAttribute("useExpressInstall",_7);
+this.setAttribute("doExpressInstall",false);
+var _d=(_9)?_9:window.location;
+this.setAttribute("xiRedirectUrl",_d);
+this.setAttribute("redirectUrl","");
+if(_a){this.setAttribute("redirectUrl",_a);}};
+deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
+this.attributes[_e]=_f;
+},getAttribute:function(_10){
+return this.attributes[_10];
+},addParam:function(_11,_12){
+this.params[_11]=_12;
+},getParams:function(){
+return this.params;
+},addVariable:function(_13,_14){
+this.variables[_13]=_14;
+},getVariable:function(_15){
+return this.variables[_15];
+},getVariables:function(){
+return this.variables;
+},getVariablePairs:function(){
+var _16=new Array();
+var key;
+var _18=this.getVariables();
+for(key in _18){_16.push(key+"="+_18[key]);}
+return _16;
+},getSWFHTML:function(){
+var _19="";
+if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
+if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
+_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
+_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
+var _1a=this.getParams();
+for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
+var _1c=this.getVariablePairs().join("&");
+if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
+_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
+_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
+_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
+var _1d=this.getParams();
+for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
+var _1f=this.getVariablePairs().join("&");
+if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
+return _19;},write:function(_20){
+if(this.getAttribute("useExpressInstall")){
+var _21=new deconcept.PlayerVersion([6,0,65]);
+if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
+this.setAttribute("doExpressInstall",true);
+this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
+document.title=document.title.slice(0,47)+" - Flash Player Installation";
+this.addVariable("MMdoctitle",document.title);}}
+if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
+var n=(typeof _20=="string")?document.getElementById(_20):_20;
+n.innerHTML=this.getSWFHTML();return true;
+}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};
+deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
+var _25=new deconcept.PlayerVersion([0,0,0]);
+if(navigator.plugins&&navigator.mimeTypes.length){
+var x=navigator.plugins["Shockwave Flash"];
+if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
+}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);_25=new deconcept.PlayerVersion([i,0,0]);}}
+catch(e){}
+if(_23&&_25.major>_23.major){return _25;}
+if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
+try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
+catch(e){}}}return _25;};
+deconcept.PlayerVersion=function(_29){
+this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
+this.minor=parseInt(_29[1])||0;
+this.rev=parseInt(_29[2])||0;};
+deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
+if(this.major<fv.major){return false;}
+if(this.major>fv.major){return true;}
+if(this.minor<fv.minor){return false;}
+if(this.minor>fv.minor){return true;}
+if(this.rev<fv.rev){return false;}return true;};
+deconcept.util={getRequestParameter:function(_2b){
+var q=document.location.search||document.location.hash;
+if(q){var _2d=q.indexOf(_2b+"=");
+var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
+if(q.length>1&&_2d>-1){return q.substring(q.indexOf("=",_2d)+1,_2e);}}
+return "";}};
+deconcept.SWFObjectUtil.cleanupSWFs=function(){
+var _2f=document.getElementsByTagName("OBJECT");
+for(var i=0;i<_2f.length;i++){
+for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=null;}}}};
+if(typeof window.onunload=="function"){
+var oldunload=window.onunload;
+window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldunload();};
+}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
+if(Array.prototype.push==null){
+Array.prototype.push=function(_32){
+this[this.length]=_32;
+return this.length;};}
+
+var getQueryParamValue = deconcept.util.getRequestParameter;
+var FlashObject = deconcept.SWFObject; // for backwards compatibility
+var SWFObject = deconcept.SWFObject;
+

File js/swfresize.js

View file
  • Ignore whitespace
+//Source adapted from sample found at - http://www.alistapart.com/articles/fontresizing/
+function init()  
+{
+   var iBase = TextResizeDetector.addEventListener(onFontResize,null);
+}
+//id of element to check for and insert control
+TextResizeDetector.TARGET_ELEMENT_ID = 'doc3';
+//function to call once TextResizeDetector has init'd
+TextResizeDetector.USER_INIT_FUNC = init;
+
+/*
+Copyright (c) 2006 Niqui Merret. 
+http://niquimerret.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+var lastSize = null;
+
+function onFontResize(e,args) {
+	lastSize = (lastSize == null)?args[0].iBase:lastSize;
+	var newSize = (args[0].iSize == 0)?1:args[0].iSize;
+	var sizeDiff = newSize/lastSize;
+	var resizableswf = document.getElementById('example');
+	if(resizableswf){
+		//alert("WIDTH: " + parseFloat(resizableswf.offsetWidth));
+		var newWidth = (parseFloat(resizableswf.offsetWidth)*parseFloat(sizeDiff))+"px";
+		var newHeight = (parseFloat(resizableswf.offsetHeight)*parseFloat(sizeDiff))+"px";
+
+		// Aral: If the new width is larger than the maxWidth, adjust the maxWidth accordingly
+		// (This is necessary when using maxWidth along with a set height to make a SWF 
+		// sit in a DIV and resize automatically when the page is resized).
+		//alert ("w: " + newWidth + ", mW: " + resizableswf.style.maxWidth);
+		if (newWidth > resizableswf.style.maxWidth)
+			resizableswf.style.maxWidth = newWidth;
+			
+		resizableswf.style.width = newWidth;
+		resizableswf.style.height = newHeight;
+	}
+
+	lastSize = newSize;
+}

File js/textresizedetector.js

View file
  • Ignore whitespace
+/** 
+ *  @fileoverview TextResizeDetector
+ * 
+ *  Detects changes to font sizes when user changes browser settings
+ *  <br>Fires a custom event with the following data:<br><br>
+ * 	iBase  : base font size  	
+ *	iDelta : difference in pixels from previous setting<br>
+ *  	iSize  : size in pixel of text<br>
+ *  
+ *  * @author Lawrence Carvalho carvalho@uk.yahoo-inc.com
+ * @version 1.0
+ */
+
+/**
+ * @constructor
+ */
+TextResizeDetector = function() { 
+    var el  = null;
+	var iIntervalDelay  = 200;
+	var iInterval = null;
+	var iCurrSize = -1;
+	var iBase = -1;
+ 	var aListeners = [];
+ 	var createControlElement = function() {
+	 	el = document.createElement('span');
+		el.id='textResizeControl';
+		el.innerHTML='&nbsp;';
+		el.style.position="absolute";
+		el.style.le