cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [48/50] [abbrv] merging 2.9.1->2.9.x
Date Fri, 01 Nov 2013 01:27:43 GMT
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp7/framework/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --cc wp7/framework/Properties/AssemblyInfo.cs
index 122ead8,70ee17d..29be4ee
--- a/wp7/framework/Properties/AssemblyInfo.cs
+++ b/wp7/framework/Properties/AssemblyInfo.cs
@@@ -2,11 -2,11 +2,11 @@@
  using System.Runtime.CompilerServices;
  using System.Runtime.InteropServices;
  
--// General Information about an assembly is controlled through the following 
++// General Information about an assembly is controlled through the following
  // set of attributes. Change these attribute values to modify the information
  // associated with an assembly.
  [assembly: AssemblyTitle("WPCordovaClassLib")]
- [assembly: AssemblyDescription("0.0.0")]
 -[assembly: AssemblyDescription("2.9.0")]
++[assembly: AssemblyDescription("2.9.1")]
  [assembly: AssemblyConfiguration("")]
  [assembly: AssemblyCompany("Apache Cordova")]
  [assembly: AssemblyProduct("WPCordovaClassLib")]
@@@ -14,8 -14,8 +14,8 @@@
  [assembly: AssemblyTrademark("")]
  [assembly: AssemblyCulture("")]
  
--// Setting ComVisible to false makes the types in this assembly not visible 
--// to COM components.  If you need to access a type in this assembly from 
++// Setting ComVisible to false makes the types in this assembly not visible
++// to COM components.  If you need to access a type in this assembly from
  // COM, set the ComVisible attribute to true on that type.
  [assembly: ComVisible(false)]
  
@@@ -25,13 -25,13 +25,13 @@@
  // Version information for an assembly consists of the following four values:
  //
  //      Major Version
--//      Minor Version 
++//      Minor Version
  //      Build Number
  //      Revision
  //
--// You can specify all the values or you can default the Revision and Build Numbers 
++// You can specify all the values or you can default the Revision and Build Numbers
  // by using the '*' as shown below:
  
- [assembly: AssemblyVersion("0.0.0.0")]
- [assembly: AssemblyFileVersion("0.0.0.0")]
 -[assembly: AssemblyVersion("2.9.0.0")]
 -[assembly: AssemblyFileVersion("2.9.0")]
++[assembly: AssemblyVersion("2.9.1.0")]
++[assembly: AssemblyFileVersion("2.9.1")]
  

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp7/template/config.xml
----------------------------------------------------------------------
diff --cc wp7/template/config.xml
index fd3a63f,d1ef04b..a5f7010
--- a/wp7/template/config.xml
+++ b/wp7/template/config.xml
@@@ -20,53 -20,68 +20,52 @@@
  #
  -->
  <widget>
 -
 -  <features>
 -    <feature name="Device">
 -      <param name="wp-package" value="Device" onload="false"/>
 -    </feature>
 -    <feature name="Logger">
 -      <param name="wp-package" value="Logger"/>
 -    </feature>
 -    <feature name="Compass">
 -      <param name="wp-package" value="Compass" />
 -    </feature>
 -    <feature name="Accelerometer">
 -      <param name="wp-package" value="Accelerometer"/>
 -    </feature>
 -    <feature name="Camera">
 -      <param name="wp-package" value="Camera"/>
 -    </feature>
 -    <feature name="NetworkStatus">
 -      <param name="wp-package" value="NetworkStatus"/>
 -    </feature>
 -    <feature name="Contacts">
 -      <param name="wp-package" value="Contacts"/>
 -    </feature>
 -    <feature name="DebugConsole">
 -      <param name="wp-package" value="DebugConsole"/>
 -    </feature>
 -    <feature name="Echo">
 -      <param name="wp-package" value="Echo"/>
 -    </feature>
 -    <feature name="File">
 -      <param name="wp-package" value="File"/>
 -    </feature>
 -    <feature name="FileTransfer">
 -      <param name="wp-package" value="FileTransfer"/>
 -    </feature>
 -    <feature name="Geolocation">
 -      <param name="wp-package" value="Geolocation"/>
 -    </feature>
 -    <feature name="Media">
 -      <param name="wp-package" value="Media"/>
 -    </feature>
 -    <feature name="Capture">
 -      <param name="wp-package" value="Capture"/>
 -    </feature>
 -    <feature name="SplashScreen">
 -      <param name="wp-package" value="SplashScreen"/>
 -    </feature>
 -    <feature name="Battery">
 -      <param name="wp-package" value="Battery"/>
 -    </feature>
 -    <feature name="Globalization">
 -      <param name="wp-package" value="Globalization"/>
 -    </feature>
 -    <feature name="InAppBrowser">
 -      <param name="wp-package" value="InAppBrowser"/>
 -    </feature>
 -    <feature name="Notification">
 -      <param name="wp-package" value="Notification"/>
 -    </feature>
 -  </features>
 -
 -
 -  <access origin="*"/>
 -
 +    <access origin="*"/>
