cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kam...@apache.org
Subject git commit: Fix style errors - make jshint happy
Date Wed, 23 Jul 2014 18:44:38 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master f393d91f5 -> bc02fcc68


Fix style errors - make jshint happy


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

Branch: refs/heads/master
Commit: bc02fcc688cef5b2a247ff7261321ad334c2f148
Parents: f393d91
Author: Mark Koudritsky <kamrik@gmail.com>
Authored: Wed Jul 23 14:44:04 2014 -0400
Committer: Mark Koudritsky <kamrik@gmail.com>
Committed: Wed Jul 23 14:44:04 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/configparser/ConfigParser.js       | 10 +++++-----
 cordova-lib/src/cordova/create.js                  |  6 +++---
 cordova-lib/src/cordova/lazy_load.js               |  4 ++--
 cordova-lib/src/cordova/metadata/android_parser.js |  5 +++--
 cordova-lib/src/cordova/restore.js                 |  5 ++---
 cordova-lib/src/cordova/save.js                    |  9 ++++-----
 6 files changed, 19 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bc02fcc6/cordova-lib/src/configparser/ConfigParser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/configparser/ConfigParser.js b/cordova-lib/src/configparser/ConfigParser.js
index 4d749c4..84de2a6 100644
--- a/cordova-lib/src/configparser/ConfigParser.js
+++ b/cordova-lib/src/configparser/ConfigParser.js
@@ -253,19 +253,19 @@ ConfigParser.prototype = {
      * @param  {String} id the engine id.
      */
     removeEngine: function(id){
-         var engines = this.doc.findall('./'+this.cdvNamespacePrefix+':engine/[@id="' +id+'"]');
-         for(var i=0; i < engines.length; i++){
+        var engines = this.doc.findall('./'+this.cdvNamespacePrefix+':engine/[@id="' +id+'"]');
+        for(var i=0; i < engines.length; i++){
             var childs = this.doc.getroot().getchildren();
             var idx = childs.indexOf(engines[i]);
             if(idx > -1){
                 childs.splice(idx,1);
-             }
-         }
+            }
+        }
     },
     getEngines: function(){
         var engines = this.doc.findall('./'+this.cdvNamespacePrefix+':engine');
         return engines.map(function(engine){
-           return {'id':engine.attrib.id};
+            return {'id':engine.attrib.id};
         });
     },
     write:function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bc02fcc6/cordova-lib/src/cordova/create.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/create.js b/cordova-lib/src/cordova/create.js
