home *** CD-ROM | disk | FTP | other *** search
/ Ice Age Fan CD 1 / CD1_Scrat.iso / flash / data / game.swf / scripts / com / google / analytics / external / HTMLDOM.as < prev    next >
Encoding:
Text File  |  2012-07-04  |  5.8 KB  |  227 lines

  1. package com.google.analytics.external
  2. {
  3.    import com.google.analytics.debug.DebugConfiguration;
  4.    
  5.    public class HTMLDOM extends JavascriptProxy
  6.    {
  7.       public static var cache_properties_js:XML = <script>
  8.             <![CDATA[
  9.                     function()
  10.                     {
  11.                         var obj = {};
  12.                             obj.host         = document.location.host;
  13.                             obj.language     = navigator.language ? navigator.language : navigator.browserLanguage;
  14.                             obj.characterSet = document.characterSet ? document.characterSet : document.charset;
  15.                             obj.colorDepth   = window.screen.colorDepth;
  16.                             obj.location     = document.location.toString();
  17.                             obj.pathname     = document.location.pathname;
  18.                             obj.protocol     = document.location.protocol;
  19.                             obj.search       = document.location.search;
  20.                             obj.referrer     = document.referrer;
  21.                             obj.title        = document.title;
  22.                         
  23.                         return obj;
  24.                     }
  25.                 ]]>
  26.          </script>;
  27.       
  28.       private var _referrer:String;
  29.       
  30.       private var _language:String;
  31.       
  32.       private var _host:String;
  33.       
  34.       private var _pathname:String;
  35.       
  36.       private var _location:String;
  37.       
  38.       private var _search:String;
  39.       
  40.       private var _characterSet:String;
  41.       
  42.       private var _title:String;
  43.       
  44.       private var _protocol:String;
  45.       
  46.       private var _colorDepth:String;
  47.       
  48.       public function HTMLDOM(param1:DebugConfiguration)
  49.       {
  50.          super(param1);
  51.       }
  52.       
  53.       public function get search() : String
  54.       {
  55.          if(_search)
  56.          {
  57.             return _search;
  58.          }
  59.          if(!isAvailable())
  60.          {
  61.             return null;
  62.          }
  63.          _search = getProperty("document.location.search");
  64.          return _search;
  65.       }
  66.       
  67.       public function get location() : String
  68.       {
  69.          if(_location)
  70.          {
  71.             return _location;
  72.          }
  73.          if(!isAvailable())
  74.          {
  75.             return null;
  76.          }
  77.          _location = getPropertyString("document.location");
  78.          return _location;
  79.       }
  80.       
  81.       public function get pathname() : String
  82.       {
  83.          if(_pathname)
  84.          {
  85.             return _pathname;
  86.          }
  87.          if(!isAvailable())
  88.          {
  89.             return null;
  90.          }
  91.          _pathname = getProperty("document.location.pathname");
  92.          return _pathname;
  93.       }
  94.       
  95.       public function cacheProperties() : void
  96.       {
  97.          if(!isAvailable())
  98.          {
  99.             return;
  100.          }
  101.          var _loc1_:Object = call(cache_properties_js);
  102.          if(_loc1_)
  103.          {
  104.             _host = _loc1_.host;
  105.             _language = _loc1_.language;
  106.             _characterSet = _loc1_.characterSet;
  107.             _colorDepth = _loc1_.colorDepth;
  108.             _location = _loc1_.location;
  109.             _pathname = _loc1_.pathname;
  110.             _protocol = _loc1_.protocol;
  111.             _search = _loc1_.search;
  112.             _referrer = _loc1_.referrer;
  113.             _title = _loc1_.title;
  114.          }
  115.       }
  116.       
  117.       public function get language() : String
  118.       {
  119.          if(_language)
  120.          {
  121.             return _language;
  122.          }
  123.          if(!isAvailable())
  124.          {
  125.             return null;
  126.          }
  127.          var _loc1_:String = getProperty("navigator.language");
  128.          if(_loc1_ == null)
  129.          {
  130.             _loc1_ = getProperty("navigator.browserLanguage");
  131.          }
  132.          _language = _loc1_;
  133.          return _language;
  134.       }
  135.       
  136.       public function get colorDepth() : String
  137.       {
  138.          if(_colorDepth)
  139.          {
  140.             return _colorDepth;
  141.          }
  142.          if(!isAvailable())
  143.          {
  144.             return null;
  145.          }
  146.          _colorDepth = getProperty("window.screen.colorDepth");
  147.          return _colorDepth;
  148.       }
  149.       
  150.       public function get referrer() : String
  151.       {
  152.          if(_referrer)
  153.          {
  154.             return _referrer;
  155.          }
  156.          if(!isAvailable())
  157.          {
  158.             return null;
  159.          }
  160.          _referrer = getProperty("document.referrer");
  161.          return _referrer;
  162.       }
  163.       
  164.       public function get protocol() : String
  165.       {
  166.          if(_protocol)
  167.          {
  168.             return _protocol;
  169.          }
  170.          if(!isAvailable())
  171.          {
  172.             return null;
  173.          }
  174.          _protocol = getProperty("document.location.protocol");
  175.          return _protocol;
  176.       }
  177.       
  178.       public function get host() : String
  179.       {
  180.          if(_host)
  181.          {
  182.             return _host;
  183.          }
  184.          if(!isAvailable())
  185.          {
  186.             return null;
  187.          }
  188.          _host = getProperty("document.location.host");
  189.          return _host;
  190.       }
  191.       
  192.       public function get characterSet() : String
  193.       {
  194.          if(_characterSet)
  195.          {
  196.             return _characterSet;
  197.          }
  198.          if(!isAvailable())
  199.          {
  200.             return null;
  201.          }
  202.          var _loc1_:String = getProperty("document.characterSet");
  203.          if(_loc1_ == null)
  204.          {
  205.             _loc1_ = getProperty("document.charset");
  206.          }
  207.          _characterSet = _loc1_;
  208.          return _characterSet;
  209.       }
  210.       
  211.       public function get title() : String
  212.       {
  213.          if(_title)
  214.          {
  215.             return _title;
  216.          }
  217.          if(!isAvailable())
  218.          {
  219.             return null;
  220.          }
  221.          _title = getProperty("document.title");
  222.          return _title;
  223.       }
  224.    }
  225. }
  226.  
  227.