Skip to content

Commit

Permalink
accept trailing slash for marketplace url + jquery validation on load…
Browse files Browse the repository at this point in the history
… + bump to version 0.1.11
  • Loading branch information
ivancevich committed Feb 20, 2015
1 parent df18862 commit de439b3
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 50 deletions.
20 changes: 12 additions & 8 deletions dist/kido-js.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
// KidoZen Javascript SDK v0.1.10.
// KidoZen Javascript SDK v0.1.11.
// Copyright (c) 2014 Kidozen, Inc. MIT Licensed
var KIDO_SDK_VERSION = '0.1.10';
var KIDO_SDK_VERSION = '0.1.11';
/**
* Kido - Kidozen representation of an Application.
*
* Use the Kido class to gain access to all the application's backend services.
*/

// make sure JSON.parse and JSON.stringify exist.
// make sure JSON.parse and JSON.stringify exist
if (!JSON || !JSON.parse || !JSON.stringify) throw "KidoZen requires JSON.stringify. Try adding a polyfil lib like json2.js";

// make sure jQuery exists and it's version 1.8+
if (typeof $ === 'undefined') throw "jQuery 1.8 or above is required to use the Kido SDK.";
if (typeof $.fn === 'undefined' || typeof $.fn.jquery === 'undefined') throw "Could not determine jQuery version.";
var $version = $.fn.jquery.split('.');
if (parseInt($version[0]) < 2 && parseInt($version[1]) < 8) throw "jQuery 1.8 or above is required to use the Kido SDK.";

/**
* Kido is the main class to manage Kidozen services.
*
Expand All @@ -22,17 +28,15 @@ var Kido = function (name, marketplace, options) {

if (!(this instanceof Kido)) return new Kido();

if (typeof $ === 'undefined') throw "jQuery 1.8 or above is required to use the Kido SDK.";
if (typeof $.fn === 'undefined' || typeof $.fn.jquery === 'undefined') throw "Could not determine jQuery version.";
var $version = $.fn.jquery.split('.');
if (parseInt($version[0]) < 2 && parseInt($version[1]) < 8) throw "jQuery 1.8 or above is required to use the Kido SDK.";

if (typeof marketplace !== 'undefined') {
if (marketplace.indexOf('://') === -1) {
marketplace = 'https://' + marketplace;
} else if (marketplace.indexOf('http://') !== 0 && marketplace.indexOf('https://') !== 0) {
throw "Marketplace url must begin with https://";
}
if (marketplace.substr(-1) === '/') {
marketplace = marketplace.substr(0, marketplace.length - 1);
}
}

var self = this;
Expand Down
Loading

0 comments on commit de439b3

Please sign in to comment.