index bd0cab1..7aef292 100644
--- a/cordova-lib/src/cordova/create.js
+++ b/cordova-lib/src/cordova/create.js
@@ -218,9 +218,9 @@ function create(dir, id, name, cfg) {
 
         // Add template hooks/ for apps that are missing it
         if (!custom_hooks) {
-          shell.mkdir(path.join(dir, 'hooks'));
-          // Add hooks README.md
-          shell.cp(path.join(__dirname, '..', '..', 'templates', 'hooks-README.md'), path.join(dir,
'hooks', 'README.md'));
+            shell.mkdir(path.join(dir, 'hooks'));
+            // Add hooks README.md
+            shell.cp(path.join(__dirname, '..', '..', 'templates', 'hooks-README.md'), path.join(dir,
'hooks', 'README.md'));
         }
 
         // Add template config.xml for apps that are missing it

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bc02fcc6/cordova-lib/src/cordova/lazy_load.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/lazy_load.js b/cordova-lib/src/cordova/lazy_load.js
index 8f181b7..7376f3a 100644
--- a/cordova-lib/src/cordova/lazy_load.js
+++ b/cordova-lib/src/cordova/lazy_load.js
@@ -60,8 +60,8 @@ function Platform(platformString) {
         this.name = parts[0];
         this.version = parts[1];
     } else {
-      this.name = platformString;
-      if (platforms[this.name]) this.version = platforms[this.name].version;
+        this.name = platformString;
+        if (platforms[this.name]) this.version = platforms[this.name].version;
     }
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bc02fcc6/cordova-lib/src/cordova/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/android_parser.js b/cordova-lib/src/cordova/metadata/android_parser.js
index 76108a2..12a6d1f 100644
--- a/cordova-lib/src/cordova/metadata/android_parser.js
+++ b/cordova-lib/src/cordova/metadata/android_parser.js
@@ -97,6 +97,7 @@ module.exports.prototype = {
 
     handleSplashes:function(config) {
         var resources = config.getSplashScreens('android');
+        var destfilepath;
         // if there are "splash" elements in config.xml
         if (resources.length > 0) {
             var densities = this.deleteDefaultResource('screen.png');
@@ -104,7 +105,7 @@ module.exports.prototype = {
             var res = path.join(this.path, 'res');
 
             if (resources.defaultResource) {
-                var destfilepath = path.join(res, 'drawable', 'screen.png');
+                destfilepath = path.join(res, 'drawable', 'screen.png');
                 events.emit('verbose', 'copying splash icon from ' + resources.defaultResource.src
+ ' to ' + destfilepath);
                 shell.cp('-f', resources.defaultResource.src, destfilepath);
             }
@@ -113,7 +114,7 @@ module.exports.prototype = {
                 var resource = resources.getByDensity(density);
                 if (resource) {
                     // copy splash screens.
-                    var destfilepath = path.join(res, 'drawable-' + density, 'screen.png');
+                    destfilepath = path.join(res, 'drawable-' + density, 'screen.png');
                     events.emit('verbose', 'copying splash icon from ' + resource.src + '
to ' + destfilepath);
                     shell.cp('-f', resource.src, destfilepath);
                 }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bc02fcc6/cordova-lib/src/cordova/restore.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/restore.js b/cordova-lib/src/cordova/restore.js
index 9a37270..ffd1edc 100644
--- a/cordova-lib/src/cordova/restore.js
+++ b/cordova-lib/src/cordova/restore.js
@@ -29,7 +29,6 @@ var cordova_util    = require('./util'),
     plugin           = require('./plugin'),
     events           = require('../events'),
     platform         = require('./platform'),
-    hooker           = require('./hooker'),
     CordovaError     = require('../CordovaError');
 
 module.exports = restore;
@@ -51,9 +50,9 @@ function installPlatformsFromConfigXML(cfg){
     var engines = cfg.getEngines(projectHome);
     var targets = engines.map(function(engine){
             return engine.id;
-    });
+        });
     if(!targets || !targets.length  ){
-        return Q.all("No platforms are listed in config.xml to restore");
+        return Q.all('No platforms are listed in config.xml to restore');
     }
     return platform('add', targets);
 }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/bc02fcc6/cordova-lib/src/cordova/save.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/save.js b/cordova-lib/src/cordova/save.js
index 68d08f2..568a301 100644
--- a/cordova-lib/src/cordova/save.js
+++ b/cordova-lib/src/cordova/save.js
@@ -23,7 +23,6 @@
 
 
 var path             = require('path'),
-    et               = require('elementtree'),
     Q                = require('q'),
     cordova_util     = require('./util'),
     ConfigParser     = require('../configparser/ConfigParser'),
@@ -34,9 +33,9 @@ var path             = require('path'),
 
 module.exports = save;
 function save(target, opts){
-    var projectHome = cordova_util.cdProjectRoot();//checks if this is a cordova project
+    cordova_util.cdProjectRoot();//checks if this is a cordova project
     if( 'plugins' === target ){
-       return savePlugins(opts);
+        return savePlugins(opts);
     }
     if( 'platforms' === target ){
         return savePlatforms(opts);
@@ -54,7 +53,7 @@ function savePlatforms(opts){
         var promise = new Q({'id':p});
         if(opts.shrinkwrap){//retrieve and save platform version
             var script = path.join(projectHome, 'platforms', p, 'cordova', 'version');
-             promise= superspawn.spawn(script).then(function(v){
+            promise= superspawn.spawn(script).then(function(v){
                 return {'id':p ,'version':v};
             });
         }
@@ -70,7 +69,7 @@ function savePlatforms(opts){
                 configXml.write();
                 events.emit('results', 'Saved platform info for "'+p+'" to config.xml');
             }
-        )
+        );
     }));
 }
 


Mime
View raw message