bobjoll 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +35 -0
  2. package/package.json +25 -0
  3. package/scss/layout/_footer.scss +10 -0
  4. package/scss/layout/_header.scss +10 -0
  5. package/scss/modules/_fonts.scss +26 -0
  6. package/scss/modules/_reset.scss +219 -0
  7. package/scss/modules/bourbon/addons/_clearfix.scss +25 -0
  8. package/scss/modules/bourbon/addons/_ellipsis.scss +30 -0
  9. package/scss/modules/bourbon/addons/_position.scss +48 -0
  10. package/scss/modules/bourbon/addons/_prefixer.scss +66 -0
  11. package/scss/modules/bourbon/addons/_size.scss +51 -0
  12. package/scss/modules/bourbon/addons/_timing-functions.scss +34 -0
  13. package/scss/modules/bourbon/addons/_triangle.scss +63 -0
  14. package/scss/modules/bourbon/css3/_calc.scss +4 -0
  15. package/scss/modules/bourbon/css3/_flex-box.scss +287 -0
  16. package/scss/modules/bourbon/css3/_keyframes.scss +36 -0
  17. package/scss/modules/bourbon/css3/_linear-gradient.scss +38 -0
  18. package/scss/modules/bourbon/css3/_placeholder.scss +8 -0
  19. package/scss/modules/bourbon/css3/_selection.scss +42 -0
  20. package/scss/modules/bourbon/css3/_transition.scss +71 -0
  21. package/scss/modules/mixins/_component.scss +9 -0
  22. package/scss/modules/mixins/_grid.scss +75 -0
  23. package/scss/modules/mixins/_helpers.scss +224 -0
  24. package/scss/modules/variables/_colors.scss +447 -0
  25. package/scss/modules/variables/_general.scss +235 -0
  26. package/scss/partials/_accordion-v1-0.scss +165 -0
  27. package/scss/partials/_autocomplete-v1-0.scss +55 -0
  28. package/scss/partials/_general-v1-0.scss +51 -0
  29. package/scss/partials/_grid-v1-0.scss +109 -0
  30. package/scss/partials/_helper-v1-0.scss +299 -0
  31. package/scss/partials/_icon-v2-0.scss +323 -0
  32. package/scss/partials/_list-v1-0.scss +100 -0
  33. package/scss/partials/_modal-v1-0.scss +159 -0
  34. package/scss/partials/_notification-v1-1.scss +297 -0
  35. package/scss/partials/_progress-bar-v1.0.scss +25 -0
  36. package/scss/partials/_range-v1.0.scss +75 -0
  37. package/scss/partials/_tooltipFixed-v1.0.scss +128 -0
  38. package/scss/partials/_typography-v1-0.scss +201 -0
  39. package/scss/partials/animations/_fade.scss +23 -0
  40. package/scss/partials/animations/_rotate.scss +11 -0
  41. package/scss/partials/animations/_scale.scss +23 -0
  42. package/scss/partials/animations/_slide.scss +31 -0
  43. package/scss/partials/button-v4-0/_component.scss +304 -0
  44. package/scss/partials/form/_checkbox-and-radio-v1-0.scss +187 -0
  45. package/scss/partials/form/_dropdowns-v1-0.scss +323 -0
  46. package/scss/partials/form/_general-v1-0.scss +166 -0
  47. package/scss/partials/form/_group-v1-0.scss +157 -0
  48. package/scss/partials/form/_password-v1-0.scss +28 -0
  49. package/scss/partials/form/_switch-v1-0.scss +128 -0
  50. package/scss/partials/form/_upload-v1-0.scss +91 -0
  51. package/ts/library/common.ts +30 -0
  52. package/ts/library/cookie.ts +47 -0
  53. package/ts/library/delegate.ts +122 -0
  54. package/ts/library/dom.ts +124 -0
  55. package/ts/library/event.ts +138 -0
  56. package/ts/library/extend.js +32 -0
  57. package/ts/library/gr/dom.q.ts +12 -0
  58. package/ts/library/gr/social/dependency/twitter_pu.js +66 -0
  59. package/ts/library/gr/social/facebook.ts +154 -0
  60. package/ts/library/gr/social/google.ts +127 -0
  61. package/ts/library/gr/social/index.ts +35 -0
  62. package/ts/library/gr/social/twitter.ts +65 -0
  63. package/ts/library/helpers.ts +9 -0
  64. package/ts/library/number-abbreviate.js +57 -0
  65. package/ts/library/settings.ts +7 -0
  66. package/ts/library/storage.ts +131 -0
  67. package/ts/library/svg4everybody.legacy.js +122 -0
  68. package/ts/partials/accordion-v1.0.ts +104 -0
  69. package/ts/partials/accordionTabs-v1.0.ts +27 -0
  70. package/ts/partials/alert-v1.0.ts +51 -0
  71. package/ts/partials/copy-v1.0.ts +17 -0
  72. package/ts/partials/countdown-v1.0.ts +119 -0
  73. package/ts/partials/dropdown-v1.0.ts +247 -0
  74. package/ts/partials/hbs-v1.0.ts +9 -0
  75. package/ts/partials/modal-v1.0.ts +213 -0
  76. package/ts/partials/notifications-v1.1.ts +376 -0
  77. package/ts/partials/notify-v1.0.ts +746 -0
  78. package/ts/partials/password-v1.0.ts +19 -0
  79. package/ts/partials/popover-v1.0.ts +125 -0
  80. package/ts/partials/progress-bar-v1.0.ts +29 -0
  81. package/ts/partials/scroll-v1.0.ts +169 -0
  82. package/ts/partials/scrollable-v1.0.ts +90 -0
  83. package/ts/partials/tabs-v1.0.ts +79 -0
  84. package/ts/partials/tags-v1.0.ts +21 -0
  85. package/ts/partials/trigger-v2.0.ts +155 -0
  86. package/ts/partials/upload-v1.0.ts +17 -0
  87. package/ts/views/hbs/alert-v1.0/element.html.hbs +35 -0
  88. package/ts/views/hbs/countdown-v1.0/countdown-inner.hbs +39 -0
  89. package/ts/views/hbs/countdown-v1.0/countdown.hbs +4 -0
  90. package/ts/views/hbs/dropdown-v1.0/element.html.hbs +70 -0
  91. package/ts/views/hbs/helpers.js +58 -0
  92. package/ts/views/hbs/modal-v1.0/element.html.hbs +17 -0
  93. package/ts/views/hbs/notification-v1.1/element-disable.html.hbs +26 -0
  94. package/ts/views/hbs/notification-v1.1/element.html.hbs +43 -0
  95. package/ts/views/hbs/notification-v1.1/wrapper.html.hbs +4 -0
