[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

2015-02-20 Thread sgrebnov
Github user sgrebnov commented on the pull request:

https://github.com/apache/cordova-wp8/pull/76#issuecomment-75211406
  
LGTM, propose to move config parsing logic to separate file/class similar 
to how this is done on windows

https://github.com/apache/cordova-windows/blob/master/template/cordova/lib/ConfigParser.js


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-windows pull request: CB-8515 Support DefaultLanguage sele...

2015-02-20 Thread sgrebnov
Github user sgrebnov commented on a diff in the pull request:

https://github.com/apache/cordova-windows/pull/59#discussion_r25058822
  
--- Diff: template/cordova/lib/prepare.js ---
@@ -40,14 +40,37 @@ module.exports.applyPlatformConfig = function () {
 return false;
 });
 
+// Apply appxmanifest changes
 ['package.windows.appxmanifest', 'package.windows80.appxmanifest', 
'package.phone.appxmanifest'].forEach(
 function(manifestFile) {
 updateManifestFile(config, path.join(ROOT, manifestFile));
 });
 
+// Apply jsproj changes
+['CordovaApp.Phone.jsproj', 'CordovaApp.Windows.jsproj', 
'CordovaApp.Windows80.jsproj'].forEach(
+function(jsprojFile) {
+updatejsprojFile(config, path.join(ROOT, jsprojFile));
+});
+
 copyImages(config);
 };
 
