Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 77C9F19D31 for ; Fri, 15 Apr 2016 20:49:48 +0000 (UTC) Received: (qmail 36513 invoked by uid 500); 15 Apr 2016 20:49:48 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 36370 invoked by uid 500); 15 Apr 2016 20:49:48 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 36331 invoked by uid 99); 15 Apr 2016 20:49:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 20:49:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E4FFDE032D; Fri, 15 Apr 2016 20:49:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: steven@apache.org To: commits@cordova.apache.org Date: Fri, 15 Apr 2016 20:49:49 -0000 Message-Id: <326c498f8333462abb33ce26a31daa70@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [03/11] cordova-plugin-statusbar git commit: CB-10636 Add JSHint for plugins CB-10636 Add JSHint for plugins Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/8a3f9edb Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/8a3f9edb Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/8a3f9edb Branch: refs/heads/2.1.x Commit: 8a3f9edb9d3a32db89f42e8ae3b08185533dc19c Parents: 47f2454 Author: daserge Authored: Wed Feb 24 10:28:04 2016 +0300 Committer: daserge Committed: Wed Feb 24 10:28:04 2016 +0300 ---------------------------------------------------------------------- .gitignore | 24 ++++++++++++++++++++++++ .jshintrc | 16 ++++++++++++++++ .travis.yml | 4 ++++ README.md | 2 ++ package.json | 9 ++++++++- src/browser/statusbar.js | 2 -- src/windows/StatusBarProxy.js | 16 +++++++++------- tests/tests.js | 3 +++ www/statusbar.js | 2 ++ 9 files changed, 68 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2209f42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +#If ignorance is bliss, then somebody knock the smile off my face + +*.csproj.user +*.suo +*.cache +Thumbs.db +*.DS_Store + +*.bak +*.cache +*.log +*.swp +*.user + +node_modules + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/.jshintrc ---------------------------------------------------------------------- diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..cf48aac --- /dev/null +++ b/.jshintrc @@ -0,0 +1,16 @@ +{ + "browser": true + , "devel": true + , "bitwise": true + , "undef": true + , "trailing": true + , "quotmark": false + , "indent": 4 + , "unused": "vars" + , "latedef": "nofunc" + , "globals": { + "module": false, + "exports": false, + "require": false + } +} http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b9af4c5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +sudo: false +node_js: + - "4.2" http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index e8a34a8..ecc6cac 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ # under the License. --> +[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-statusbar) + # cordova-plugin-statusbar StatusBar http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index bf5a4fe..c15aed0 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,10 @@ "cordova-wp8", "cordova-windows" ], + "scripts": { + "test": "npm run jshint", + "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests" + }, "engines": [ { "name": "cordova", @@ -33,5 +37,8 @@ } ], "author": "Apache Software Foundation", - "license": "Apache 2.0" + "license": "Apache 2.0", + "devDependencies": { + "jshint": "^2.6.0" + } } http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/src/browser/statusbar.js ---------------------------------------------------------------------- diff --git a/src/browser/statusbar.js b/src/browser/statusbar.js index d5637a5..3e9d05e 100644 --- a/src/browser/statusbar.js +++ b/src/browser/statusbar.js @@ -18,8 +18,6 @@ * */ -var cordova = require('cordova'); - function notSupported() { console.log('StatusBar is not supported'); return false; http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/src/windows/StatusBarProxy.js ---------------------------------------------------------------------- diff --git a/src/windows/StatusBarProxy.js b/src/windows/StatusBarProxy.js index fe18108..1755fb7 100644 --- a/src/windows/StatusBarProxy.js +++ b/src/windows/StatusBarProxy.js @@ -18,16 +18,18 @@ * */ - var _supported = null; // set to null so we can check first time +/* global Windows */ - function isSupported() { - // if not checked before, run check - if (_supported == null) { +var _supported = null; // set to null so we can check first time + +function isSupported() { + // if not checked before, run check + if (_supported === null) { var viewMan = Windows.UI.ViewManagement; _supported = (viewMan.StatusBar && viewMan.StatusBar.getForCurrentView); } return _supported; - } +} function getViewStatusBar() { if (!isSupported()) { @@ -94,14 +96,14 @@ module.exports = { }, show: function (win, fail) { - // added support check so no error thrown, when calling this method + // added support check so no error thrown, when calling this method if (isSupported()) { getViewStatusBar().showAsync().done(win, fail); } }, hide: function (win, fail) { - // added support check so no error thrown, when calling this method + // added support check so no error thrown, when calling this method if (isSupported()) { getViewStatusBar().hideAsync().done(win, fail); } http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/tests/tests.js ---------------------------------------------------------------------- diff --git a/tests/tests.js b/tests/tests.js index b66c5cc..5a8fe39 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -19,6 +19,9 @@ * */ +/* jshint jasmine: true */ +/* global StatusBar */ + exports.defineAutoTests = function () { describe("StatusBar", function () { it("statusbar.spec.1 should exist", function() { http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/8a3f9edb/www/statusbar.js ---------------------------------------------------------------------- diff --git a/www/statusbar.js b/www/statusbar.js index 7ebca30..afef7dd 100644 --- a/www/statusbar.js +++ b/www/statusbar.js @@ -19,6 +19,8 @@ * */ +/* global cordova */ + var exec = require('cordova/exec'); var namedColors = { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org