- 
 +    <features>
 +        <feature name="Device">
 +            <param name="wp-package" value="Device" onload="false"/>
 +        </feature>
 +        <feature name="Compass">
 +            <param name="wp-package" value="Compass" />
 +        </feature>
 +        <feature name="Accelerometer">
 +            <param name="wp-package" value="Accelerometer"/>
 +        </feature>
 +        <feature name="Camera">
 +            <param name="wp-package" value="Camera"/>
 +        </feature>
 +        <feature name="NetworkStatus">
 +            <param name="wp-package" value="NetworkStatus"/>
 +        </feature>
 +        <feature name="Contacts">
 +            <param name="wp-package" value="Contacts"/>
 +        </feature>
 +        <feature name="File">
 +            <param name="wp-package" value="File"/>
 +        </feature>
 +        <feature name="FileTransfer">
 +            <param name="wp-package" value="FileTransfer"/>
 +        </feature>
 +        <feature name="Geolocation">
 +            <param name="wp-package" value="Geolocation"/>
 +        </feature>
 +        <feature name="Media">
 +            <param name="wp-package" value="Media"/>
 +        </feature>
 +        <feature name="Capture">
 +            <param name="wp-package" value="Capture"/>
 +        </feature>
 +        <feature name="Battery">
 +            <param name="wp-package" value="Battery"/>
 +        </feature>
 +        <feature name="Globalization">
 +            <param name="wp-package" value="Globalization"/>
 +        </feature>
 +        <feature name="InAppBrowser">
 +            <param name="wp-package" value="InAppBrowser"/>
 +        </feature>
 +        <feature name="Notification">
 +            <param name="wp-package" value="Notification"/>
 +        </feature>
 +    </features>
  </widget>

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp7/template/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --cc wp7/template/cordovalib/ConfigHandler.cs
index 05829b5,fe646c7..cfdd007
--- a/wp7/template/cordovalib/ConfigHandler.cs
+++ b/wp7/template/cordovalib/ConfigHandler.cs
@@@ -83,7 -83,7 +83,7 @@@ namespace WPCordovaClassLib.CordovaLi
                  Uri uri = new Uri(origin.Replace("*", "replaced-text"), UriKind.Absolute);
  
                  string tempHostName = uri.Host.Replace("replaced-text", "*");
--                //if (uri.HostNameType == UriHostNameType.Dns){}        
++                //if (uri.HostNameType == UriHostNameType.Dns){}
                  // starts with wildcard match - we make the first '.' optional (so '*.org.apache.cordova'
will match 'org.apache.cordova')
                  if (tempHostName.StartsWith("*."))
                  {    //"(\\s{0}|*.)"
@@@ -107,15 -107,15 +107,15 @@@
  
          }
  
--        /**   
--         
++        /**
++
           An access request is granted for a given URI if there exists an item inside the
access-request list such that:
  
              - The URI's scheme component is the same as scheme; and
              - if subdomains is false or if the URI's host component is not a domain name
(as defined in [RFC1034]), the URI's host component is the same as host; or
              - if subdomains is true, the URI's host component is either the same as host,
or is a subdomain of host (as defined in [RFC1034]); and
              - the URI's port component is the same as port.
--         
++
           **/
  
          public bool URLIsAllowed(string url)