+function updatejsprojFile(config, jsProjFilePath) {
+var defaultLocale = config.defaultLocale();
+
+if (defaultLocale) {
--- End diff --

I think we should remove or set to default DefaultLanguage in case there is 
no config.defaultLocale().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-medic pull request: CB-8508 Android scripts rework, config...

2015-02-20 Thread sgrebnov
Github user sgrebnov commented on the pull request:

https://github.com/apache/cordova-medic/pull/33#issuecomment-75212956
  
merged, @alsorokin please close PR (I've misspelled github directive in 
commit message to close it automatically)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-medic pull request: CB-8508 Android scripts rework, config...

2015-02-20 Thread alsorokin
Github user alsorokin closed the pull request at:

https://github.com/apache/cordova-medic/pull/33


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-ios pull request: CB-8084 conform AppDelegate.m with provi...

2015-02-20 Thread Mitko-Kerezov
Github user Mitko-Kerezov commented on the pull request:

https://github.com/apache/cordova-ios/pull/128#issuecomment-75227834
  
Issue was fixed with 
https://github.com/apache/cordova-ios/commit/8dcc9dd626c523e6e217dd7e8ce43d0af849fa3a
So I'm closing this now


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-ios pull request: CB-8084 conform AppDelegate.m with provi...

2015-02-20 Thread Mitko-Kerezov
Github user Mitko-Kerezov closed the pull request at:

https://github.com/apache/cordova-ios/pull/128


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-windows pull request: CB-8515 Support DefaultLanguage sele...

2015-02-20 Thread muratsu
Github user muratsu commented on the pull request:

https://github.com/apache/cordova-windows/pull/59#issuecomment-75235633
  
if no locale is not found it uses the current default language which is 
en-us. Since that is already hardcoded in proj files I'm not re-setting it. 
removing might have some side effects.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-windows pull request: CB-8515 Support DefaultLanguage sele...

2015-02-20 Thread sgrebnov
Github user sgrebnov commented on the pull request:

https://github.com/apache/cordova-windows/pull/59#issuecomment-75238727
  
I meant if you changed locale in config.xml and then removed this settings 
it will continue pointing to the wrong previously used locale, not the default 
one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-windows pull request: CB-8515 Support DefaultLanguage sele...

2015-02-20 Thread sgrebnov
Github user sgrebnov commented on the pull request:

https://github.com/apache/cordova-windows/pull/59#issuecomment-75238948
  
May be just use something like this
var defaultLocale = config.defaultLocale() || 'en-us';


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-windows pull request: CB-8515 Support DefaultLanguage sele...

2015-02-20 Thread sgrebnov
Github user sgrebnov commented on the pull request:

https://github.com/apache/cordova-windows/pull/59#issuecomment-75239086
  
But this is minor, so I'm +1 merging this. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



RE: Proposal for CSP support

2015-02-20 Thread Chuck Lantz
Hey Jason - Glad to see this proposal!  A number of us at Microsoft have been 
talking along these same lines actually. Windows 10 apps will include CSP 
support as the latest version of IE has support so I'd say we're completely in 
support of moving Cordova apps down this path.  In fact I'd want to make sure 
that any CSP related metadata tag injection also applied to the Windows 
platform as well.  

A few of thoughts:

1. I definitely know there is quite a bit of interest still in being able to 
enable hosted (https accessed and controlled by the developer) app content 
access Cordova device APIs (which is currently a shortcoming of Windows 8.0/8.1 
apps so we hear about it quite a bit).  As a result, we'll want to be sure 
Cordova doesn't inhibit this use case at a base level.  That said, having a 
default CSP policy that restricts hosted in the template is fine and would 
promote secure practices since you need to exercise caution when mixing in any 
remote content even when you control it completely.  Also agree with inline 
being high risk.

2. Re: Long term, one thing that CSP doesn't cover well is which URIs should be 
granted elevated device access. Given hosted content with plugin device API 
access is still a scenario we'll need to consider, perhaps we should consider 
using the config.xml  element to represent URIs that have device API 
access (beyond standard browser access).  Otherwise we get into a bit of an 
"all or nothing" situation as it pertains to hosted app content which poses a 
larger security risk if you opt to extend device API access beyond local 
content. (It also strikes me this is a general gap in the web standard as a 
whole.)

3. Eval is actually a bit tougher - I know when we've look at this in the past 
it impacted JS frameworks far more than inline did.  (Ex: With Angular you can 
stop using eval but you take a perf hit which is a bigger deal on mobile than 
desktop.)  Definitely the most secure practice - but it also could cause the 
default template to appear to "not work."  If we omit the "unsafe-eval" 
directive in the CSP policy in the template we'll want to be crystal clear on 
how to alter it.  That could be solved with proper documentation and blog posts 
though.

4. I'd suggest we also consider the new "browser" platform here since 
Chrome/Firefox/IE (as of Win 10) have support. Should be "free", but I'm 
guessing the metadata tag injection you mention is something we could probably 
just do all-up rather than only for specific platforms.

-Chuck

-Original Message-
From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal Mocny
Sent: Thursday, February 19, 2015 2:25 PM
To: dev
Subject: Re: Proposal for CSP support

Thanks for this clear outline.

Jason, I know you've been working on the short-term items for a while as part 
of your investigation, fixing things as you went -- what is the current state 
of CSP support in platforms / plugins?  What portion already has fixes (or PR 
for them), what work is known but undone, and what hasn't been investigated 
much at all?

-Michal

On Thu, Feb 19, 2015 at 4:55 PM, Jason Chase  wrote:

> I'm interested in full-blown support for CSP (Content Security Policy) 
> in Cordova.  While we're close to having new and improved whitelist 
> functionality, there are gaps in what the whitelist is able to protect 
> against. In particular, inline script and eval() are higher risks that 
> are not addressed by whitelists.
>
> Many Cordova apps may use only static content, or not include any 
> third-party content.  However, there are certainly examples of apps 
> that need to include user input/third-party content, mixed with the 
> app's own HTML content.  In some cases, platforms may even restrict 
> functionality (see [1]). I think CSP is a compelling answer for these 
> scenarios, and for security in general for apps.
>
> Assuming CSP support is valuable, the question is how to implement?
> Support for CSP is not universal across platforms.  It is known to be 
> supported on Android (KitKat and later), iOS (since 7.1), and Firefox.
> Where supported, it is typically via a HTTP response header, or a META 
> tag in the document.
>
> I've done some investigation into feasible approaches.  As a result, 
> I'm proposing as below.
>
> Long term goal:
> Cordova supports CSP in apps *and* plugins, and is enabled/secure by 
> default.  Ideally, CSP rules can be configurable and automatically 
> applied to all content (i.e. so developers can fall into the pit of 
> success)
>
> Achieving this goal will likely require incremental progress over a 
> number of releases.  At a high level, first make changes so developers 
> can manually apply CSP to their apps.  Longer term, add support for 
> configurability and automatic application of CSP.
>
> Short term plan:
> - Change new app template to contain CSP meta tag with a default, 
> secure policy (i.e. no inline script, eval(), only local app content)
> - Remove any blo

[GitHub] cordova-plugin-camera pull request: Fix issue where android cordov...

2015-02-20 Thread thehuijb
GitHub user thehuijb opened a pull request:

https://github.com/apache/cordova-plugin-camera/pull/65

Fix issue where android cordova app crashes on selecting images from dropbox

Cordova android apps would crash if you picked an image from a remote 
system e.g. Drive, OneDrive, Mega, Dropbox.

this pull request addresses that issue and also makes for more generic 
error messages, easier to handle in the callback method.
furthermore I added an option to getImages from only a dedicated gallery 
type app so if you want the user to specifically get pictures from the gallery 
`onlyGalleries` you can now enforce this.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/thehuijb/cordova-plugin-camera master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-plugin-camera/pull/65.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #65


commit 2df903ae611e1961968e85f75d0fe56c9ee11371
Author: Serge Huijben 
Date:   2015-02-19T23:32:31Z

more distinguishable error messages
enable dropbox images (won't crash the app anymore)
option to choose only from gallery apps, to stop people from introducing 
new problems

commit 0b3a9670f3202993cc510d307ee871c7137cd434
Author: Serge Huijben 
Date:   2015-02-19T23:40:22Z

Merge pull request #1 from 
thehuijb/feature/android-stop-crashes-when-selecting-dropbox-image

more distinguishable error messages

commit 4636cbe2565406a36e4165662ba445c72bec1940
Author: Serge Huijben 
Date:   2015-02-20T09:07:21Z

add doc for added property onlyGalleries

commit b28651c9cf5e0d33c2f0ca5ad9183da21e993e80
Author: Serge Huijben 
Date:   2015-02-20T15:05:10Z

Merge pull request #2 from 
thehuijb/feature/android-stop-crashes-when-selecting-dropbox-image

add doc for added property onlyGalleries

commit 8176ba3160ee2d5860c9adcace2dcfc4eb4c0806
Author: Serge Huijben 
Date:   2015-02-20T15:58:50Z

edit index.md

commit e2d62bc24bdcf52f96ea924e65c9bed94cb5
Author: Serge Huijben 
Date:   2015-02-20T15:59:26Z

Merge pull request #3 from 
thehuijb/feature/android-stop-crashes-when-selecting-dropbox-image

edit index.md




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

2015-02-20 Thread dariosalviwork
Github user dariosalviwork commented on the pull request:

https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-75285312
  
Did not work on my tests unfortunately.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread omefire
GitHub user omefire opened a pull request:

https://github.com/apache/cordova-lib/pull/170

CB-8499 `cordova platform save` should save all currently installed 
platforms and their versions/git-url/folder-location into config.xml.

CB-8499 `cordova platform save` should save all currently installed 
platforms and their versions/git-url/folder-location into config.xml.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-lib CB-8499

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/170.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #170


commit 6dac55f9995a0abd847051ba1ae1eeac2384362f
Author: Omar Mefire 
Date:   2015-02-18T19:15:53Z

CB-8499 When adding a platform, capture version/folder/url being added to 
allow us to be able to save all installed platforms and their versions later on 
by doing 'cordova platform save'

commit 0063dfeeceef675bba072bc95e0add07d30a4326
Author: Omar Mefire 
Date:   2015-02-18T20:21:12Z

CB-8499 When deleting a platform, remove it from platforms.json

commit c440aac71cb3eee5226cbe7f57ecb09e8a1315cb
Author: Omar Mefire 
Date:   2015-02-18T21:59:18Z

CB-8499 `cordova platform save`: save installed platforms and their
sources (versions/git_urls/folders) into config.xml




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB 8520 - Simple fix for extra args ...

2015-02-20 Thread nikhilkh
GitHub user nikhilkh opened a pull request:

https://github.com/apache/cordova-android/pull/159

CB 8520 - Simple fix for extra args being added twice for build command 



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-android CB-8520

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-android/pull/159.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #159


commit 82febe17b93c99aafe6bd12d6862431210b467d0
Author: Nikhil Khandelwal 
Date:   2015-02-20T18:41:08Z

CB-8520 Fix for extra args being added twice for build command




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-windows pull request: CB-8515 Support DefaultLanguage sele...

2015-02-20 Thread muratsu
Github user muratsu commented on the pull request:

https://github.com/apache/cordova-windows/pull/59#issuecomment-75298546
  
I'll fix the default locale to en-US. When a defaultlocale is not present 
we should set it to en-US. Good catch!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread omefire
Github user omefire commented on the pull request:

https://github.com/apache/cordova-lib/pull/170#issuecomment-75298325
  
@agrieve , @vladimir-kotikov  and @gorkem, please review.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25095035
  
--- Diff: cordova-lib/src/cordova/platform.js ---
@@ -158,6 +160,11 @@ function addHelper(cmd, hooksRunner, projectRoot, 
targets, opts) {
 return installPluginsForNewPlatform(platform, 
projectRoot, cfg, opts);
 }
 }).then(function() {
+// Save platform@version into platforms.json. i.e: 
'android@https://github.com/apache/cordova-android.git'
+// If no version was specified, save the edge version
+var versionToSave = version ? version : 
platforms[platform].version;
--- End diff --

just a nitpick - there is no need for ternary operator, `version || 
platforms[platform].version` will work the same way


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25095044
  
--- Diff: cordova-lib/src/cordova/platform.js ---
@@ -174,6 +181,24 @@ function addHelper(cmd, hooksRunner, projectRoot, 
targets, opts) {
 });
 }
 
+function save(hooksRunner, projectRoot, opts) {
+var xml = cordova_util.projectConfig(projectRoot);
+var cfg = new ConfigParser(xml);
+
+// First, remove all platforms that are already in config.xml
+cfg.getEngines().map(function(engine){
+cfg.removeEngine();
+});
+
+// Save installed platforms into config.xml
+return 
platformMetadata.getPlatformVersions(projectRoot).then(function(platformVersions){
+platformVersions.map(function(platVer){
--- End diff --

`map` vs `forEach` again


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25095040
  
--- Diff: cordova-lib/src/cordova/platform.js ---
@@ -174,6 +181,24 @@ function addHelper(cmd, hooksRunner, projectRoot, 
targets, opts) {
 });
 }
 
+function save(hooksRunner, projectRoot, opts) {
+var xml = cordova_util.projectConfig(projectRoot);
+var cfg = new ConfigParser(xml);
+
+// First, remove all platforms that are already in config.xml
+cfg.getEngines().map(function(engine){
+cfg.removeEngine();
--- End diff --

Something strange here. `removeEngine` requires an engine Id param 
(https://github.com/apache/cordova-lib/blob/master/cordova-lib/src/configparser/ConfigParser.js#L404).
 Probably should be `cfg.removeEngine(engine.id);` instead.
Also `forEach` IMHO is more appropriate here than `map` here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25095419
  
--- Diff: cordova-lib/src/cordova/platform_metadata.js ---
@@ -0,0 +1,113 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+*/
+
+
+var path = require('path'),
+cordova_util = require('./util'),
+fs   = require('fs'),
+Q= require('q'),
+shelljs  = require('shelljs'),
+events   = require('../events');
+
+
+// Retrieves the platforms and their versions from the platforms.json file
+// Returns an array of {platform: platform, version: version} ...
+// ... where version could be '3.4.0', '/path/to/platform' or 'git://...'
+function getVersions(projectRoot) {
+var platformsDir = path.join(projectRoot, 'platforms');
+var platformsJsonFile = path.join(platformsDir, 'platforms.json');
+
+// If the platforms.json file doesn't exist, retrieve versions 
installed
+// In this case, we won't be able to know what source the platform 
came from
+return Q.nfcall(fs.exists, platformsJsonFile).then(function(exists){
+if(exists){
+return getPlatVersionsFromFile(platformsJsonFile);
+}
+return getPlatVersionsFromFileSystem(projectRoot);
+});
+}
+
+// Returns a promise
+function getPlatVersionsFromFile(platformsJsonFile){
+var platformData = getJson(platformsJsonFile);
--- End diff --

You may want to require JSON file directly: `var platformData = 
require(platformsJsonFile);`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25096417
  
--- Diff: cordova-lib/src/cordova/platform_metadata.js ---
@@ -0,0 +1,113 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+*/
+
+
+var path = require('path'),
+cordova_util = require('./util'),
+fs   = require('fs'),
+Q= require('q'),
+shelljs  = require('shelljs'),
+events   = require('../events');
+
+
+// Retrieves the platforms and their versions from the platforms.json file
+// Returns an array of {platform: platform, version: version} ...
+// ... where version could be '3.4.0', '/path/to/platform' or 'git://...'
+function getVersions(projectRoot) {
+var platformsDir = path.join(projectRoot, 'platforms');
+var platformsJsonFile = path.join(platformsDir, 'platforms.json');
+
+// If the platforms.json file doesn't exist, retrieve versions 
installed
+// In this case, we won't be able to know what source the platform 
came from
+return Q.nfcall(fs.exists, platformsJsonFile).then(function(exists){
--- End diff --

Due to 
[nodejs.org/api/fs.html](nodejs.org/api/fs.html#fs_fs_exists_path_callback)
> fs.exists() is an anachronism and exists only for historical reasons. 
There should almost never be a reason to use it in your own code.

Probably it is better to replace this with something like this:
```
return getPlatVersionsFromFile(platformsJsonFile)
.fail(function () {
return getPlatVersionsFromFileSystem(projectRoot);
});
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25096560
  
--- Diff: cordova-lib/src/cordova/platform_metadata.js ---
@@ -0,0 +1,113 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+*/
+
+
+var path = require('path'),
+cordova_util = require('./util'),
+fs   = require('fs'),
+Q= require('q'),
+shelljs  = require('shelljs'),
+events   = require('../events');
+
+
+// Retrieves the platforms and their versions from the platforms.json file
+// Returns an array of {platform: platform, version: version} ...
+// ... where version could be '3.4.0', '/path/to/platform' or 'git://...'
+function getVersions(projectRoot) {
+var platformsDir = path.join(projectRoot, 'platforms');
+var platformsJsonFile = path.join(platformsDir, 'platforms.json');
+
+// If the platforms.json file doesn't exist, retrieve versions 
installed
+// In this case, we won't be able to know what source the platform 
came from
+return Q.nfcall(fs.exists, platformsJsonFile).then(function(exists){
+if(exists){
+return getPlatVersionsFromFile(platformsJsonFile);
+}
+return getPlatVersionsFromFileSystem(projectRoot);
+});
+}
+
+// Returns a promise
+function getPlatVersionsFromFile(platformsJsonFile){
+var platformData = getJson(platformsJsonFile);
+var platformVersions = [];
+
+platformVersions = Object.keys(platformData).map(function(p){
+return {platform: p, version: platformData[p]};
+});
+
+return Q(platformVersions);
+}
+
+// Returns a promise
+function getPlatVersionsFromFileSystem(projectRoot){
+var platformVersions = [];
+var platforms_on_fs = cordova_util.listPlatforms(projectRoot);
+platforms_on_fs.map(function(platform){
--- End diff --

`map` vs `forEach` again


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-firefoxos pull request: CB-7567 Don't use adm-zip because ...

2015-02-20 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-firefoxos/pull/22


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

2015-02-20 Thread muratsu
Github user muratsu commented on the pull request:

https://github.com/apache/cordova-wp8/pull/76#issuecomment-75305949
  
We actually don't want to merge this right now. Let's hold on until I 
review how winpho8 locale works.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-windows pull request: CB-8515 Support DefaultLanguage sele...

2015-02-20 Thread nikhilkh
Github user nikhilkh commented on the pull request:

https://github.com/apache/cordova-windows/pull/59#issuecomment-75305927
  
This looks good! @sgrebnov Can you please help merge this one? It will be 
good to have this in the next cordova-windows release.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



RE: [GitHub] cordova-firefoxos pull request: CB-7567 Don't use adm-zip because

2015-02-20 Thread Jon Buckley
Hello Apache Cordova devs! I've submitted a patch (
https://github.com/apache/cordova-firefoxos/pull/22 ) to fix
https://issues.apache.org/jira/browse/CB-7567 . I've emailed my ICLA in,
so I'm wondering what the next step is? Could I get a review from
someone?

Thanks, Jon

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Log solution on Cordova Apps

2015-02-20 Thread Wellington Queiroz, Fabio
Hello Guys,

I'm working on a Cordova project and we are implementing a Log Mechanism that 
writes all messages sent to our javascript API on a file persisted on the 
device file system.
It works on Android and iOS, but we did not find out a solution to retrieve the 
generated log file from iOS file system.

Are we going through the write solution (create a log file on mobile 
platforms)? If not how is the recommended solution?

Is it possible to retrieve a file from iOS without jailbreak workaround?

Thanks very much!

Fabio Queiroz
___

GFT Brasil Consultoria Informática Ltda.
Av. Sao Francisco, 98
18.095-450 Sorocaba, Brasil

T  +55 15 3332 9705
F
fabio.quei...@gft.com
www.gft.com/br
www.gft-blog.com.br
www.twitter.com/gft_br



[GitHub] cordova-wp8 pull request: CB-8516 Support DefaultLanguage selectio...

2015-02-20 Thread nikhilkh
Github user nikhilkh commented on a diff in the pull request:

https://github.com/apache/cordova-wp8/pull/76#discussion_r25098154
  
--- Diff: template/cordova/lib/build.js ---
@@ -68,6 +70,40 @@ module.exports.run = function (argv) {
 }
 
 return parseAndValidateArgs(argv)
+.then(function(buildopts) {
+var csProjFilePath = shell.ls(path.join(ROOT, '*.csproj'))[0];
+var WMAppManifestFilePath = path.join(ROOT, 'Properties', 
'WMAppManifest.xml');
+var AssemblyInfoFilePath = path.join(ROOT, 'Properties', 
'AssemblyInfo.cs');
+var configFilePath = path.join(ROOT, '..', '..', 'config.xml');
+
+var configContents = removeBOM(fs.readFileSync(configFilePath, 
'utf-8'));
+var configXML =  new et.ElementTree(et.XML(configContents));
+var defaultLocale = configXML.getroot().attrib['defaultlocale'] || 
'en-US';
+
+// Change locale on csproj file
+var csProjContents = removeBOM(fs.readFileSync(csProjFilePath, 
'utf-8'));
+var csProjXML =  new et.ElementTree(et.XML(csProjContents));
+var csProjDefaultLocale = 
csProjXML.find('./PropertyGroup/SupportedCultures');
+csProjDefaultLocale.text = defaultLocale;
+fs.writeFileSync(csProjFilePath, csProjXML.write({indent: 2}), 
'utf-8');
+
+// Change locale on WMAppManifest file
+var WMAppManifestContents = 
removeBOM(fs.readFileSync(WMAppManifestFilePath, 'utf-8'));
+var WMAppManifestXML =  new 
et.ElementTree(et.XML(WMAppManifestContents));
+var WMAppManifestLanguages = 
WMAppManifestXML.find('./Languages/Language');
+WMAppManifestLanguages.set('code', defaultLocale);
+var WMAppManifestDefaultLanguage = 
WMAppManifestXML.find('./DefaultLanguage');
+WMAppManifestDefaultLanguage.set('code', defaultLocale);
+fs.writeFileSync(WMAppManifestFilePath, 
WMAppManifestXML.write({indent: 2}), 'utf-8');
+
+// Change locale on AssemblyInfo file
+var AssemblyInfoContents = 
removeBOM(fs.readFileSync(AssemblyInfoFilePath, 'utf-8'));
+AssemblyInfoContents = AssemblyInfoContents.replace(/[\w\[: 
]+NeutralResourcesLanguageAttribute\("[\w\-]+"\)]/,
--- End diff --

Changing the NeutralResourceLanguageAttribute does not look like the 
correct thing to do here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: Log solution on Cordova Apps

2015-02-20 Thread Kerri Shotts
Fabio,

This mailing list is about Cordova Development; it isn’t intended for user 
support. Please ask on the Google Group or Stack Overflow.

~Kerri




From: Wellington Queiroz, Fabio 
Reply: dev@cordova.apache.org >
Date: February 20, 2015 at 1:47:57 PM
To: dev@cordova.apache.org >
Cc: Gayard, Leonel >, Marques, Andre 
>
Subject:  Log solution on Cordova Apps  

Hello Guys,  

I'm working on a Cordova project and we are implementing a Log Mechanism that 
writes all messages sent to our javascript API on a file persisted on the 
device file system.  
It works on Android and iOS, but we did not find out a solution to retrieve the 
generated log file from iOS file system.  

Are we going through the write solution (create a log file on mobile 
platforms)? If not how is the recommended solution?  

Is it possible to retrieve a file from iOS without jailbreak workaround?  

Thanks very much!  

Fabio Queiroz  
___  

GFT Brasil Consultoria Informática Ltda.  
Av. Sao Francisco, 98  
18.095-450 Sorocaba, Brasil  

T +55 15 3332 9705  
F  
fabio.quei...@gft.com  
www.gft.com/br  
www.gft-blog.com.br  
www.twitter.com/gft_br  



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25098780
  
--- Diff: cordova-lib/src/cordova/platform_metadata.js ---
@@ -0,0 +1,113 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+*/
+
+
+var path = require('path'),
+cordova_util = require('./util'),
+fs   = require('fs'),
+Q= require('q'),
+shelljs  = require('shelljs'),
+events   = require('../events');
+
+
+// Retrieves the platforms and their versions from the platforms.json file
+// Returns an array of {platform: platform, version: version} ...
+// ... where version could be '3.4.0', '/path/to/platform' or 'git://...'
+function getVersions(projectRoot) {
+var platformsDir = path.join(projectRoot, 'platforms');
+var platformsJsonFile = path.join(platformsDir, 'platforms.json');
+
+// If the platforms.json file doesn't exist, retrieve versions 
installed
+// In this case, we won't be able to know what source the platform 
came from
+return Q.nfcall(fs.exists, platformsJsonFile).then(function(exists){
--- End diff --

@vladimir-kotikov , getting a 404 on the link. anyway, thanks for the 
suggestion, modifying accordingly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25098622
  
--- Diff: cordova-lib/src/cordova/platform_metadata.js ---
@@ -0,0 +1,113 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+*/
+
+
+var path = require('path'),
+cordova_util = require('./util'),
+fs   = require('fs'),
+Q= require('q'),
+shelljs  = require('shelljs'),
+events   = require('../events');
+
+
+// Retrieves the platforms and their versions from the platforms.json file
+// Returns an array of {platform: platform, version: version} ...
+// ... where version could be '3.4.0', '/path/to/platform' or 'git://...'
+function getVersions(projectRoot) {
+var platformsDir = path.join(projectRoot, 'platforms');
+var platformsJsonFile = path.join(platformsDir, 'platforms.json');
+
+// If the platforms.json file doesn't exist, retrieve versions 
installed
+// In this case, we won't be able to know what source the platform 
came from
+return Q.nfcall(fs.exists, platformsJsonFile).then(function(exists){
--- End diff --

@vladimir-kotikov , getting a 404 on the link


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25098877
  
--- Diff: cordova-lib/src/cordova/platform_metadata.js ---
@@ -0,0 +1,113 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+*/
+
+
+var path = require('path'),
+cordova_util = require('./util'),
+fs   = require('fs'),
+Q= require('q'),
+shelljs  = require('shelljs'),
+events   = require('../events');
+
+
+// Retrieves the platforms and their versions from the platforms.json file
+// Returns an array of {platform: platform, version: version} ...
+// ... where version could be '3.4.0', '/path/to/platform' or 'git://...'
+function getVersions(projectRoot) {
+var platformsDir = path.join(projectRoot, 'platforms');
+var platformsJsonFile = path.join(platformsDir, 'platforms.json');
+
+// If the platforms.json file doesn't exist, retrieve versions 
installed
+// In this case, we won't be able to know what source the platform 
came from
+return Q.nfcall(fs.exists, platformsJsonFile).then(function(exists){
--- End diff --

Sorry, my bad. Here is a proper link 
http://nodejs.org/api/fs.html#fs_fs_exists_path_callback


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25100140
  
--- Diff: cordova-lib/src/cordova/platform.js ---
@@ -174,6 +181,24 @@ function addHelper(cmd, hooksRunner, projectRoot, 
targets, opts) {
 });
 }
 
+function save(hooksRunner, projectRoot, opts) {
+var xml = cordova_util.projectConfig(projectRoot);
+var cfg = new ConfigParser(xml);
+
+// First, remove all platforms that are already in config.xml
+cfg.getEngines().map(function(engine){
+cfg.removeEngine();
+});
+
+// Save installed platforms into config.xml
+return 
platformMetadata.getPlatformVersions(projectRoot).then(function(platformVersions){
+platformVersions.map(function(platVer){
--- End diff --

Changed all the map into forEach. it's definitely better to use forEach 
with side-effecting operations.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/170#discussion_r25100062
  
--- Diff: cordova-lib/src/cordova/platform.js ---
@@ -174,6 +181,24 @@ function addHelper(cmd, hooksRunner, projectRoot, 
targets, opts) {
 });
 }
 
+function save(hooksRunner, projectRoot, opts) {
+var xml = cordova_util.projectConfig(projectRoot);
+var cfg = new ConfigParser(xml);
+
+// First, remove all platforms that are already in config.xml
+cfg.getEngines().map(function(engine){
+cfg.removeEngine();
--- End diff --

Thanks @vladimir-kotikov , nice catch. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread omefire
Github user omefire commented on the pull request:

https://github.com/apache/cordova-lib/pull/170#issuecomment-75314035
  
@vladimir-kotikov Thanks for reviewing, All your reviews have been 
addressed, please take another look.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: fix crash when trying to pick ...

2015-02-20 Thread PiotrPiesiak
GitHub user PiotrPiesiak opened a pull request:

https://github.com/apache/cordova-plugin-camera/pull/66

fix crash when trying to pick picture on iPad



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/PiotrPiesiak/cordova-plugin-camera master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-plugin-camera/pull/66.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #66


commit f94ef89fd3a7a83cff23a46e4850b9cbc8ebaef1
Author: PiotrPiesiak 
Date:   2015-02-20T21:11:49Z

fix crash when trying to pick picture on iPad




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: Proposal for CSP support

2015-02-20 Thread Jason Chase
Chuck,

Thanks for the feedback, it's good to know others are interested in CSP.

I've created a doc to capture the proposal in a little more detail, and
allow for more robust comments:
https://docs.google.com/document/d/1sfFs6LB1_giodyR4QwBMQssLKP_UxACZifk-VYVX2T8/edit?usp=sharing

In that doc, I've attempted to address the questions/comments both from
your email, as well as Michal's earlier response.  I'll let all interested
parties continue the conversation in the doc.

Thanks,
Jason

On 20 February 2015 at 10:54, Chuck Lantz  wrote:

> Hey Jason - Glad to see this proposal!  A number of us at Microsoft have
> been talking along these same lines actually. Windows 10 apps will include
> CSP support as the latest version of IE has support so I'd say we're
> completely in support of moving Cordova apps down this path.  In fact I'd
> want to make sure that any CSP related metadata tag injection also applied
> to the Windows platform as well.
>
> A few of thoughts:
>
> 1. I definitely know there is quite a bit of interest still in being able
> to enable hosted (https accessed and controlled by the developer) app
> content access Cordova device APIs (which is currently a shortcoming of
> Windows 8.0/8.1 apps so we hear about it quite a bit).  As a result, we'll
> want to be sure Cordova doesn't inhibit this use case at a base level.
> That said, having a default CSP policy that restricts hosted in the
> template is fine and would promote secure practices since you need to
> exercise caution when mixing in any remote content even when you control it
> completely.  Also agree with inline being high risk.
>
> 2. Re: Long term, one thing that CSP doesn't cover well is which URIs
> should be granted elevated device access. Given hosted content with plugin
> device API access is still a scenario we'll need to consider, perhaps we
> should consider using the config.xml  element to represent URIs
> that have device API access (beyond standard browser access).  Otherwise we
> get into a bit of an "all or nothing" situation as it pertains to hosted
> app content which poses a larger security risk if you opt to extend device
> API access beyond local content. (It also strikes me this is a general gap
> in the web standard as a whole.)
>
> 3. Eval is actually a bit tougher - I know when we've look at this in the
> past it impacted JS frameworks far more than inline did.  (Ex: With Angular
> you can stop using eval but you take a perf hit which is a bigger deal on
> mobile than desktop.)  Definitely the most secure practice - but it also
> could cause the default template to appear to "not work."  If we omit the
> "unsafe-eval" directive in the CSP policy in the template we'll want to be
> crystal clear on how to alter it.  That could be solved with proper
> documentation and blog posts though.
>
> 4. I'd suggest we also consider the new "browser" platform here since
> Chrome/Firefox/IE (as of Win 10) have support. Should be "free", but I'm
> guessing the metadata tag injection you mention is something we could
> probably just do all-up rather than only for specific platforms.
>
> -Chuck
>
> -Original Message-
> From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal
> Mocny
> Sent: Thursday, February 19, 2015 2:25 PM
> To: dev
> Subject: Re: Proposal for CSP support
>
> Thanks for this clear outline.
>
> Jason, I know you've been working on the short-term items for a while as
> part of your investigation, fixing things as you went -- what is the
> current state of CSP support in platforms / plugins?  What portion already
> has fixes (or PR for them), what work is known but undone, and what hasn't
> been investigated much at all?
>
> -Michal
>
> On Thu, Feb 19, 2015 at 4:55 PM, Jason Chase  wrote:
>
> > I'm interested in full-blown support for CSP (Content Security Policy)
> > in Cordova.  While we're close to having new and improved whitelist
> > functionality, there are gaps in what the whitelist is able to protect
> > against. In particular, inline script and eval() are higher risks that
> > are not addressed by whitelists.
> >
> > Many Cordova apps may use only static content, or not include any
> > third-party content.  However, there are certainly examples of apps
> > that need to include user input/third-party content, mixed with the
> > app's own HTML content.  In some cases, platforms may even restrict
> > functionality (see [1]). I think CSP is a compelling answer for these
> > scenarios, and for security in general for apps.
> >
> > Assuming CSP support is valuable, the question is how to implement?
> > Support for CSP is not universal across platforms.  It is known to be
> > supported on Android (KitKat and later), iOS (since 7.1), and Firefox.
> > Where supported, it is typically via a HTTP response header, or a META
> > tag in the document.
> >
> > I've done some investigation into feasible approaches.  As a result,
> > I'm proposing as below.
> >
> > Long term goal:
> > Cordova suppor

[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread vladimir-kotikov
Github user vladimir-kotikov commented on the pull request:

https://github.com/apache/cordova-lib/pull/170#issuecomment-75336770
  
LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-ios pull request: CB-8084 conform AppDelegate.m with provi...

2015-02-20 Thread shazron
Github user shazron commented on the pull request:

https://github.com/apache/cordova-ios/pull/128#issuecomment-75339637
  
Note that the fix enables it to be disabled using a build.xcconfig 
preprocessor macro definition (which can be done through a project/plugin 
hook). In 3.8.0 it still behaves like 3.7.0 by default for backwards 
compatibility reasons (in 4.0.0, it will be disabled)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8482: Update engine syntax within con...

2015-02-20 Thread omefire
Github user omefire commented on the pull request:

https://github.com/apache/cordova-lib/pull/168#issuecomment-75346177
  
There will need to be another pass to update dependent modules to handle 
the possibility that some new code depending on old syntax might have been 
inserted in the interim. this is just a reminder to myself and the person who 
will merge this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: prepare --browserify fails to find referenced modules

2015-02-20 Thread Christian G. Warden
Hi Steven,
I would be happy to submit a pull request.  Can you point me in the
direction of the tests that should be updated?  I'm not seeing
anything obvious related to browserify in the test directory.

Christian

On Thu, Feb 19, 2015 at 04:02:19PM -0700, Steven Gill wrote:
> Good catch. Thanks for letting us know. Do you mind sending over a pull
> request? I will have to test it with our core plugins.
> 
> On Wed, Feb 18, 2015 at 9:55 PM, Christian G. Warden 
> wrote:
> 
> > On Wed, Feb 18, 2015 at 10:51:29AM -0800, Christian G. Warden wrote:
> > > When using the --browserify option to `cordova prepare`, I'm running
> > into a
> > > problem with a plugin that refers requires other javascript modules
> > defined in
> > > a plugin, either within the same plugin or another one.
> > >
> > > Here's an example:
> > > $ cordova create CordovaBrowserifyTest
> > > $ cd CordovaBrowserifyTest
> > > $ cordova platform add android
> > > $ cordova plugin add
> > https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin
> > > $ cordova prepare --browserify
> > > Error: Cannot find module 'com.salesforce.util.exec' from
> > '/home/cwarden/git/CordovaBrowserifyTest/plugins/com.salesforce/www'
> > > at
> > /home/cwarden/.nvm/v0.11.16/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-js/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:51:17
> > > at process
> > (/home/cwarden/.nvm/v0.11.16/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-js/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:159:43)
> > > at
> > /home/cwarden/.nvm/v0.11.16/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-js/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:168:21
> > > at load
> > (/home/cwarden/.nvm/v0.11.16/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-js/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:99:43)
> > > at
> > /home/cwarden/.nvm/v0.11.16/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-js/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:105:22
> > > at
> > /home/cwarden/.nvm/v0.11.16/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-js/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
> > > at FSReqWrap.oncomplete (fs.js:99:15)
> > >
> > >
> > > I suspect the problem could be related to the fact that the name of the
> > module
> > > being required, com.salesforce.util.exec, doesn't match the id of the
> > plugin,
> > > com.salesforce.
> >
> > It looks like I was mistaken.  The problem seems to simply be that the
> > browserify transform only handles apache modules and local references
> > correctly.
> >
> > I've been able to get the bundled cordova.js built with a small
> > change:
> >
> > https://github.com/cwarden/cordova-js/commit/943348db348e62e8245c5ca2b7dad6feecc7fb34
> >
> > Still need to do more testing.
> >
> > Christian
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> > For additional commands, e-mail: dev-h...@cordova.apache.org
> >
> >

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8499 `cordova platform save` should s...

2015-02-20 Thread gorkem
Github user gorkem commented on the pull request:

https://github.com/apache/cordova-lib/pull/170#issuecomment-75350562
  
Is platforms.json an existing file? Is it used anywhere else? I suspect 
that it is a new file and I am not sure if it is really needed 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org