You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/04/23 00:51:57 UTC
[1/3] git commit: Background color now applied to windows 8 project
config during build process. * Added logic to convert hexadecimal color to
windows 8 specific format
Repository: cordova-windows
Updated Branches:
refs/heads/master ded254b73 -> 079ea13e6
Background color now applied to windows 8 project config during build process.
* Added logic to convert hexadecimal color to windows 8 specific format
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/df7bf776
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/df7bf776
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/df7bf776
Branch: refs/heads/master
Commit: df7bf7760100ce27b02fa2f1315d1c47603b5e17
Parents: 3fed2e8
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Fri Apr 18 17:22:56 2014 +0400
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Fri Apr 18 18:33:16 2014 +0400
----------------------------------------------------------------------
.../cordova/lib/ApplyPlatformConfig.ps1 | 29 ++++++++++++++++++++
1 file changed, 29 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/df7bf776/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
----------------------------------------------------------------------
diff --git a/windows8/template/cordova/lib/ApplyPlatformConfig.ps1 b/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
index 10f0e4b..56aa4a2 100644
--- a/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
+++ b/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
@@ -33,11 +33,13 @@ $startPage = $config.widget.content.src
$manifest.Package.Applications.Application.StartPage = "www/$startpage"
# Add domain whitelist rules
+
$acls = [string[]]$config.widget.access.origin
$rules = $manifest.Package.Applications.Application.ApplicationContentUriRules
$NS = $manifest.DocumentElement.NamespaceURI
# Remove existing rules from manifest
+
if ($rules) { $manifest.Package.Applications.Application.RemoveChild($rules)}
if ($acls -and ($acls -notcontains "*")) {
@@ -51,6 +53,33 @@ if ($acls -and ($acls -notcontains "*")) {
}
}
+# Format background color to windows8 format
+
+$configBgColor = [string]$config.widget.preference.value
+$bgColor = ($configBgColor -replace "0x", "") -replace "#", ""
+
+# Double all bytes if color specified as "fff"
+if ($bgColor.Length -eq 3) {
+ $bgColor = $bgColor[0] + $bgColor[0] + $bgColor[1] + $bgColor[1] + $bgColor[2] + $bgColor[2]
+}
+
+# Parse hex representation to array of color bytes [b, g, r, a]
+$colorBytes = [System.BitConverter]::GetBytes(
+ [int]::Parse($bgColor,
+ [System.Globalization.NumberStyles]::HexNumber))
+
+Add-Type -AssemblyName PresentationCore
+
+# Create new Color object ignoring alpha, because windows 8 doesn't support it
+# see http://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx
+$color = ([System.Windows.Media.Color]::FromRgb(
+ $colorBytes[2], $colorBytes[1], $colorBytes[0]
+ # FromRGB method add 100% alpha, so we remove it from resulting string
+ ).ToString()) -replace "#FF", "#"
+
+$manifest.Package.Applications.Application.VisualElements.BackgroundColor = [string]$color
+
+# Write modified manifest file
$xmlWriter = New-Object System.Xml.XmlTextWriter($manifestFile, $null)
$xmlWriter.Formatting = "Indented"
$xmlWriter.Indentation = 4
[2/3] git commit: Merge branch 'CB-6267' of
https://github.com/MSOpenTech/cordova-windows
Posted by pu...@apache.org.
Merge branch 'CB-6267' of https://github.com/MSOpenTech/cordova-windows
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/0c3c16fd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/0c3c16fd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/0c3c16fd
Branch: refs/heads/master
Commit: 0c3c16fdef06386cd7f2f5ad160af5810f9a4c38
Parents: ded254b df7bf77
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Apr 22 13:02:01 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Apr 22 13:02:01 2014 -0700
----------------------------------------------------------------------
.../cordova/lib/ApplyPlatformConfig.ps1 | 29 ++++++++++++++++++++
1 file changed, 29 insertions(+)
----------------------------------------------------------------------
[3/3] git commit: Fix for when background-color and/or content-src
aren't specified in config.xml
Posted by pu...@apache.org.
Fix for when background-color and/or content-src aren't specified in config.xml
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/079ea13e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/079ea13e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/079ea13e
Branch: refs/heads/master
Commit: 079ea13e6d6c3f24652571fa788c6f2b6c1a5f16
Parents: 0c3c16f
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Apr 22 15:40:11 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Apr 22 15:40:11 2014 -0700
----------------------------------------------------------------------
.../cordova/lib/ApplyPlatformConfig.ps1 | 56 +++++++++++---------
1 file changed, 31 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/079ea13e/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
----------------------------------------------------------------------
diff --git a/windows8/template/cordova/lib/ApplyPlatformConfig.ps1 b/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
index 56aa4a2..a0229b4 100644
--- a/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
+++ b/windows8/template/cordova/lib/ApplyPlatformConfig.ps1
@@ -29,8 +29,10 @@ $manifestFile = "$platformRoot\package.appxmanifest"
[xml]$manifest = Get-Content $manifestFile
# Replace app start page with config.xml setting.
-$startPage = $config.widget.content.src
-$manifest.Package.Applications.Application.StartPage = "www/$startpage"
+if($config.widget.content -and $config.widget.content.src) {
+ $startPage = $config.widget.content.src
+ $manifest.Package.Applications.Application.StartPage = "www/$startpage"
+}
# Add domain whitelist rules
@@ -40,7 +42,9 @@ $NS = $manifest.DocumentElement.NamespaceURI
# Remove existing rules from manifest
-if ($rules) { $manifest.Package.Applications.Application.RemoveChild($rules)}
+if ($rules) {
+ $manifest.Package.Applications.Application.RemoveChild($rules)
+}
if ($acls -and ($acls -notcontains "*")) {
$rules = $manifest.CreateElement("ApplicationContentUriRules", $NS)
@@ -54,31 +58,33 @@ if ($acls -and ($acls -notcontains "*")) {
}
# Format background color to windows8 format
-
$configBgColor = [string]$config.widget.preference.value
-$bgColor = ($configBgColor -replace "0x", "") -replace "#", ""
-
-# Double all bytes if color specified as "fff"
-if ($bgColor.Length -eq 3) {
- $bgColor = $bgColor[0] + $bgColor[0] + $bgColor[1] + $bgColor[1] + $bgColor[2] + $bgColor[2]
+if($configBgColor.Length > 0)
+{
+ $bgColor = ($configBgColor -replace "0x", "") -replace "#", ""
+
+ # Double all bytes if color specified as "fff"
+ if ($bgColor.Length -eq 3) {
+ $bgColor = $bgColor[0] + $bgColor[0] + $bgColor[1] + $bgColor[1] + $bgColor[2] + $bgColor[2]
+ }
+
+ # Parse hex representation to array of color bytes [b, g, r, a]
+ $colorBytes = [System.BitConverter]::GetBytes(
+ [int]::Parse($bgColor,
+ [System.Globalization.NumberStyles]::HexNumber))
+
+ Add-Type -AssemblyName PresentationCore
+
+ # Create new Color object ignoring alpha, because windows 8 doesn't support it
+ # see http://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx
+ $color = ([System.Windows.Media.Color]::FromRgb(
+ $colorBytes[2], $colorBytes[1], $colorBytes[0]
+ # FromRGB method add 100% alpha, so we remove it from resulting string
+ ).ToString()) -replace "#FF", "#"
+
+ $manifest.Package.Applications.Application.VisualElements.BackgroundColor = [string]$color
}
-# Parse hex representation to array of color bytes [b, g, r, a]
-$colorBytes = [System.BitConverter]::GetBytes(
- [int]::Parse($bgColor,
- [System.Globalization.NumberStyles]::HexNumber))
-
-Add-Type -AssemblyName PresentationCore
-
-# Create new Color object ignoring alpha, because windows 8 doesn't support it
-# see http://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx
-$color = ([System.Windows.Media.Color]::FromRgb(
- $colorBytes[2], $colorBytes[1], $colorBytes[0]
- # FromRGB method add 100% alpha, so we remove it from resulting string
- ).ToString()) -replace "#FF", "#"
-
-$manifest.Package.Applications.Application.VisualElements.BackgroundColor = [string]$color
-
# Write modified manifest file
$xmlWriter = New-Object System.Xml.XmlTextWriter($manifestFile, $null)
$xmlWriter.Formatting = "Indented"