@@@ -181,10 -169,37 +181,33 @@@
  
          private void LoadPluginFeatures(XDocument document)
          {
 -<<<<<<< HEAD
+             var plugins = from results in document.Descendants("plugin")
+                           select new
+                           {
+                               name = (string)results.Attribute("name"),
+                               autoLoad = results.Attribute("onload")
+                           };
+ 
+             foreach (var plugin in plugins)
+             {
+                 Debug.WriteLine("Warning: Deprecated use of <plugin> by plugin : "
+ plugin.name);
+                 PluginConfig pConfig = new PluginConfig(plugin.name, plugin.autoLoad !=
null && plugin.autoLoad.Value == "true");
+                 if (pConfig.Name == "*")
+                 {
+                     AllowAllPlugins = true;
+                     // break; wait, don't, some still could be autoload
+                 }
+                 else
+                 {
+                     AllowedPlugins[pConfig.Name] = pConfig;
+                 }
+             }
+ 
              var features = from f in document.Descendants()
                             where f.Name.LocalName == "feature"
                             select f;
 ->>>>>>> 7944b67... [CB-4807] Handle config.xml namespaces
  
+ 
              foreach (var feature in features)
              {
                  var name = feature.Attribute("name");

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp8/template/config.xml
----------------------------------------------------------------------
diff --cc wp8/template/config.xml
index fd3a63f,d1ef04b..6377b34
--- a/wp8/template/config.xml
+++ b/wp8/template/config.xml
@@@ -20,53 -20,68 +20,54 @@@
  #
  -->
  <widget>
 +    <access origin="*"/>
  
 -  <features>
 -    <feature name="Device">
 -      <param name="wp-package" value="Device" onload="false"/>
 -    </feature>
 -    <feature name="Logger">
 -      <param name="wp-package" value="Logger"/>
 -    </feature>
 -    <feature name="Compass">
 -      <param name="wp-package" value="Compass" />
 -    </feature>
 -    <feature name="Accelerometer">
 -      <param name="wp-package" value="Accelerometer"/>
 -    </feature>
 -    <feature name="Camera">
 -      <param name="wp-package" value="Camera"/>
 -    </feature>
 -    <feature name="NetworkStatus">
 -      <param name="wp-package" value="NetworkStatus"/>
 -    </feature>
 -    <feature name="Contacts">
 -      <param name="wp-package" value="Contacts"/>
 -    </feature>
 -    <feature name="DebugConsole">
 -      <param name="wp-package" value="DebugConsole"/>
 -    </feature>
 -    <feature name="Echo">
 -      <param name="wp-package" value="Echo"/>
 -    </feature>
 -    <feature name="File">
 -      <param name="wp-package" value="File"/>
 -    </feature>
 -    <feature name="FileTransfer">
 -      <param name="wp-package" value="FileTransfer"/>
 -    </feature>
 -    <feature name="Geolocation">
 -      <param name="wp-package" value="Geolocation"/>
 -    </feature>
 -    <feature name="Media">
 -      <param name="wp-package" value="Media"/>
 -    </feature>
 -    <feature name="Capture">
 -      <param name="wp-package" value="Capture"/>
 -    </feature>
 -    <feature name="SplashScreen">
 -      <param name="wp-package" value="SplashScreen"/>
 -    </feature>
 -    <feature name="Battery">
 -      <param name="wp-package" value="Battery"/>
 -    </feature>
 -    <feature name="Globalization">
 -      <param name="wp-package" value="Globalization"/>
 -    </feature>
 -    <feature name="InAppBrowser">
 -      <param name="wp-package" value="InAppBrowser"/>
 -    </feature>
 -    <feature name="Notification">
 -      <param name="wp-package" value="Notification"/>
 -    </feature>
 -  </features>
 -
 -
 -  <access origin="*"/>
 +    <features>
 +        <feature name="Device">
 +            <param name="wp-package" value="Device" onload="false"/>
 +        </feature>
 +        <feature name="Compass">
 +            <param name="wp-package" value="Compass" />
 +        </feature>
 +        <feature name="Accelerometer">
 +            <param name="wp-package" value="Accelerometer"/>
 +        </feature>
 +        <feature name="Camera">
 +            <param name="wp-package" value="Camera"/>
 +        </feature>
 +        <feature name="NetworkStatus">
 +            <param name="wp-package" value="NetworkStatus"/>
 +        </feature>
 +        <feature name="Contacts">
 +            <param name="wp-package" value="Contacts"/>
 +        </feature>
 +        <feature name="File">
 +            <param name="wp-package" value="File"/>
 +        </feature>
 +        <feature name="FileTransfer">
 +            <param name="wp-package" value="FileTransfer"/>
 +        </feature>
 +        <feature name="Geolocation">
 +            <param name="wp-package" value="Geolocation"/>
 +        </feature>
 +        <feature name="Media">
 +            <param name="wp-package" value="Media"/>
 +        </feature>
 +        <feature name="Capture">
 +            <param name="wp-package" value="Capture"/>
 +        </feature>
 +        <feature name="Battery">
 +            <param name="wp-package" value="Battery"/>
 +        </feature>
 +        <feature name="Globalization">
 +            <param name="wp-package" value="Globalization"/>
 +        </feature>
 +        <feature name="InAppBrowser">
 +            <param name="wp-package" value="InAppBrowser"/>
 +        </feature>
 +        <feature name="Notification">
 +            <param name="wp-package" value="Notification"/>
 +        </feature>
 +    </features>
+ 
  </widget>

http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10af4e40/wp8/template/cordovalib/ConfigHandler.cs
----------------------------------------------------------------------
diff --cc wp8/template/cordovalib/ConfigHandler.cs
index fcb8665,f88510f..cfdd007
--- a/wp8/template/cordovalib/ConfigHandler.cs
+++ b/wp8/template/cordovalib/ConfigHandler.cs
@@@ -45,12 -45,12 +45,22 @@@ namespace WPCordovaClassLib.CordovaLi
              return Preferences[key];
          }
  
--        protected static string[] AllowedSchemes = { "http", "https", "ftp", "ftps" };
++        protected static string[] AllowedSchemes = {"http","https","ftp","ftps"};
          protected bool SchemeIsAllowed(string scheme)
          {
              return AllowedSchemes.Contains(scheme);
          }
  
++        protected string PathAndQuery(Uri uri)
++        {
++            string result = uri.LocalPath;
++            if (uri.Query.Length > 0)
++            {
++                result +=  uri.Query;
++            }
++            return result;
++        }
++
          protected void AddWhiteListEntry(string origin, bool allowSubdomains)
          {
  
@@@ -73,7 -73,7 +83,7 @@@
                  Uri uri = new Uri(origin.Replace("*", "replaced-text"), UriKind.Absolute);
  
                  string tempHostName = uri.Host.Replace("replaced-text", "*");
--                //if (uri.HostNameType == UriHostNameType.Dns){}        
++                //if (uri.HostNameType == UriHostNameType.Dns){}
                  // starts with wildcard match - we make the first '.' optional (so '*.org.apache.cordova'
will match 'org.apache.cordova')
                  if (tempHostName.StartsWith("*."))
                  {    //"(\\s{0}|*.)"
@@@ -83,9 -83,9 +93,10 @@@
                  {
                      hostName = tempHostName.Replace(".", @"\.").Replace("*", @"\w*");
                  }
++
                  //  "^https?://"
--                hostMatchingRegex = uri.Scheme + "://" + hostName + uri.PathAndQuery;
 -                Debug.WriteLine("Adding regex :: " + hostMatchingRegex);
++                hostMatchingRegex = uri.Scheme + "://" + hostName + PathAndQuery(uri);
 +                //Debug.WriteLine("Adding regex :: " + hostMatchingRegex);
                  AllowedDomains.Add(hostMatchingRegex);
  
              }
@@@ -96,35 -96,35 +107,35 @@@
  
          }
  
