mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2025-01-19 01:12:49 +08:00
CB-10636 Add JSHint for plugins
This commit is contained in:
parent
47f245462d
commit
8a3f9edb9d
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
16
.jshintrc
Normal file
16
.jshintrc
Normal file
@ -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
|
||||
}
|
||||
}
|
4
.travis.yml
Normal file
4
.travis.yml
Normal file
@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- "4.2"
|
@ -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
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -18,8 +18,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
var cordova = require('cordova');
|
||||
|
||||
function notSupported() {
|
||||
console.log('StatusBar is not supported');
|
||||
return false;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -19,6 +19,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* jshint jasmine: true */
|
||||
/* global StatusBar */
|
||||
|
||||
exports.defineAutoTests = function () {
|
||||
describe("StatusBar", function () {
|
||||
it("statusbar.spec.1 should exist", function() {
|
||||
|
@ -19,6 +19,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* global cordova */
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
var namedColors = {
|
||||
|
Loading…
Reference in New Issue
Block a user