You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/06/03 21:23:49 UTC

git commit: Remove trailing spaces in all js files

Repository: cordova-lib
Updated Branches:
  refs/heads/master 85974b0f9 -> 37e21e829


Remove trailing spaces in all js files

So that everyone can use auto removal of trailing spaces without generating
unwanted diff lines. Only white space changes, nothing else.
This also adds newlines at the end of files that didn't have them.

Files used in testing fixtures are not affected.

The command used:
sed -i '' 's/[[:space:]]*$//g' **/*.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/37e21e82
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/37e21e82
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/37e21e82

Branch: refs/heads/master
Commit: 37e21e82981d1bbc4ba1db914c8bdd2f9838e962
Parents: 85974b0
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Tue Jun 3 15:19:58 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Tue Jun 3 15:19:58 2014 -0400

----------------------------------------------------------------------
 cordova-lib/spec-cordova/PluginInfo.spec.js              |  2 +-
 cordova-lib/spec-cordova/restore.spec.js                 | 10 +++++-----
 cordova-lib/spec-cordova/save.spec.js                    |  2 +-
 cordova-lib/src/PluginInfo.js                            |  2 +-
 cordova-lib/src/cordova/ConfigParser.js                  |  4 ++--
 cordova-lib/src/cordova/metadata/amazon_fireos_parser.js |  6 +++---
 cordova-lib/src/cordova/metadata/ubuntu_parser.js        |  4 ++--
 cordova-lib/src/cordova/plugin.js                        |  2 +-
 cordova-lib/src/cordova/restore.js                       | 10 +++++-----
 cordova-lib/src/cordova/save.js                          |  8 ++++----
 cordova-lib/src/plugman/util/android-project.js          |  2 +-
 11 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/spec-cordova/PluginInfo.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/PluginInfo.spec.js b/cordova-lib/spec-cordova/PluginInfo.spec.js
index 239d4fa..a07d603 100644
--- a/cordova-lib/spec-cordova/PluginInfo.spec.js
+++ b/cordova-lib/spec-cordova/PluginInfo.spec.js
@@ -56,4 +56,4 @@ describe('PluginInfo', function () {
             expect(plugins.length).not.toBe(0);
         });
     });
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/spec-cordova/restore.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/restore.spec.js b/cordova-lib/spec-cordova/restore.spec.js
index a47b795..745e78e 100644
--- a/cordova-lib/spec-cordova/restore.spec.js
+++ b/cordova-lib/spec-cordova/restore.spec.js
@@ -36,7 +36,7 @@ describe('restore command', function(){
 
   beforeEach(function(){
     is_cordova = spyOn(cordova_util, 'isCordova').andReturn(project_dir);
-   
+
   });
 
   it('should not run outside of a Cordova-based project by calling util.isCordova', function() {
@@ -47,17 +47,17 @@ describe('restore command', function(){
   });
 
   it('should not try to restore featrues from config.xml', function(){
- 
- 
+
+
    cd_project_root = spyOn(cordova_util, 'cdProjectRoot').andReturn(project_dir);
- 
+
     var call_count =0;
     ConfigParser.prototype.write = function(){
       call_count++;
     }
 
      expect(call_count).toEqual(0);
-     
+
      cordova.restore('plugins');
 
      expect(call_count).toEqual(0);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/spec-cordova/save.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/save.spec.js b/cordova-lib/spec-cordova/save.spec.js
index b068ebc..c5ddcf2 100644
--- a/cordova-lib/spec-cordova/save.spec.js
+++ b/cordova-lib/spec-cordova/save.spec.js
@@ -36,7 +36,7 @@ describe('save command', function(){
 
   beforeEach(function(){
     is_cordova = spyOn(cordova_util, 'isCordova').andReturn(project_dir);
-   
+
   });
 
   it('should not run outside of a Cordova-based project by calling util.isCordova', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/PluginInfo.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/PluginInfo.js b/cordova-lib/src/PluginInfo.js
index 1a2fc8d..64730cd 100644
--- a/cordova-lib/src/PluginInfo.js
+++ b/cordova-lib/src/PluginInfo.js
@@ -286,4 +286,4 @@ function cloneAttribs(tag) {
 // leading/trailing white space.
 function isStrTrue(x) {
     return (typeof x === 'string') && (x.trim().toLowerCase() == 'true');
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/cordova/ConfigParser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/ConfigParser.js b/cordova-lib/src/cordova/ConfigParser.js
index b8a89e0..2df38d3 100644
--- a/cordova-lib/src/cordova/ConfigParser.js
+++ b/cordova-lib/src/cordova/ConfigParser.js
@@ -158,7 +158,7 @@ ConfigParser.prototype = {
     /**
      *This does not check for duplicate feature entries
      */
-    addFeature: function (name, params){ 
+    addFeature: function (name, params){
       var el = new et.Element('feature');
         el.attrib.name = name;
         if(params){
@@ -170,7 +170,7 @@ ConfigParser.prototype = {
           });
         }
         this.doc.getroot().append(el);
-    },    
+    },
     write:function() {
         fs.writeFileSync(this.path, this.doc.write({indent: 4}), 'utf-8');
     }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js b/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
index dd5b52c..f6e16d3 100644
--- a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
+++ b/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
@@ -69,7 +69,7 @@ module.exports.prototype = {
 
         return ret;
     },