@@ -0,0 +1,32 @@
1
+ var extend = function ( defaults, options ) {
2
+ var extended = {};
3
+ var prop;
4
+ for (prop in defaults) {
5
+ if (Object.prototype.hasOwnProperty.call(defaults, prop)) {
6
+ extended[prop] = defaults[prop];
7
+ }
8
+ }
9
+ for (prop in options) {
10
+ if (Object.prototype.hasOwnProperty.call(options, prop)) {
11
+ if (Object.prototype.toString.call(extended[prop]) === '[object Object]') {
12
+ if (!extended[prop]) {
13
+ extended[prop] = {};
14
+ }
15
+
16
+ extended[prop] = extend(extended[prop], options[prop]);
17
+ } else {
18
+ extended[prop] = options[prop];
19
+ }
20
+ }
21
+ }
22
+ return extended;
23
+ };
24
+
25
+ (function(){
26
+ if (typeof define === 'function' && define.amd)
27
+ define('extend', function () { return extend; });
28
+ else if (typeof module !== 'undefined' && module.exports)
29
+ module.exports = extend;
30
+ else
31
+ window.extend = extend;
32
+ })();
@@ -0,0 +1,12 @@
1
+ export function q(selector: string, parent: HTMLElement | Document = document): HTMLElement | null {
2
+ const x = parent.querySelector(selector);
3
+ return x ? x as HTMLElement : x;
4
+ }
5
+
6
+ export function qq(selector: string, parent: HTMLElement | Document = document): HTMLElement[] {
7
+ return Array.prototype.slice.call(parent.querySelectorAll(selector), 0);
8
+ }
9
+
10
+ export function qi(selector: string, parent: HTMLElement | Document = document): HTMLInputElement {
11
+ return q(selector, parent) as HTMLInputElement;
12
+ }
@@ -0,0 +1,66 @@
1
+ var pu_window;
2
+
3
+ export function pu(pu_url) {
4
+ var pu_width = window.innerWidth - 200;
5
+ var pu_height = window.innerHeight - 50;
6
+ var b = "toolbar=0,statusbar=1,resizable=1,scrollbars=0,menubar=0,location=1,directories=0";
7
+ if (navigator.userAgent.indexOf("Chrome") != -1) b = "scrollbar=yes";
8
+ var a = window.open("about:blank", "", b + ",height=" + pu_height + ",width=" + pu_width);
9
+
10
+ if (navigator.userAgent.indexOf("rv:2.") != -1) {
11
+ a.puPop = function(c) {
12
+ if (navigator.userAgent.indexOf("rv:2.") != -1) this.window.open("about:blank").close();
13
+ this.document.location.href = c;
14
+ };
15
+ a.puPop(pu_url);
16
+ } else
17
+ a.document.location.href = pu_url;
18
+ setTimeout(window.focus, 200);
19
+ window.focus();
20
+ if (a) {
21
+ a.moveTo(window.screenX + 2, window.screenY + 2);
22
+ a.blur();
23
+ self.focus();
24
+ } else {
25
+ done_pu = null;
26
+ ifSP2 = false;
27
+ if (typeof(pu_window) == "undefined") pu_window = false;
28
+ if (window.SymRealWinOpen) open = SymRealWinOpen;
29
+ if (window.NS_ActualOpen) open = NS_ActualOpen;
30
+ ifSP2 = (navigator.userAgent.indexOf("SV1") != -1);
31
+ if (!ifSP2)
32
+ do_pu();
33
+ else {
34
+ if (window.Event) document.captureEvents(Event.CLICK);
35
+ document.onclick = do_clicked_pu;
36
+ }
37
+ self.focus();
38
+ do_clicked_pu();
39
+ }
40
+ return this;
41
+ }
42
+
43
+ export function do_pu() {
44
+ if (!pu_window) {
45
+ done_pu = open(pu_url, "", "toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
46
+ if (done_pu) {
47
+ pu_window = true;
48
+ self.focus();
49
+ }
50
+ }
51
+ }
52
+
53
+ export function do_clicked_pu() {
54
+ if (!pu_window) {
55
+ if (!ifSP2) {
56
+ done_pu = open(pu_url, "", "toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
57
+ self.focus();
58
+ if (done_pu) pu_window = true;
59
+ }
60
+ }
61
+ if (!pu_window) {
62
+ if (window.Event) document.captureEvents(Event.CLICK);
63
+ document.onclick = do_pu;
64
+ self.focus();
65
+ }
66
+ }
@@ -0,0 +1,154 @@
1
+ /// <reference types="facebook-js-sdk" />
2
+
3
+ namespace facebook {
4
+ export interface FacebookStatic extends fb.FacebookStatic {
5
+ getUserID(): string;
6
+ }
7
+ }
8
+
9
+ declare const FB: facebook.FacebookStatic;
10
+ declare const FACEBOOK_APP_ID: string;
11
+
12
+ import Social from './index';
13
+
14
+ export default class Facebook extends Social {
15
+ public static getInstance() {
16
+ Facebook.init();
17
+
18
+ return Facebook;
19
+ }
20
+
21
+ public static async connect() {
22
+ const response = await new Promise((resolve, reject) => {
23
+ if ('' === FB.getUserID()) {
24
+ FB.login(
25
+ response => {
26
+ if (response.authResponse) {
27
+ resolve(response);
28
+ } else {
29
+ reject(response);
30
+ }
31
+ },
32
+ {
33
+ scope: 'public_profile, email',
34
+ },
35
+ );
36
+ } else {
37
+ FB.getLoginStatus(response => resolve(response));
38
+ }
39
+ });
40
+
41
+ return Facebook.status(<fb.AuthResponse>response);
42
+ }
43
+
44
+ public static disconnect() {
45
+ if (Facebook.gr) {
46
+ FB.api('/me/permissions', 'delete', function() {
47
+ try {
48
+ Facebook.connected = false;
49
+ Facebook.gr.logout();
50
+ } catch (e) {
51
+ console.error(`There has been an error on the logout request. Error: ${e}`);
52
+ }
53
+ });
54
+ }
55
+ }
56
+
57
+ private static sdk() {
58
+ if (!document.getElementById('facebook-jssdk')) {
59
+ (function(d, s, id) {
60
+ var js,
61
+ fjs = d.getElementsByTagName(s)[0];
62
+
63
+ if (d.getElementById(id)) return;
64
+
65
+ js = d.createElement(s) as HTMLScriptElement;
66
+ js.id = id;
67
+ js.src = '//connect.facebook.net/en_US/sdk.js';
68
+
69
+ if (fjs.parentNode) fjs.parentNode.insertBefore(js, fjs);
70
+ })(document, 'script', 'facebook-jssdk');
71
+ }
72
+ }
73
+
74
+ private static init() {
75
+ Facebook.setup();
76
+ Facebook.sdk();
77
+ }
78
+
79
+ private static setup() {
80
+ (window as any).fbAsyncInit = () => {
81
+ FB.init({
82
+ appId: FACEBOOK_APP_ID,
83
+ cookie: true,
84
+ xfbml: false,
85
+ version: 'v3.2',
86
+ });
87
+
88
+ FB.getLoginStatus(() => {});
89
+
90
+ delete (window as any).fbAsyncInit;
91
+ };
92
+ }
93
+
94
+ private static async status(response: any) {
95
+ let action: 'login' | 'register' | 'connect' = 'login';
96
+ let data = new FormData();
97
+
98
+ if (response) {
99
+ if ('connected' === response.status) {
100
+ data.append('facebook_id', response.authResponse.userID);
101
+ data.append('social_network', 'facebook');
102
+
103
+ if (Facebook.gr && Facebook.gr.isLogged()) action = 'connect';
104
+ } else if ('register' === response.status) {
105
+ await new Promise((resolve, reject) => {
106
+ try {
107
+ FB.api('/me?fields=id,email,name,locale,token_for_business', (fields: any) => {
108
+ FB.api(
109
+ '/me/picture',
110
+ {
111
+ redirect: false,
112
+ height: '200',
113
+ type: 'normal',
114
+ width: '200',
115
+ },
116
+ (picture: any) => {
117
+ action = 'register';
118
+
119
+ data.append('facebook_id', fields.id);
120
+ data.append('email', fields.email);
121
+ data.append('name', fields.name);
122
+ data.append('language', fields.locale);
123
+ data.append('avatar', picture && !picture.error && !picture.data.is_silhouette ? picture.data.url : false);
124
+ data.append('fb_token', fields.token_for_business);
125
+
126
+ resolve({
127
+ fields: fields,
128
+ picture: picture,
129
+ });
130
+ },
131
+ );
132
+ });
133
+ } catch (err) {
134
+ reject(err);
135
+ }
136
+ });
137
+ }
138
+ }
139
+
140
+ let auth: any = await Facebook.auth(action, data);
141
+
142
+ if ('register' === auth.data.status) {
143
+ auth = await Facebook.status({
144
+ status: 'register',
145
+ });
146
+
147
+ if (true === auth.data.status) {
148
+ auth = await Facebook.connect();
149
+ }
150
+ }
151
+
152
+ return auth;
153
+ }
154
+ }
@@ -0,0 +1,127 @@
1
+ /// <reference types="gapi.auth2" />
2
+
3
+ import Social from './index';
4
+
5
+ export default class Google extends Social {
6
+ private static loaded: boolean = false;
7
+ private static auth2: gapi.auth2.GoogleAuth;
8
+
9
+ public static getInstance() {
10
+ Google.init();
11
+
12
+ return Google;
13
+ }
14
+
15
+ public static async connect() {
16
+ if (!Google.loaded) {
17
+ return;
18
+ }
19
+
20
+ return gapi.auth2
21
+ .getAuthInstance()
22
+ .signIn({
23
+ scope: 'email profile',
24
+ })
25
+ .then(() => Google.status());
26
+ }
27
+
28
+ public static disconnect() {
29
+ if (Google.gr && Google.gr.isLogged()) {
30
+ gapi.auth2
31
+ .getAuthInstance()
32
+ .signOut()
33
+ .then((response: GoogleApiOAuth2TokenObject) => {
34
+ if (response && !response.error) {
35
+ let data = new FormData();
36
+
37
+ try {
38
+ var result = gapi.auth.getToken();
39
+ var request = new XMLHttpRequest();
40
+
41
+ request.open('GET', 'https://accounts.google.com/o/oauth2/revoke?token=' + result.access_token, false);
42
+ request.send();
43
+ } catch (e) {}
44
+
45
+ data.append('social_network', 'google');
46
+
47
+ Google.request('DELETE', 'profile/connect', data);
48
+ Google.connected = false;
49
+ }
50
+ });
51
+ }
52
+ }
53
+
54
+ private static sdk() {
55
+ if (!document.getElementById('google-jssdk')) {
56
+ (function(d, s, id) {
57
+ var js,
58
+ fjs = d.getElementsByTagName(s)[0];
59
+
60
+ if (d.getElementById(id)) return;
61
+
62
+ js = d.createElement(s) as HTMLScriptElement;
63
+
64
+ js.id = id;
65
+ js.src = 'https://apis.google.com/js/api:client.js?onload=google_init';
66
+
67
+ if (fjs.parentNode) fjs.parentNode.insertBefore(js, fjs);
68
+ })(document, 'script', 'google-jssdk');
69
+ }
70
+ }
71
+
72
+ private static init() {
73
+ Google.setup();
74
+ Google.sdk();
75
+ }
76
+
77
+ private static setup() {
78
+ (window as any).google_init = async function() {
79
+ await new Promise(resolve => {
80
+ gapi.load('client:auth2', () => resolve());
81
+ });
82
+
83
+ Google.auth2 = gapi.auth2.init({
84
+ client_id: GOOGLE_CLIENT_ID,
85
+ });
86
+
87
+ Google.loaded = true;
88
+
89
+ delete (window as any).google_init;
90
+ };
91
+ }
92
+
93
+ private static async status() {
94
+ let user: gapi.auth2.GoogleUser;
95
+ if (true == this.auth2.isSignedIn.get()) {
96
+ user = Google.auth2.currentUser.get();
97
+ } else {
98
+ user = await new Promise(resolve => {
99
+ Google.auth2.signIn().then(function() {
100
+ resolve(Google.auth2.currentUser.get());
101
+ });
102
+ });
103
+ }
104
+ try {
105
+ const token = user.getAuthResponse().id_token;
106
+ let action: 'login' | 'connect' = 'connect';
107
+ let form: FormData = new FormData();
108
+ if (Google.gr && Google.gr.isLogged()) {
109
+ action = 'connect';
110
+ Google.connected = true;
111
+ form.append('token', token);
112
+ form.append('social_network', 'google');
113
+ } else {
114
+ const profile = user.getBasicProfile();
115
+ action = 'login';
116
+ form.append('token', token);
117
+ form.append('email', profile.getEmail());
118
+ form.append('name', profile.getGivenName());
119
+ form.append('avatar', profile.getImageUrl());
120
+ }
121
+
122
+ return Google.auth(action, form);
123
+ } catch (e) {
124
+ throw Error(e);
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,35 @@
1
+ declare var gr: any;
2
+
3
+ export default class Social {
4
+ public static connected: boolean = false;
5
+ public static gr = 'undefined' === typeof gr ? undefined : gr;
6
+
7
+ public static request(method: 'DELETE' | 'POST', url: string, data?: FormData) {
8
+ return new Promise((resolve, reject) => {
9
+ const req = new XMLHttpRequest();
10
+
11
+ req.addEventListener('load', () => {
12
+ try {
13
+ if (req.status !== 200) {
14
+ reject(req.response);
15
+ }
16
+
17
+ resolve(JSON.parse(req.response));
18
+ }
19
+ catch (e) {
20
+ reject('Error reading response (json):' + req.response);
21
+ }
22
+ });
23
+
24
+ req.open(method, url);
25
+ req.setRequestHeader('X-Requested-With', 'xmlhttprequest');
26
+ req.send.apply(null, data);
27
+ });
28
+ }
29
+
30
+ public static auth(action: 'login' | 'register' | 'connect', data: FormData) {
31
+ if ('undefined' !== typeof gr) {
32
+ return gr.socialAuthHandler(action, data);
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,65 @@
1
+ import Social from './index';
2
+ import { pu } from './dependency/twitter_pu.js';
3
+
4
+ declare const gr: any;
5
+
6
+ export default class Twitter extends Social {
7
+ public static register: Function;
8
+
9
+ public static getInstance() {
10
+ return Twitter;
11
+ }
12
+
13
+ public static status(args: {
14
+ result: 'login' | 'register' | 'connect';
15
+ twitter_id?: string;
16
+ username?: string;
17
+ language?: string;
18
+ avatar?: string;
19
+ message?: string;
20
+ [name: string]: any;
21
+ }) {
22
+ let data = new FormData();
23
+
24
+ if ('function' === typeof Twitter.register) {
25
+ data.append('twitter_id', args.twitter_id || '0');
26
+
27
+ if (args.result.match(/error/) && args.message) {
28
+ throw Error(args.message);
29
+ }
30
+
31
+ if (args.result.match(/login|connect/)) {
32
+ Twitter.auth(args.result, data);
33
+ }
34
+
35
+ if (args.result.match(/register/) && 'function' === typeof Twitter.register) {
36
+ data.append('username', args.username || '');
37
+ data.append('avatar', args.avatar || '');
38
+
39
+ Twitter.register(data);
40
+ }
41
+ }
42
+ }
43
+
44
+ public static async connect() {
45
+ pu('/profile/twitter/redirect_authorize_url');
46
+
47
+ const response = await new Promise((resolve, reject) => {
48
+ (window as any).twitter_connection_status = function(response: any) {
49
+ resolve(response);
50
+ };
51
+
52
+ setTimeout(reject, 5000);
53
+ });
54
+
55
+ Twitter.status(<any>response);
56
+ }
57
+
58
+ public static disconnect() {
59
+ if (gr.auth.logged) {
60
+ gr.request.delete('profile/connect', { social_network: 'twitter' });
61
+
62
+ Twitter.connected = false;
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,9 @@
1
+ export function IsUrlValid(url: string) {
2
+ let regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;
3
+
4
+ if (regexp.test(url)) {
5
+ return true;
6
+ }
7
+
8
+ return false;
9
+ }
@@ -0,0 +1,57 @@
1
+ (function (root) {
2
+ 'use strict';
3
+
4
+ function NumberAbbreviate() {
5
+ var units
6
+ if (!(this instanceof NumberAbbreviate)) {
7
+ // function usage: abbrev(n, decPlaces, units)
8
+ var n = arguments[0]
9
+ var decPlaces = arguments[1]
10
+ var floor = !!arguments[2]
11
+ units = arguments[3]
12
+ var ab = new NumberAbbreviate(units)
13
+ return ab.abbreviate(n, decPlaces, floor)
14
+ }
15
+ // class usage: new NumberAbbreviate(units)
16
+ units = arguments[0]
17
+ this.units = units == null ? ['k', 'm', 'b', 't'] : units
18
+ }
19
+
20
+ NumberAbbreviate.prototype._abbreviate = function (number, decPlaces, floor) {
21
+ decPlaces = Math.pow(10, decPlaces)
22
+
23
+ for (var i = this.units.length - 1; i >= 0; i--) {
24
+
25
+ var size = Math.pow(10, (i + 1) * 3)
26
+
27
+ if (size <= number) {
28
+ number = Math[floor ? 'floor' : 'round'](number * decPlaces / size) / decPlaces
29
+
30
+ if ((number === 1000) && (i < this.units.length - 1)) {
31
+ number = 1
32
+ i++
33
+ }
34
+
35
+ number += this.units[i]
36
+
37
+ break
38
+ }
39
+ }
40
+
41
+ return number
42
+ }
43
+
44
+ NumberAbbreviate.prototype.abbreviate = function (number, decPlaces, floor) {
45
+ var isNegative = number < 0
46
+ var abbreviatedNumber = this._abbreviate(Math.abs(number), decPlaces || 0, floor)
47
+
48
+ return isNegative ? '-' + abbreviatedNumber : abbreviatedNumber;
49
+ }
50
+
51
+ if (typeof module !== 'undefined' && module.exports) {
52
+ module.exports = NumberAbbreviate
53
+ } else {
54
+ root.NumberAbbreviate = NumberAbbreviate
55
+ }
56
+
57
+ })(this);
@@ -0,0 +1,7 @@
1
+ var Settings = require('Project/settings.json');
2
+
3
+ Object.keys(Settings.breakpoints).map(function(key) {
4
+ Settings.breakpoints[key] = parseFloat(Settings.breakpoints[key]);
5
+ });
6
+
7
+ export { Settings };