cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [4/7] git commit: [CB-3191] Updated README to reflect <content> tag support. Added support + specs for ios.
Date Mon, 12 Aug 2013 20:59:20 GMT
[CB-3191] Updated README to reflect <content> tag support. Added support + specs for
ios.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/86ef079b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/86ef079b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/86ef079b

Branch: refs/heads/master
Commit: 86ef079b2363194411614a76485a9823f903d0f5
Parents: 057021d
Author: Fil Maj <maj.fil@gmail.com>
Authored: Mon Aug 12 13:22:30 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Mon Aug 12 13:22:30 2013 -0700

----------------------------------------------------------------------
 README.md                        |  1 +
 spec/metadata/ios_parser.spec.js | 13 +++++++++++--
 src/metadata/ios_parser.js       |  4 ++++
 3 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/86ef079b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 04f182b..2968366 100644
--- a/README.md
+++ b/README.md
@@ -106,6 +106,7 @@ This file is what you should be editing to modify your application's metadata.
A
 - The version can be modified via the `version` attribute from the top-level `<widget>`
element.
 - The whitelist can be modified using the `<access>` elements. Make sure the `origin`
attribute of your `<access>` element points to a valid URL (you can use `*` as wildcard).
For more information on the whitelisting syntax, see the [docs.phonegap.com](http://docs.phonegap.com/en/2.2.0/guide_whitelist_index.md.html#Domain%20Whitelist%20Guide).
You can use either attribute `uri` ([BlackBerry-proprietary](https://developer.blackberry.com/html5/documentation/access_element_834677_11.html))
or `origin` ([standards-compliant](http://www.w3.org/TR/widgets-access/#attributes)) to denote
the domain.
 - Platform-specific preferences can be customized via `<preference>` tags. See [docs.phonegap.com](http://docs.phonegap.com/en/2.3.0/guide_project-settings_index.md.html#Project%20Settings)
for a list of preferences you can use.
+- The entry/start page for your application can be defined via the `<content src>`
element + attribute.
 
 ## platforms/
 Platforms added to your application will have the native application project structures laid
out within this directory.

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/86ef079b/spec/metadata/ios_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/ios_parser.spec.js b/spec/metadata/ios_parser.spec.js
index 546568e..509cf26 100644
--- a/spec/metadata/ios_parser.spec.js
+++ b/spec/metadata/ios_parser.spec.js
@@ -99,7 +99,7 @@ describe('ios project parser', function () {
 
         describe('update_from_config method', function() {
             var et, xml, find, write_xml, root, mv;
-            var cfg, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm;
+            var cfg, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm,
cfg_content;
             var plist_parse, plist_build, xc;
             var update_name, xc_write;
             beforeEach(function() {
@@ -137,10 +137,12 @@ describe('ios project parser', function () {
                 cfg.version = function() { return 'one point oh' };
                 cfg.access.get = function() { return [] };
                 cfg.preference.get = function() { return [] };
+                cfg.content = function() { return 'index.html'; };
                 cfg_access_add = jasmine.createSpy('config_parser access add');
                 cfg_access_rm = jasmine.createSpy('config_parser access rm');
                 cfg_pref_rm = jasmine.createSpy('config_parser pref rm');
                 cfg_pref_add = jasmine.createSpy('config_parser pref add');
+                cfg_content = jasmine.createSpy('config_parser content');
                 cfg_parser.andReturn({
                     access:{
                         remove:cfg_access_rm,
@@ -151,7 +153,8 @@ describe('ios project parser', function () {
                         remove:cfg_pref_rm,
                         get:function(){},
                         add:cfg_pref_add
-                    }
+                    },
+                    content:cfg_content
                 });
                 p = new platforms.ios.parser(ios_proj);
             });
@@ -201,6 +204,12 @@ describe('ios project parser', function () {
                     done();
                 });
             });
+            it('should update the content tag / start page', function(done) {
+                p.update_from_config(cfg, function() {
+                    expect(cfg_content).toHaveBeenCalledWith('index.html');
+                    done();
+                });
+            });
             it('should wipe out the ios preferences every time', function(done) {
                 p.update_from_config(cfg, function() {
                     expect(cfg_pref_rm).toHaveBeenCalled();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/86ef079b/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index 4766a64..c023ef7 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -99,6 +99,7 @@ module.exports.prototype = {
         var plistFile = path.join(this.cordovaproj, this.originalName + '-Info.plist');
         var infoPlist = plist.parseFileSync(plistFile);
         infoPlist['CFBundleIdentifier'] = pkg;
+
         // Update version (bundle version)
         infoPlist['CFBundleVersion'] = version;
         var info_contents = plist.build(infoPlist);
@@ -113,6 +114,9 @@ module.exports.prototype = {
         config.access.get().forEach(function(uri) {
             self.config.access.add(uri);
         });
+
+        // Update content (start page)
+        this.config.content(config.content());
         
         // Update preferences
         this.config.preference.remove();


Mime
View raw message