Skip to content
Permalink
Browse files
CB-10636 Add JSHint for plugins
Fixed autotests
  • Loading branch information
daserge committed Feb 19, 2016
1 parent e401a4d commit 5ea854d8c3671751778a67095b3ec36a55e0c71b
Showing 9 changed files with 46 additions and 12 deletions.
@@ -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
}
}
@@ -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-splashscreen.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-splashscreen)

# cordova-plugin-splashscreen

This plugin displays and hides a splash screen during application launch.
@@ -34,12 +34,19 @@
"cordova-windows",
"cordova-tizen"
],
"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-android",
"version": ">=3.6.0"
}
],
"author": "Apache Software Foundation",
"license": "Apache-2.0"
"license": "Apache-2.0",
"devDependencies": {
"jshint": "^2.6.0"
}
}
@@ -14,6 +14,8 @@
* limitations under the License.
*/

/* global PluginResult */

module.exports = {
show: function (success, fail, args, env) {
var result = new PluginResult(args, env);
@@ -18,17 +18,18 @@
* under the License.
*
*/

// Default parameter values including image size can be changed in `config.xml`
var splashImageWidth = 170;
var splashImageHeight = 200;
var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight };
var splash = null; //
var localSplash; // the image to display
var localSplashImage;
var bgColor = "#464646";
var imageSrc = 'img/logo.png';
var splashScreenDelay = 3000; // in milliseconds
var showSplashScreen = true; // show splashcreen by default
var cordova = require('cordova');
var configHelper = cordova.require('cordova/confighelper');

function updateImageLocation() {
@@ -103,7 +104,6 @@ function readPreferencesFromCfg(cfg) {
} catch(e) {
var msg = '[Browser][SplashScreen] Error occured on loading preferences from config.xml: ' + JSON.stringify(e);
console.error(msg);
error(msg);
}
}

@@ -19,6 +19,8 @@
*
*/

/* global win:true */

( function() {

win = null;
@@ -19,18 +19,20 @@
*
*/

exports.defineAutoTest = function () {
/* jshint jasmine: true */

exports.defineAutoTests = function () {
describe('Splashscreen (cordova)', function () {
it("splashscreen.spec.1 should exist", function () {
expect(navigator.splashscreen).toBeDefined();
});

it("splashscreen.spec.2 exec method should exist", function () {
it("splashscreen.spec.2 show method should exist", function () {
expect(navigator.splashscreen.show).toBeDefined();
expect(typeof navigator.splashscreen.show).toBe('function');
});

it("splashscreen.spec.3 exec method should exist", function () {
it("splashscreen.spec.3 hide method should exist", function () {
expect(navigator.splashscreen.hide).toBeDefined();
expect(typeof navigator.splashscreen.hide).toBe('function');
});
@@ -20,17 +20,16 @@
*/

/*jslint sloppy:true */
/*global Windows:true, require, module, window, document, WinJS */
/*global WinJS */

var cordova = require('cordova'),
channel = require('cordova/channel');
var cordova = require('cordova');

var isPhone = (cordova.platformId == "windows") && WinJS.Utilities.isPhone;
var isHosted = window.location.protocol.indexOf('http') === 0;
var localSplash = null;
var localSplash = null, localSplashImage = null;
var bgColor = "#464646"; // default backgrond color; TDOO - read it from .appxmanifest
var splashImageSrc = (isHosted ? "ms-appx-web" : "ms-appx") + ":///images/"
+ (isPhone ? "splashscreenphone.png" : "splashscreen.png");
var splashImageSrc = (isHosted ? "ms-appx-web" : "ms-appx") + ":///images/" +
(isPhone ? "splashscreenphone.png" : "splashscreen.png");

var SplashScreen = {
setBGColor: function (cssBGColor) {

0 comments on commit 5ea854d

Please sign in to comment.