-    
+
     update_from_config:function(config) {
         if (config instanceof ConfigParser) {
         } else throw new Error('update_from_config requires a ConfigParser object');
@@ -189,7 +189,7 @@ module.exports.prototype = {
         manifest.getroot().attrib.package = pkg;
 
         var act = manifest.getroot().find('./application/activity');
-        
+
          // Set the orientation in the AndroidManifest
         var orientationPref = this.findOrientationPreference(config);
         if (orientationPref) {
@@ -204,7 +204,7 @@ module.exports.prototype = {
                     act.attrib["android:screenOrientation"] = 'landscape';
             }
         }
-        
+
         // Set android:launchMode in AndroidManifest
         var androidLaunchModePref = this.findAndroidLaunchModePreference(config);
         if (androidLaunchModePref) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/cordova/metadata/ubuntu_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/ubuntu_parser.js b/cordova-lib/src/cordova/metadata/ubuntu_parser.js
index c39bb0c..4abc338 100644
--- a/cordova-lib/src/cordova/metadata/ubuntu_parser.js
+++ b/cordova-lib/src/cordova/metadata/ubuntu_parser.js
@@ -111,7 +111,7 @@ module.exports.prototype = {
 
         var name = sanitize(this.config.name()); //FIXME: escaping
         var content = "[Desktop Entry]\nName=" + name + "\nExec=./cordova-ubuntu www/\nTerminal=false\nType=Application\nX-Ubuntu-Touch=true";
-          
+
         if (this.config.doc.find('icon') && this.config.doc.find('icon').attrib.src && fs.existsSync(path.join(this.path, 'www', this.config.doc.find('icon').attrib.src))) {
             content += '\nIcon=www/' + this.config.doc.find('icon').attrib.src;
         }
@@ -121,7 +121,7 @@ module.exports.prototype = {
         var policy = { policy_groups: ["networking", "audio"], policy_version: 1 };
 
         this.config.doc.getroot().findall('./feature/param').forEach(function (element) {
-            if (element.attrib.policy_group && policy.policy_groups.indexOf(element.attrib.policy_group) === -1)     
+            if (element.attrib.policy_group && policy.policy_groups.indexOf(element.attrib.policy_group) === -1)
                 policy.policy_groups.push(element.attrib.policy_group);
         });
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/cordova/plugin.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/plugin.js b/cordova-lib/src/cordova/plugin.js
index a04e979..f9be60c 100644
--- a/cordova-lib/src/cordova/plugin.js
+++ b/cordova-lib/src/cordova/plugin.js
@@ -183,7 +183,7 @@ module.exports = function plugin(command, targets, opts) {
                                 if(features && features.length){
                                     events.emit('results','"'+target + '" plugin is restorable, call "cordova save plugins" to remove it from restorable plugins list');
                                 }
-                            }                            
+                            }
                             events.emit('verbose', 'Calling plugman.uninstall on plugin "' + target + '" for platform "' + platform + '"');
                             return plugman.raw.uninstall.uninstallPlatform(platform, platformRoot, target, path.join(projectRoot, 'plugins'));
                         });

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/cordova/restore.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/restore.js b/cordova-lib/src/cordova/restore.js
index 6414e00..7ed97f0 100644
--- a/cordova-lib/src/cordova/restore.js
+++ b/cordova-lib/src/cordova/restore.js
@@ -29,7 +29,7 @@ var cordova_util    = require('./util'),
 module.exports = function restore(target){
     var projectHome = cordova_util.cdProjectRoot();
     var configPath = cordova_util.projectConfig(projectHome);
-    var configXml = new ConfigParser(configPath);    
+    var configXml = new ConfigParser(configPath);
     return installPluginsFromConfigXML(configXml);
 }
 
@@ -53,7 +53,7 @@ function installPluginsFromConfigXML(cfg){
             if(params[i].attrib.name === 'version'){
               pluginVersion = params[i].attrib.value;
             }
-          } 
+          }
           var pluginPath =  path.join(plugins_dir,pluginId);
           // contents of the plugins folder takes precedence hence
           // we ignore if the correct version is installed or not.
@@ -66,9 +66,9 @@ function installPluginsFromConfigXML(cfg){
           }
 
         })
-        
-        //Use cli instead of plugman directly ensuring all the hooks 
-        // to get fired.  
+
+        //Use cli instead of plugman directly ensuring all the hooks
+        // to get fired.
         if(pluginsFromConfig.length >0){
             return plugin("add",pluginsFromConfig);
         }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/cordova/save.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/save.js b/cordova-lib/src/cordova/save.js
index 6c1bc0b..15b0074 100644
--- a/cordova-lib/src/cordova/save.js
+++ b/cordova-lib/src/cordova/save.js
@@ -34,16 +34,16 @@ module.exports = function save(target, opts){
   var features = configXml.doc.findall('./feature/param[@name="id"]/..');
   //clear obsolete features with id params.
   for(var i=0; i<features.length; i++){
-     //somehow elementtree remove fails on me  
+     //somehow elementtree remove fails on me
      var childs = configXml.doc.getroot().getchildren();
      var idx = childs.indexOf(features[i]);
      if(idx > -1){
         childs.splice(idx,1);
       }
   }
-  // persist the removed features here if there are no plugins 
-  // to be added to config.xml otherwise we can delay the 
-  // persist to add feature    
+  // persist the removed features here if there are no plugins
+  // to be added to config.xml otherwise we can delay the
+  // persist to add feature
   if((!plugins || plugins.length<1) &&
         (features && features.length)){
       configXml.write();

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/37e21e82/cordova-lib/src/plugman/util/android-project.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/android-project.js b/cordova-lib/src/plugman/util/android-project.js
index b30748b..08ed205 100644
--- a/cordova-lib/src/plugman/util/android-project.js
+++ b/cordova-lib/src/plugman/util/android-project.js
@@ -2,7 +2,7 @@
     Helper for Android projects configuration
 */
 
-var fs = require('fs'), 
+var fs = require('fs'),
     path = require('path'),
     properties_parser = require('properties-parser'),
     shell = require('shelljs');