|
1 | 1 | /* |
2 | 2 | * breinify-api |
3 | | - * v1.0.12 |
| 3 | + * v1.0.15 |
4 | 4 | **/ |
5 | 5 | /* |
6 | 6 | * We inject a dependencyScope variable, which will be used |
@@ -12549,6 +12549,19 @@ dependencyScope.jQuery = $;; |
12549 | 12549 | return CryptoJS.MD5(value).toString(); |
12550 | 12550 | }, |
12551 | 12551 |
|
| 12552 | + /** |
| 12553 | + * Generates a uuid, thanks to |
| 12554 | + * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript |
| 12555 | + * |
| 12556 | + * @returns {string} a generated UUID |
| 12557 | + */ |
| 12558 | + uuid: function () { |
| 12559 | + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { |
| 12560 | + var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); |
| 12561 | + return v.toString(16); |
| 12562 | + }); |
| 12563 | + }, |
| 12564 | + |
12552 | 12565 | /** |
12553 | 12566 | * Checks if the passed value is empty, i.e., is an empty string (trimmed), an empty object, undefined or null. |
12554 | 12567 | * @param val {*} the value to be checked |
@@ -12751,7 +12764,7 @@ dependencyScope.jQuery = $;; |
12751 | 12764 | }); |
12752 | 12765 |
|
12753 | 12766 | var BreinifyConfig = function (config) { |
12754 | | - this.version = '1.0.12'; |
| 12767 | + this.version = '1.0.15'; |
12755 | 12768 |
|
12756 | 12769 | /* |
12757 | 12770 | * Validate the passed config-parameters. |
@@ -12917,7 +12930,7 @@ dependencyScope.jQuery = $;; |
12917 | 12930 |
|
12918 | 12931 | var BreinifyUser = function (user, onReady) { |
12919 | 12932 | var instance = this; |
12920 | | - instance.version = '1.0.12'; |
| 12933 | + instance.version = '1.0.15'; |
12921 | 12934 |
|
12922 | 12935 | // set the values provided |
12923 | 12936 | instance.setAll(user); |
@@ -13208,15 +13221,15 @@ dependencyScope.jQuery = $;; |
13208 | 13221 | } else if (func === null) { |
13209 | 13222 | func = pointer[key]; |
13210 | 13223 | } else { |
13211 | | - throw new SyntaxError('Multiple signatures for (' + types.toString() + ') found in: ' + pointer.toString()); |
| 13224 | + throw new SyntaxError('Multiple signatures for (' + types.toString() + ') found in: ' + JSON.stringify(pointer)); |
13212 | 13225 | } |
13213 | 13226 | } |
13214 | 13227 | }); |
13215 | 13228 | } else { |
13216 | 13229 | func = pointer[types.toString()]; |
13217 | 13230 | } |
13218 | 13231 | if (typeof func !== 'function') { |
13219 | | - throw new SyntaxError('Invalid signature (' + types.toString() + ') found, use one of: ' + pointer.toString()); |
| 13232 | + throw new SyntaxError('Invalid signature (' + types.toString() + ') found, use one of: ' + JSON.stringify(pointer)); |
13220 | 13233 | } |
13221 | 13234 |
|
13222 | 13235 | return func.apply(context, args); |
@@ -13295,7 +13308,7 @@ dependencyScope.jQuery = $;; |
13295 | 13308 | * The one and only instance of the library. |
13296 | 13309 | */ |
13297 | 13310 | var Breinify = { |
13298 | | - version: '1.0.12', |
| 13311 | + version: '1.0.15', |
13299 | 13312 | jQueryVersion: $.fn.jquery |
13300 | 13313 | }; |
13301 | 13314 |
|
@@ -13577,6 +13590,11 @@ dependencyScope.jQuery = $;; |
13577 | 13590 | _privates.ajax(url, data, callback, callback); |
13578 | 13591 | }); |
13579 | 13592 | }, |
| 13593 | + 'Object,Function': function (user, callback) { |
| 13594 | + Breinify.temporalDataUser(user, false, function (data) { |
| 13595 | + _privates.ajax(url, data, callback, callback); |
| 13596 | + }); |
| 13597 | + }, |
13580 | 13598 | 'Object,Boolean,Function': function (user, sign, callback) { |
13581 | 13599 | Breinify.temporalDataUser(user, sign, function (data) { |
13582 | 13600 | _privates.ajax(url, data, callback, callback); |
@@ -13623,8 +13641,6 @@ dependencyScope.jQuery = $;; |
13623 | 13641 | var timezone = user.read('timezone'); |
13624 | 13642 |
|
13625 | 13643 | var message = _privates.generateTemporalDataMessage(unixTimestamp, localDateTime, timezone); |
13626 | | - console.log(message); |
13627 | | - console.log(_config.get(ATTR_CONFIG.SECRET)); |
13628 | 13644 | signature = _privates.determineSignature(message, _config.get(ATTR_CONFIG.SECRET)) |
13629 | 13645 | } else { |
13630 | 13646 | _onReady(null); |
@@ -13823,7 +13839,8 @@ dependencyScope.jQuery = $;; |
13823 | 13839 | isEmpty: function() { return false; }, |
13824 | 13840 | isSimpleObject: function() { return false; }, |
13825 | 13841 | timezone: function() { return null; }, |
13826 | | - localDateTime: function() { return new Date().toString(); } |
| 13842 | + localDateTime: function() { return new Date().toString(); }, |
| 13843 | + uuid: function() { return null; } |
13827 | 13844 | }; |
13828 | 13845 |
|
13829 | 13846 | window['Breinify'] = Breinify; |
|
0 commit comments