--        /**   
--         
++        /**
++
           An access request is granted for a given URI if there exists an item inside the
access-request list such that:
  
              - The URI's scheme component is the same as scheme; and
              - if subdomains is false or if the URI's host component is not a domain name
(as defined in [RFC1034]), the URI's host component is the same as host; or
              - if subdomains is true, the URI's host component is either the same as host,
or is a subdomain of host (as defined in [RFC1034]); and
              - the URI's port component is the same as port.
--         
++
           **/
  
          public bool URLIsAllowed(string url)
          {
              // easy case first
--            if (this.AllowAllDomains)
++            if (AllowAllDomains )
              {
                  return true;
              }
              else
              {
                  // start simple
--                Uri uri = new Uri(url, UriKind.RelativeOrAbsolute);
++                Uri uri = new Uri(url,UriKind.RelativeOrAbsolute);
                  if (uri.IsAbsoluteUri)
                  {
                      if (this.SchemeIsAllowed(uri.Scheme))
                      {
                          // additional test because our pattern will always have a trailing
'/'
                          string matchUrl = url;
--                        if (uri.PathAndQuery == "/")
++                        if (PathAndQuery(uri) == "/")
                          {
                              matchUrl = url + "/";
                          }
@@@ -134,8 -134,8 +145,8 @@@
                              {
                                  // make sure it is at the start, and not part of the query
string
                                  // special case :: http://some.other.domain/page.html?x=1&g=http://build.apache.org/
--                                if (Regex.IsMatch(uri.Scheme + "://" + uri.Host + "/", pattern)
||
--                                     (!Regex.IsMatch(uri.PathAndQuery, pattern)))
++                                if ( Regex.IsMatch(uri.Scheme + "://" +  uri.Host + "/",
pattern) ||
++                                     (!Regex.IsMatch(PathAndQuery(uri), pattern)))
                                  {
                                      return true;
                                  }
@@@ -151,11 -151,11 +162,6 @@@
              return false;
          }
  
--        public bool IsPluginAllowed(string key)
--        {
--            return AllowAllPlugins || AllowedPlugins.Keys.Contains(key);
--        }
--
          public string[] AutoloadPlugins
          {
              get
@@@ -168,11 -168,35 +174,39 @@@
              }
          }
  
 -        private void LoadPluginFeatures(XDocument document)
++        public bool IsPluginAllowed(string key)
+         {
++            return AllowAllPlugins || AllowedPlugins.Keys.Contains(key);
++        }
+ 
 -            var plugins = from results in document.Descendants()
 -                          where results.Name.LocalName == "plugin"
 -                          select results;
 -
 +        private void LoadPluginFeatures(XDocument document)
 +        {
-             var features = from feats in document.Descendants()
-                            where feats.Name.LocalName == "feature"
-                            select feats;
++            var plugins = from results in document.Descendants("plugin")
++                          select new
++                          {
++                              name = (string)results.Attribute("name"),
++                              autoLoad = results.Attribute("onload")
++                          };
+ 
+             foreach (var plugin in plugins)
+             {
 -                string name = (string)plugin.Attribute("name");
 -                var onload = plugin.Attribute("onload");
 -
 -                Debug.WriteLine("Warning: Deprecated use of <plugin> by plugin : "
+ name);
 -                PluginConfig pConfig = new PluginConfig(name, onload != null &&
onload.Value == "true");
++                Debug.WriteLine("Warning: Deprecated use of <plugin> by plugin : "
+ plugin.name);
++                PluginConfig pConfig = new PluginConfig(plugin.name, plugin.autoLoad !=
null && plugin.autoLoad.Value == "true");
+                 if (pConfig.Name == "*")
+                 {
+                     AllowAllPlugins = true;
+                     // break; wait, don't, some still could be autoload
+                 }
+                 else
+                 {
+                     AllowedPlugins[pConfig.Name] = pConfig;
+                 }
+             }
+ 
 -            var features = from feats in document.Descendants()
 -                           where feats.Name.LocalName == "feature"
 -                           select feats;
++            var features = from f in document.Descendants()
++                           where f.Name.LocalName == "feature"
++                           select f;
++
  
              foreach (var feature in features)
              {
@@@ -182,12 -206,12 +216,12 @@@
                               select results;
  
                  var value = values.FirstOrDefault();
--                if(value != null)
++                if (value != null)
                  {
                      string key = (string)value.Attribute("value");
                      Debug.WriteLine("Adding feature.value=" + key);
                      var onload = value.Attribute("onload");
--                    PluginConfig pConfig = new PluginConfig(key,onload != null &&
onload.Value == "true");
++                    PluginConfig pConfig = new PluginConfig(key, onload != null &&
onload.Value == "true");
                      AllowedPlugins[key] = pConfig;
                  }
              }
@@@ -233,8 -257,8 +267,8 @@@
                  }
  
                  var contentsTag = (from results in document.Descendants()
--                                   where results.Name.LocalName == "content"
--                                   select results).FirstOrDefault();
++                                  where results.Name.LocalName == "content"
++                                  select results).FirstOrDefault();
  
                  if (contentsTag != null)
                  {


Mime
View raw message