cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [04/32] cordova-lib git commit: CB-12021: Added local path support to --fetch and fixed failing tests for adding a relative path
Date Wed, 22 Feb 2017 00:07:35 GMT
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/clean
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/clean b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/clean
new file mode 100644
index 0000000..da21bc7
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/clean
@@ -0,0 +1,37 @@
+#!/usr/bin/env node
+
+/*
+       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'),
+    clean = require('./lib/clean'),
+    reqs  = require('./lib/check_reqs'),
+    args  = process.argv;
+
+// Support basic help commands
+if ( args.length > 2
+   || args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
+                    args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
+    console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'clean')) );
+    process.exit(0);
+} else {
+    clean.cleanProject();
+}
+

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/defaults.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/defaults.xml b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/defaults.xml
new file mode 100644
index 0000000..a7b31c0
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/defaults.xml
@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+       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.
+-->
+<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+
+</widget>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/build.js b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/build.js
new file mode 100644
index 0000000..fde7519
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/build.js
@@ -0,0 +1,65 @@
+#!/usr/bin/env node
+
+/*
+ * 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'),
+    fs      = require('fs'),
+    shjs    = require('shelljs'),
+    zip     = require('adm-zip'),
+    Q       = require('q'),
+    clean   = require('./clean'),
+    check_reqs = require('./check_reqs'),
+    platformWwwDir          = path.join('platforms', 'browser', 'www'),
+    platformBuildDir        = path.join('platforms', 'browser', 'build'),
+    packageFile             = path.join(platformBuildDir, 'package.zip');
+
+/**
+ * run
+ *   Creates a zip file int platform/build folder
+ */
+module.exports.run = function(){
+
+    return check_reqs.run()
+    .then(function(){
+            return clean.cleanProject();
+        },
+        function checkReqsError(err){
+            console.error('Please make sure you meet the software requirements in order to build a browser cordova project');
+    })
+    .then(function(){
+
+        if (!fs.existsSync(platformBuildDir)) {
+            fs.mkdirSync(platformBuildDir);
+        }
+
+        // add the project to a zipfile
+        var zipFile = zip();
+        zipFile.addLocalFolder(platformWwwDir, '.');
+        zipFile.writeZip(packageFile);
+
+        return Q.resolve();
+
+    });
+};
+
+module.exports.help = function() {
+    console.log('Usage: cordova build browser');
+    console.log('Build will create the packaged app in \''+platformBuildDir+'\'.');
+};

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/clean.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/clean.js b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/clean.js
new file mode 100644
index 0000000..2e4367d
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/lib/clean.js
@@ -0,0 +1,46 @@
+#!/usr/bin/env node
+
+/*
+ * 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 fs = require('fs'),
+    shjs = require('shelljs'),
+    path = require('path'),
+    check_reqs = require('./check_reqs'),
+    platformBuildDir = path.join('platforms', 'browser', 'build');
+
+exports.cleanProject = function(){
+
+    // Check that requirements are (stil) met
+    if (!check_reqs.run()) {
+        console.error('Please make sure you meet the software requirements in order to clean an browser cordova project');
+        process.exit(2);
+    }
+    
+    console.log('Cleaning Browser project');
+    try {
+        if (fs.existsSync(platformBuildDir)) {
+            shjs.rm('-r', platformBuildDir);
+        }
+    }
+    catch(err) {
+        console.log('could not remove '+platformBuildDir+' : '+err.message);
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run
new file mode 100755
index 0000000..d4c690b
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run
@@ -0,0 +1,70 @@
+#!/usr/bin/env node
+
+/*
+       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 fs = require('fs'),
+    path = require('path'),
+    nopt  = require('nopt'),
+    url = require('url'),
+    cordovaServe = require('cordova-serve');
+
+var args = process.argv;
+
+start(args);
+
+function start(argv) {
+    var args  = nopt({'help': Boolean, 'target': String, 'port': Number}, {'help': ['/?', '-h', 'help', '-help', '/help']}, argv);
+    if(args.help) {
+        help();
+    }
+
+    // defaults
+    args.port = args.port || 8000;
+    args.target = args.target || "chrome";
+
+    var root = path.join(__dirname, '../'),
+        configFile = path.resolve(path.join(root, 'config.xml')),
+        configXML = fs.readFileSync(configFile, 'utf8'),
+        sourceFile = /<content[\s]+?src\s*=\s*"(.*?)"/i.exec(configXML);
+
+    var server = cordovaServe();
+    server.servePlatform('browser', {port: args.port, noServerInfo: true}).then(function () {
+        var projectUrl = url.resolve('http://localhost:' + server.port + '/', sourceFile ? sourceFile[1] : 'index.html');
+        console.log('Static file server running @ ' + projectUrl + '\nCTRL + C to shut down');
+        return cordovaServe.launchBrowser({target: args.target, url: projectUrl});
+    }).catch(function (error) {
+        console.log(error.message || error.toString());
+        if (server.server) {
+            server.server.close();
+        }
+    });
+}
+
+function help() {
+    console.log("\nUsage: run [ --target=<browser> ] [ --port=<number> ]");
+    console.log("    --target=<browser> : Launches the specified browser. Chrome is default.");
+    console.log("    --port=<number>    : Http server uses specified port number.");
+    console.log("Examples:");
+    console.log("    run");
+    console.log("    run -- --target=ie");
+    console.log("    run -- --target=chrome --port=8000");
+    console.log("");
+    process.exit(0);
+}

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run.bat
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run.bat b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run.bat
new file mode 100644
index 0000000..b9c4402
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/run.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0run"
+IF EXIST %script_path% (
+        node %script_path% %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
+    EXIT /B 1
+)

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version
new file mode 100755
index 0000000..8acf18f
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version
@@ -0,0 +1,25 @@
+#!/usr/bin/env node
+
+/*
+       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.
+*/
+
+// Coho updates this line:
+var VERSION = "4.2.0-dev";
+
+console.log(VERSION);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version.bat
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version.bat b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version.bat
new file mode 100644
index 0000000..3610c17
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/cordova/version.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0version"
+IF EXIST %script_path% (
+        node %script_path% %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
+    EXIT /B 1
+)

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/css/index.css
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/css/index.css b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/css/index.css
new file mode 100644
index 0000000..51daa79
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/css/index.css
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+* {
+    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+}
+
+body {
+    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
+    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
+    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
+    background-color:#E4E4E4;
+    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        color-stop(0, #A7A7A7),
+        color-stop(0.51, #E4E4E4)
+    );
+    background-attachment:fixed;
+    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+    font-size:12px;
+    height:100%;
+    margin:0px;
+    padding:0px;
+    text-transform:uppercase;
+    width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+    position:absolute;             /* position in the center of the screen */
+    left:50%;
+    top:50%;
+    height:50px;                   /* text area height */
+    width:225px;                   /* text area width */
+    text-align:center;
+    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with text) */
+    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area height */
+                                   /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+    .app {
+        background-position:left center;
+        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image height */
+        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
+                                      /* offset horizontal: half of image width and text area width */
+    }
+}
+
+h1 {
+    font-size:24px;
+    font-weight:normal;
+    margin:0px;
+    overflow:visible;
+    padding:0px;
+    text-align:center;
+}
+
+.event {
+    border-radius:4px;
+    -webkit-border-radius:4px;
+    color:#FFFFFF;
+    font-size:12px;
+    margin:0px 30px;
+    padding:2px 0px;
+}
+
+.event.listening {
+    background-color:#333333;
+    display:block;
+}
+
+.event.received {
+    background-color:#4B946A;
+    display:none;
+}
+
+@keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+@-webkit-keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+.blink {
+    animation:fade 3000ms infinite;
+    -webkit-animation:fade 3000ms infinite;
+}

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/img/logo.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/img/logo.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/img/logo.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/index.html b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/index.html
new file mode 100644
index 0000000..bde5741
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/index.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!--
+    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.
+-->
+<html>
+    <head>
+        <meta charset="utf-8" />
+        <meta name="format-detection" content="telephone=no" />
+        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
+        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
+        <link rel="stylesheet" type="text/css" href="css/index.css" />
+        <title>Hello World</title>
+    </head>
+    <body>
+        <div class="app">
+            <h1>Apache Cordova</h1>
+            <div id="deviceready" class="blink">
+                <p class="event listening">Connecting to Device</p>
+                <p class="event received">Device is Ready</p>
+            </div>
+        </div>
+        <script type="text/javascript" src="cordova.js"></script>
+        <script type="text/javascript" src="js/index.js"></script>
+        <script type="text/javascript">
+            app.initialize();
+        </script>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/js/index.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/js/index.js b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/js/index.js
new file mode 100644
index 0000000..31d9064
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/js/index.js
@@ -0,0 +1,49 @@
+/*
+ * 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 app = {
+    // Application Constructor
+    initialize: function() {
+        this.bindEvents();
+    },
+    // Bind Event Listeners
+    //
+    // Bind any events that are required on startup. Common events are:
+    // 'load', 'deviceready', 'offline', and 'online'.
+    bindEvents: function() {
+        document.addEventListener('deviceready', this.onDeviceReady, false);
+    },
+    // deviceready Event Handler
+    //
+    // The scope of 'this' is the event. In order to call the 'receivedEvent'
+    // function, we must explicity call 'app.receivedEvent(...);'
+    onDeviceReady: function() {
+        app.receivedEvent('deviceready');
+    },
+    // Update DOM on a Received Event
+    receivedEvent: function(id) {
+        var parentElement = document.getElementById(id);
+        var listeningElement = parentElement.querySelector('.listening');
+        var receivedElement = parentElement.querySelector('.received');
+
+        listeningElement.setAttribute('style', 'display:none;');
+        receivedElement.setAttribute('style', 'display:block;');
+
+        console.log('Received Event: ' + id);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/manifest.webapp
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/manifest.webapp b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/manifest.webapp
new file mode 100644
index 0000000..f24deb8
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/manifest.webapp
@@ -0,0 +1,10 @@
+{
+  "name": "My App",
+  "description": "Description of your app",
+  "launch_path": "/index.html",
+  "icons": {
+    "128": "/img/logo.png"
+  },
+  "default_locale": "en",
+  "type": "privileged"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-36-ldpi.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-36-ldpi.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-36-ldpi.png
new file mode 100644
index 0000000..cd5032a
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-36-ldpi.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-48-mdpi.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-48-mdpi.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-48-mdpi.png
new file mode 100644
index 0000000..e79c606
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-48-mdpi.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-72-hdpi.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-72-hdpi.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-72-hdpi.png
new file mode 100644
index 0000000..4d27634
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-72-hdpi.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png
new file mode 100644
index 0000000..ec7ffbf
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/android/icon-96-xhdpi.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png
new file mode 100644
index 0000000..8ad8bac
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-48-type5.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png
new file mode 100644
index 0000000..c6ddf84
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-50-type3.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada-wac/icon-80-type4.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada/icon-128.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada/icon-128.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada/icon-128.png
new file mode 100644
index 0000000..3516df3
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/bada/icon-128.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry/icon-80.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry/icon-80.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry/icon-80.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry/icon-80.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry10/icon-80.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry10/icon-80.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry10/icon-80.png
new file mode 100644
index 0000000..f86a27a
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/blackberry10/icon-80.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57-2x.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57-2x.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57-2x.png
new file mode 100644
index 0000000..efd9c37
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57-2x.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57.png
new file mode 100644
index 0000000..c795fc4
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-57.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72-2x.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72-2x.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72-2x.png
new file mode 100644
index 0000000..dd819da
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72-2x.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72.png
new file mode 100644
index 0000000..b1cfde7
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/ios/icon-72.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/tizen/icon-128.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/tizen/icon-128.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/tizen/icon-128.png
new file mode 100644
index 0000000..3516df3
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/tizen/icon-128.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/webos/icon-64.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/webos/icon-64.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/webos/icon-64.png
new file mode 100644
index 0000000..03b3849
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/webos/icon-64.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png
new file mode 100644
index 0000000..4f15e20
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-173-tile.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-48.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-48.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-48.png
new file mode 100644
index 0000000..8ad8bac
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-48.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png
new file mode 100644
index 0000000..aab6061
Binary files /dev/null and b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/templates/project/www/res/icon/windows-phone/icon-62-tile.png differ

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update
new file mode 100644
index 0000000..eb515b7
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update
@@ -0,0 +1,33 @@
+#!/usr/bin/env node
+
+/*
+       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 update = require('./lib/update');
+
+// check for help flag
+if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) > -1) {
+    update.help();
+} else {
+    update.run(process.argv).done(function () {
+        console.log('Successfully updated browser project.');
+    }, function (err) {
+        console.error('Update failed due to', err);
+        process.exit(2);
+    });
+}

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update.bat
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update.bat b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update.bat
new file mode 100644
index 0000000..d0aa7a0
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/bin/update.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0update"
+IF EXIST %script_path% (
+    node %script_path% %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'update' script in 'bin' folder, aborting...>&2
+    EXIT /B 1
+)

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/confighelper.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/confighelper.js b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/confighelper.js
new file mode 100644
index 0000000..b6d606e
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/confighelper.js
@@ -0,0 +1,95 @@
+/*
+ *
+ * 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 config;
+
+function Config(xhr) {
+    function loadPreferences(xhr) {
+       var parser = new DOMParser();
+       var doc = parser.parseFromString(xhr.responseText, "application/xml");
+
+       var preferences = doc.getElementsByTagName("preference");
+       return Array.prototype.slice.call(preferences);
+    }
+
+    this.xhr = xhr;
+    this.preferences = loadPreferences(this.xhr);
+}
+
+function readConfig(success, error) {
+    var xhr;
+
+    if(typeof config != 'undefined') {
+        success(config);
+    }
+
+    function fail(msg) {
+        console.error(msg);
+
+        if(error) {
+            error(msg);
+        }
+    }
+
+    var xhrStatusChangeHandler = function() {
+        if (xhr.readyState == 4) {
+            if (xhr.status == 200 || xhr.status == 304 || xhr.status === 0 /* file:// */) {
+                config = new Config(xhr);
+                success(config);
+            }
+            else {
+                fail('[Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: ' + xhr.statusText);
+            }
+        }
+    };
+
+    if ("ActiveXObject" in window) {
+        // Needed for XHR-ing via file:// protocol in IE
+        xhr = new window.ActiveXObject("MSXML2.XMLHTTP");
+        xhr.onreadystatechange = xhrStatusChangeHandler;
+    } else {
+        xhr = new XMLHttpRequest();
+        xhr.addEventListener("load", xhrStatusChangeHandler);
+    }
+
+    try {
+        xhr.open("get", "/config.xml", true);
+        xhr.send();
+    } catch(e) {
+        fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
+    }
+}
+
+/**
+ * Reads a preference value from config.xml.
+ * Returns preference value or undefined if it does not exist.
+ * @param {String} preferenceName Preference name to read */
+Config.prototype.getPreferenceValue = function getPreferenceValue(preferenceName) {
+    var preferenceItem = this.preferences && this.preferences.filter(function(item) {
+        return item.attributes.name && item.attributes.name.value === preferenceName;
+    });
+
+    if(preferenceItem && preferenceItem[0] && preferenceItem[0].attributes && preferenceItem[0].attributes.value) {
+        return preferenceItem[0].attributes.value.value;
+    }
+};
+
+exports.readConfig = readConfig;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/exec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/exec.js b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/exec.js
new file mode 100644
index 0000000..97f736a
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/exec.js
@@ -0,0 +1,114 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*jslint sloppy:true, plusplus:true*/
+/*global require, module, console */
+
+var cordova = require('cordova');
+var execProxy = require('cordova/exec/proxy');
+
+/**
+ * Execute a cordova command.  It is up to the native side whether this action
+ * is synchronous or asynchronous.  The native side can return:
+ *      Synchronous: PluginResult object as a JSON string
+ *      Asynchronous: Empty string ""
+ * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
+ * depending upon the result of the action.
+ *
+ * @param {Function} success    The success callback
+ * @param {Function} fail       The fail callback
+ * @param {String} service      The name of the service to use
+ * @param {String} action       Action to be run in cordova
+ * @param {String[]} [args]     Zero or more arguments to pass to the method
+ */
+module.exports = function (success, fail, service, action, args) {
+
+    var proxy = execProxy.get(service, action);
+
+    args = args || [];
+
+    if (proxy) {
+        
+        var callbackId = service + cordova.callbackId++;
+        
+        if (typeof success === "function" || typeof fail === "function") {
+            cordova.callbacks[callbackId] = {success: success, fail: fail};
+        }
+        try {
+
+            
+
+            // callbackOptions param represents additional optional parameters command could pass back, like keepCallback or
+            // custom callbackId, for example {callbackId: id, keepCallback: true, status: cordova.callbackStatus.JSON_EXCEPTION }
+            var onSuccess = function (result, callbackOptions) {
+                callbackOptions = callbackOptions || {};
+                var callbackStatus;
+                // covering both undefined and null.
+                // strict null comparison was causing callbackStatus to be undefined
+                // and then no callback was called because of the check in cordova.callbackFromNative
+                // see CB-8996 Mobilespec app hang on windows
+                if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
+                    callbackStatus = callbackOptions.status;
+                }
+                else {
+                    callbackStatus = cordova.callbackStatus.OK;
+                }
+                cordova.callbackSuccess(callbackOptions.callbackId || callbackId,
+                    {
+                        status: callbackStatus,
+                        message: result,
+                        keepCallback: callbackOptions.keepCallback || false
+                    });
+            };
+            var onError = function (err, callbackOptions) {
+                callbackOptions = callbackOptions || {};
+                var callbackStatus;
+                // covering both undefined and null.
+                // strict null comparison was causing callbackStatus to be undefined
+                // and then no callback was called because of the check in cordova.callbackFromNative
+                // note: status can be 0
+                if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
+                    callbackStatus = callbackOptions.status;
+                }
+                else {
+                    callbackStatus = cordova.callbackStatus.OK;
+                }
+                cordova.callbackError(callbackOptions.callbackId || callbackId,
+                {
+                    status: callbackStatus,
+                    message: err,
+                    keepCallback: callbackOptions.keepCallback || false
+                });
+            };
+            proxy(onSuccess, onError, args);
+
+        } catch (e) {
+            console.log("Exception calling native with command :: " + service + " :: " + action  + " ::exception=" + e);
+        }
+    } else {
+
+        console.log("Error: exec proxy not found for :: " + service + " :: " + action);
+        
+        if(typeof fail === "function" ) {
+            fail("Missing Command Error");
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/b3ca3001/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/platform.js b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/platform.js
new file mode 100644
index 0000000..0514059
--- /dev/null
+++ b/cordova-lib/spec-cordova/fixtures/platforms/cordova-browser/cordova-js-src/platform.js
@@ -0,0 +1,48 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+module.exports = {
+    id: 'browser',
+    cordovaVersion: '3.4.0',
+
+    bootstrap: function() {
+
+        var modulemapper = require('cordova/modulemapper');
+        var channel = require('cordova/channel');
+
+        modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
+
+        channel.onNativeReady.fire();
+
+        // FIXME is this the right place to clobber pause/resume? I am guessing not
+        // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
+        document.addEventListener('webkitvisibilitychange', function() {
+            if (document.webkitHidden) {
+                channel.onPause.fire();
+            }
+            else {
+                channel.onResume.fire();
+            }
+        }, false);
+
+    // End of bootstrap
+    }
+};


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message