From cd2053f2dde16c28765fc974d6c5c303821012a9 Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Mon, 5 Nov 2018 16:07:32 +0100 Subject: [PATCH 01/31] Correcting the userId fetching to avoid possible loops --- server/src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/src/index.js b/server/src/index.js index 0ef91a3a2..aed90211f 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -18,12 +18,15 @@ async function getUserId (authId) { } const userData = await axios({ - url: process.env.GRAPHQL_API_URL, + url: process.env.USERS_API_URL, method: 'post', + headers: { + preshared: USERS_API_PRESHARED + }, data: { query: ` { - users_UserByAuthId(authId: "${authId}") + userByAuthId(authId: "${authId}") { id } @@ -31,7 +34,7 @@ async function getUserId (authId) { ` } }) - return userData.data.data.users_UserByAuthId.id + return userData.data.data.userByAuthId.id } catch (error) { return (error) } From f889f6c93c9cde5f61f12b0e6ed9bbe453864c9a Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Mon, 5 Nov 2018 18:44:02 +0100 Subject: [PATCH 02/31] typo on last commit --- server/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/index.js b/server/src/index.js index aed90211f..1c7549d00 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -21,7 +21,7 @@ async function getUserId (authId) { url: process.env.USERS_API_URL, method: 'post', headers: { - preshared: USERS_API_PRESHARED + preshared: process.env.USERS_API_PRESHARED }, data: { query: ` From 59669f23e73eb1973993d67c18761ced0e6a482b Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Tue, 6 Nov 2018 04:15:17 +0100 Subject: [PATCH 03/31] Setting "cache-and-network" as default fetch policy --- client/src/graphql/apollo.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/graphql/apollo.js b/client/src/graphql/apollo.js index cbe378fba..006367f4d 100644 --- a/client/src/graphql/apollo.js +++ b/client/src/graphql/apollo.js @@ -73,8 +73,23 @@ const authLink = setContext((_, { headers }) => { const cache = new InMemoryCache().restore(window.__APOLLO_STATE__) +const defaultOptions = { + watchQuery: { + fetchPolicy: 'cache-and-network', + errorPolicy: 'all' + }, + query: { + fetchPolicy: 'cache-and-network', + errorPolicy: 'all' + }, + mutate: { + errorPolicy: 'all' + } +} + export const client = new ApolloClient({ link: ApolloLink.from([authRetryLink, authLink, httpLink]), // replaced link with httpLink cache, + defaultOptions, connectToDevTools: true }) From 13f176656a49f923bb14ee0983c5e7b4cfa0facf Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 6 Nov 2018 16:37:20 +0100 Subject: [PATCH 04/31] Revert "New version Users Module .17" This reverts commit 8ed5da6129e96ae85fbf06f4ae52ba90f4ea992c. --- client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index 28b6964d8..8d8d7471d 100644 --- a/client/package.json +++ b/client/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@advancedalgos/key-vault-client": "^0.0.20", "@advancedalgos/teams-client": "0.0.24", - "@advancedalgos/users-client": "^0.0.17", + "@advancedalgos/users-client": "^0.0.16", "@advancedalgos/events-client": "^0.0.1", "@advancedalgos/web-components": "0.0.13", "@babel/core": "^7.1.2", From 9f37169ba0a78dd7496dc54cd43d1d7aa1ec01c5 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 6 Nov 2018 16:33:55 +0100 Subject: [PATCH 05/31] Revert "Charts Integration" This reverts commit 34f2c35087b8388df6be8e4a67bbf0e4db1cae87. --- client/html/index.html | 33 ++++++++++++++----------- client/package.json | 2 +- client/src/views/charts/index.js | 41 ++------------------------------ client/src/views/header/index.js | 13 +++++++++- 4 files changed, 34 insertions(+), 55 deletions(-) diff --git a/client/html/index.html b/client/html/index.html index 815824fb7..f4b045162 100644 --- a/client/html/index.html +++ b/client/html/index.html @@ -35,28 +35,31 @@ - + -
+ + +
@@ -135,5 +138,7 @@ + + diff --git a/client/package.json b/client/package.json index 8d8d7471d..4afb60972 100644 --- a/client/package.json +++ b/client/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@advancedalgos/key-vault-client": "^0.0.20", "@advancedalgos/teams-client": "0.0.24", - "@advancedalgos/users-client": "^0.0.16", + "@advancedalgos/users-client": "^0.0.15", "@advancedalgos/events-client": "^0.0.1", "@advancedalgos/web-components": "0.0.13", "@babel/core": "^7.1.2", diff --git a/client/src/views/charts/index.js b/client/src/views/charts/index.js index 60bce90a4..8cf31ef85 100644 --- a/client/src/views/charts/index.js +++ b/client/src/views/charts/index.js @@ -32,8 +32,6 @@ class Charts extends Component { let body = document.getElementById('body') body.style = 'margin: 0px; padding: 0px; border: 0px; overflow:hidden;' this.props.hideFooter() - - window.dispatchEvent(new Event('load')) // This is a workaround to solve the problem that the slider does not show up } componentWillUnmount () { @@ -43,45 +41,10 @@ class Charts extends Component { this.props.showFooter() } - addSlider () { - return ( -
-
-
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Advanced Algos Charts

    -

    -
    Map of markets and competitions. -

    -
    -
    -
    -
    -
    -
  • -
-
-
-
-
-
- ) - } - render () { + const { classes } = this.props return ( - - {this.addSlider()} - + ) } } diff --git a/client/src/views/header/index.js b/client/src/views/header/index.js index eee420eb0..ad210042e 100644 --- a/client/src/views/header/index.js +++ b/client/src/views/header/index.js @@ -117,10 +117,21 @@ class Header extends Component { Home -
  • +
  • +
  • '; -userpopUpHTML +='
  • '; - -jQuery('body').append(userpopUpHTML); diff --git a/client/js/utils.js b/client/js/utils.js deleted file mode 100644 index a10ce5ac3..000000000 --- a/client/js/utils.js +++ /dev/null @@ -1,1103 +0,0 @@ -//============================================================= -//== Stylesheets manipulations -//============================================================= -function setStateStyleSheet(title, state) { - "use strict"; - var i, a; - for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { - if (a.getAttribute("title") == title) a.disabled = !state; - } - } -} - -function getStateStyleSheet(title, state) { - "use strict"; - var i, a, rez=-1; - for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { - if (a.getAttribute("title") == title) { - rez = a.disabled ? 0 : 1; - break; - } - } - } - return rez; -} - -function setActiveStyleSheet(title, disableOther) { - "use strict"; - var i, a, main; - for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { - if (disableOther) a.disabled = true; - if (a.getAttribute("title") == title) a.disabled = false; - } - } -} - -function getActiveStyleSheet() { - "use strict"; - var i, a; - for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); - } - return null; -} - -function getPreferredStyleSheet() { - "use strict"; - var i, a; - for (i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ) - return a.getAttribute("title"); - } - return null; -} - - -//============================================================= -//== ListBox & ComboBox manipulations -//============================================================= -function addListBoxItem(box, val, text) { - "use strict"; - var item = new Option(); - item.value = val; - item.text = text; - box.options.add(item); -} - -function clearListBox(box) { - "use strict"; - for (var i=box.options.length-1; i>=0; i--) - box.options[i] = null; -} - -function delListBoxItemByValue(box, val) { - "use strict"; - for (var i=0; i temp_opts[y].text) { - temp = temp_opts[x]; - temp_opts[x] = temp_opts[y]; - temp_opts[y] = temp; - } - } - } - for(var i=0; i thearray[y]) { - tmp = thearray[x]; - thearray[x] = thearray[y]; - thearray[y] = tmp; - } - } else { - if (thearray[x].toLowerCase() > thearray[y].toLowerCase()) { - tmp = thearray[x]; - thearray[x] = thearray[y]; - thearray[y] = tmp; - } - } - } - } -} - - -//============================================================= -//== String functions -//============================================================= -function inList(list, str) { - "use strict"; - var delim = arguments[2] ? arguments[2] : '|'; - var icase = arguments[3] ? arguments[3] : true; - var retval = false; - if (icase) { - str = str.toLowerCase(); - list = list.toLowerCase(); - } - var parts = list.split(delim); - for (var i=0; i=0; i--) { - if (str.substr(i,1)!=' ') { - end = i; - break; - } - } - } - return str.substring(start, end+1); -} - -function ltrim(str) { - "use strict"; - return alltrim(str, 'l'); -} - -function rtrim(str) { - "use strict"; - return alltrim(str, 'r'); -} - -function padl(str, len) { - "use strict"; - var ch = arguments[2] ? arguments[2] : ' '; - var rez = str.substr(0,len); - if (rez.length < len) { - for (var i=0; i0) decimals--; - var ch = num.substr(i,1); - if (ch=='.') { - if (precision>0) { - res += ch; - } - decimals = precision; - } else if ((ch>=0 && ch<=9) || (ch=='-' && i==0)) - res+=ch; - } - if (precision>0 && decimals!=0) { - if (decimals==-1) { - res += '.'; - decimals = precision; - } - for (i=decimals; i>0; i--) - res +='0'; - } - //if (isNaN(res)) res = clearNumber(defa, precision, defa); - return res; -} - -function dec2hex(n) { - "use strict"; - return Number(n).toString(16); -} - -function hex2dec(hex) { - "use strict"; - return parseInt(hex,16); -} - -function roundNumber(num) { - "use strict"; - var precision = arguments[1] ? arguments[1] : 0; - var p = Math.pow(10,precision); - return Math.round(num*p)/p; -} - -//============================================================= -//== Color manipulations -//============================================================= -function hex2rgb(hex) { - hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16); - return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)}; -} - -function rgb2hex(color) { - "use strict"; - var aRGB; - color = color.replace(/\s/g,"").toLowerCase(); - if (color=='rgba(0,0,0,0)' || color=='rgba(0%,0%,0%,0%)') - color = 'transparent'; - if (color.indexOf('rgba(')==0) - aRGB = color.match(/^rgba\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i); - else - aRGB = color.match(/^rgb\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i); - - if(aRGB) { - color = ''; - for (var i=1; i<=3; i++) - color += Math.round((aRGB[i][aRGB[i].length-1]=="%"?2.55:1)*parseInt(aRGB[i])).toString(16).replace(/^(.)$/,'0$1'); - } else - color = color.replace(/^#?([\da-f])([\da-f])([\da-f])$/i, '$1$1$2$2$3$3'); - return (color.substr(0,1)!='#' ? '#' : '') + color; -} - -function _rgb2hex(r,g,b) { - "use strict"; - return '#'+ - Number(r).toString(16).toUpperCase().replace(/^(.)$/,'0$1') + - Number(g).toString(16).toUpperCase().replace(/^(.)$/,'0$1') + - Number(b).toString(16).toUpperCase().replace(/^(.)$/,'0$1'); -} - -function hex2hsb(hex) { - "use strict"; - return rgb2hsb(hex2rgb(hex)); -} - -function hsb2hex(hsb) { - var rgb = hsb2rgb(hsb); - return _rgb2hex(rgb.r, rgb.g, rgb.b); -} - -function rgb2hsb(rgb) { - "use strict"; - var hsb = {}; - hsb.b = Math.max(Math.max(rgb.r,rgb.g),rgb.b); - hsb.s = (hsb.b <= 0) ? 0 : Math.round(100*(hsb.b - Math.min(Math.min(rgb.r,rgb.g),rgb.b))/hsb.b); - hsb.b = Math.round((hsb.b /255)*100); - if ((rgb.r==rgb.g) && (rgb.g==rgb.b)) hsb.h = 0; - else if (rgb.r>=rgb.g && rgb.g>=rgb.b) hsb.h = 60*(rgb.g-rgb.b)/(rgb.r-rgb.b); - else if (rgb.g>=rgb.r && rgb.r>=rgb.b) hsb.h = 60 + 60*(rgb.g-rgb.r)/(rgb.g-rgb.b); - else if (rgb.g>=rgb.b && rgb.b>=rgb.r) hsb.h = 120 + 60*(rgb.b-rgb.r)/(rgb.g-rgb.r); - else if (rgb.b>=rgb.g && rgb.g>=rgb.r) hsb.h = 180 + 60*(rgb.b-rgb.g)/(rgb.b-rgb.r); - else if (rgb.b>=rgb.r && rgb.r>=rgb.g) hsb.h = 240 + 60*(rgb.r-rgb.g)/(rgb.b-rgb.g); - else if (rgb.r>=rgb.b && rgb.b>=rgb.g) hsb.h = 300 + 60*(rgb.r-rgb.b)/(rgb.r-rgb.g); - else hsb.h = 0; - hsb.h = Math.round(hsb.h); - return hsb; -} - -function hsb2rgb(hsb) { - var rgb = {}; - var h = Math.round(hsb.h); - var s = Math.round(hsb.s*255/100); - var v = Math.round(hsb.b*255/100); - if (s == 0) { - rgb.r = rgb.g = rgb.b = v; - } else { - var t1 = v; - var t2 = (255-s)*v/255; - var t3 = (t1-t2)*(h%60)/60; - if (h==360) h = 0; - if (h<60) { rgb.r=t1; rgb.b=t2; rgb.g=t2+t3; } - else if (h<120) { rgb.g=t1; rgb.b=t2; rgb.r=t1-t3; } - else if (h<180) { rgb.g=t1; rgb.r=t2; rgb.b=t2+t3; } - else if (h<240) { rgb.b=t1; rgb.r=t2; rgb.g=t1-t3; } - else if (h<300) { rgb.b=t1; rgb.g=t2; rgb.r=t2+t3; } - else if (h<360) { rgb.r=t1; rgb.g=t2; rgb.b=t1-t3; } - else { rgb.r=0; rgb.g=0; rgb.b=0; } - } - return { r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b) }; -} - -function split_rgb(color) { - "use strict"; - color = rgb2hex(color); - var matches = color.match(/^#?([\dabcdef]{2})([\dabcdef]{2})([\dabcdef]{2})$/i); - if (!matches) return false; - for (var i=1, rgb = new Array(3); i<=3; i++) - rgb[i-1] = parseInt(matches[i],16); - return rgb; -} - -function iColorPicker(){ - "use strict"; - var id = arguments[0] ? arguments[0] : "iColorPicker"+Math.round(Math.random()*1000); - var colors = arguments[1] ? arguments[1] : - '#f00,#ff0,#0f0,#0ff,#00f,#f0f,#fff,#ebebeb,#e1e1e1,#d7d7d7,#cccccc,#c2c2c2,#b7b7b7,#acacac,#a0a0a0,#959595,' - +'#ee1d24,#fff100,#00a650,#00aeef,#2f3192,#ed008c,#898989,#7d7d7d,#707070,#626262,#555,#464646,#363636,#262626,#111,#000,' - +'#f7977a,#fbad82,#fdc68c,#fff799,#c6df9c,#a4d49d,#81ca9d,#7bcdc9,#6ccff7,#7ca6d8,#8293ca,#8881be,#a286bd,#bc8cbf,#f49bc1,#f5999d,' - +'#f16c4d,#f68e54,#fbaf5a,#fff467,#acd372,#7dc473,#39b778,#16bcb4,#00bff3,#438ccb,#5573b7,#5e5ca7,#855fa8,#a763a9,#ef6ea8,#f16d7e,' - +'#ee1d24,#f16522,#f7941d,#fff100,#8fc63d,#37b44a,#00a650,#00a99e,#00aeef,#0072bc,#0054a5,#2f3192,#652c91,#91278f,#ed008c,#ee105a,' - +'#9d0a0f,#a1410d,#a36209,#aba000,#588528,#197b30,#007236,#00736a,#0076a4,#004a80,#003370,#1d1363,#450e61,#62055f,#9e005c,#9d0039,' - +'#790000,#7b3000,#7c4900,#827a00,#3e6617,#045f20,#005824,#005951,#005b7e,#003562,#002056,#0c004b,#30004a,#4b0048,#7a0045,#7a0026'; - var colorsList = colors.split(','); - var tbl = ''; - for (var i=0; i0 ? '' : '') + ''; - tbl += ''; - } - tbl += '' - + '' - + '' - + '' - + '
     
    ' - + '' - + '' - + '' - + '' - + '
    '; - //tbl += ''; - - jQuery(document.createElement("div")) - .attr("id", id) - .css('display','none') - .html(tbl) - .appendTo("body") - .addClass("iColorPickerTable") - .on('mouseover', 'thead td', function(){ - "use strict"; - var aaa=rgb2hex(jQuery(this).css('background-color')); - jQuery('#'+id+'_colorPreview').css('background',aaa); - jQuery('#'+id+'_colorPreview input').val(aaa); - }) - .on('keypress', '#'+id+'_colorPreview input', function(key){ - "use strict"; - var aaa=jQuery(this).val() - if (aaa.length<7 && ((key.which>=48 && key.which<=57) || (key.which>=97 && key.which<=102) || (key.which===35 || aaa.length===0))) { - aaa += String.fromCharCode(key.which); - } else if (key.which == 8 && aaa.length>0) { - aaa = aaa.substring(0, aaa.length-1); - } else if (key.which===13 && (aaa.length===4 || aaa.length===7)) { - var fld = jQuery('#'+id).data('field'); - var func = jQuery('#'+id).data('func'); - if (func!=null && func!='undefined') { - func(fld, aaa); - } else { - fld.val(aaa).css('backgroundColor', aaa).trigger('change'); - } - jQuery('#'+id+'_Bg').fadeOut(500); - jQuery('#'+id).fadeOut(500); - - } else { - key.preventDefault(); - return false; - } - if (aaa.substr(0,1)==='#' && (aaa.length===4 || aaa.length===7)) { - jQuery('#'+id+'_colorPreview').css('background',aaa); - } - }) - .on('click', 'thead td', function(e){ - "use strict"; - var fld = jQuery('#'+id).data('field'); - var func = jQuery('#'+id).data('func'); - var aaa = rgb2hex(jQuery(this).css('background-color')); - if (func!=null && func!='undefined') { - func(fld, aaa); - } else { - fld.val(aaa).css('backgroundColor', aaa).trigger('change'); - } - jQuery('#'+id+'_Bg').fadeOut(500); - jQuery('#'+id).fadeOut(500); - e.preventDefault(); - return false; - }) - .on('click', 'tbody .iColorPicker_moreColors', function(e){ - "use strict"; - var thead = jQuery(this).parents('table').find('thead'); - var out = ''; - if (thead.hasClass('more_colors')) { - for (var i=0; i0 ? '' : '') + ''; - out += ' '; - } - thead.removeClass('more_colors').empty().html(out+''); - jQuery('#'+id+'_colorPreview').attr('colspan', 8); - jQuery('#'+id+'_colorOriginal').attr('colspan', 8); - } else { - var rgb=[0,0,0], i=0, j=-1; // Set j=-1 or j=0 - show 2 different colors layouts - while (rgb[0]<0xF || rgb[1]<0xF || rgb[2]<0xF) { - if (i%18==0) out += (i>0 ? '' : '') + ''; - i++; - out += ' '; - rgb[2]+=3; - if (rgb[2]>0xF) { - rgb[1]+=3; - if (rgb[1]>(j===0 ? 6 : 0xF)) { - rgb[0]+=3; - if (rgb[0]>0xF) { - if (j===0) { - j=1; - rgb[0]=0; - rgb[1]=9; - rgb[2]=0; - } else { - break; - } - } else { - rgb[1]=(j < 1 ? 0 : 9); - rgb[2]=0; - } - } else { - rgb[2]=0; - } - } - } - thead.addClass('more_colors').empty().html(out+' '); - jQuery('#'+id+'_colorPreview').attr('colspan', 9); - jQuery('#'+id+'_colorOriginal').attr('colspan', 9); - } - jQuery('#'+id+' table.colorPickerTable thead td') - .css({ - 'width':'12px', - 'height':'14px', - 'border':'1px solid #000', - 'cursor':'pointer' - }); - e.preventDefault(); - return false; - }); - jQuery(document.createElement("div")) - .attr("id", id+"_Bg") - .click(function(e) { - "use strict"; - jQuery("#"+id+"_Bg").fadeOut(500); - jQuery("#"+id).fadeOut(500); - e.preventDefault(); - return false; - }) - .appendTo("body"); - jQuery('#'+id+' table.colorPickerTable thead td') - .css({ - 'width':'12px', - 'height':'14px', - 'border':'1px solid #000', - 'cursor':'pointer' - }); - jQuery('#'+id+' table.colorPickerTable') - .css({'border-collapse':'collapse'}); - jQuery('#'+id) - .css({ - 'border':'1px solid #ccc', - 'background':'#333', - 'padding':'5px', - 'color':'#fff', - 'z-index':999999 - }); - jQuery('#'+id+'_colorPreview') - .css({'height':'50px'}); - return id; -} - -function iColorShow(id, fld, func) { - "use strict"; - if (id===null || id==='') { - id = jQuery('.iColorPickerTable').attr('id'); - } - var eICP = fld.offset(); - var w = jQuery('#'+id).width(); - var h = jQuery('#'+id).height(); - var l = eICP.left + w < jQuery(window).width()-10 ? eICP.left : jQuery(window).width()-10 - w; - var t = eICP.top + fld.outerHeight() + h < jQuery(document).scrollTop() + jQuery(window).height()-10 ? eICP.top + fld.outerHeight() : eICP.top - h - 13; - jQuery("#"+id) - .data({field: fld, func: func}) - .css({ - 'top':t+"px", - 'left':l+"px", - 'position':'absolute', - 'z-index':100001 - }) - .fadeIn(500); - jQuery("#"+id+"_Bg") - .css({ - 'position':'fixed', - 'z-index':100000, - 'top':0, - 'left':0, - 'width':'100%', - 'height':'100%' - }) - .fadeIn(500); - var def = fld.val().substr(0, 1)=='#' ? fld.val() : rgb2hex(fld.css('backgroundColor')); - jQuery('#'+id+'_colorPreview input,#'+id+'_colorOriginal input').val(def); - jQuery('#'+id+'_colorPreview,#'+id+'_colorOriginal').css('background',def); -} - - -//============================================================= -//== Cookies manipulations -//============================================================= -function getCookie(name) { - "use strict"; - var defa = arguments[1]!='undefined' ? arguments[1] : null; - var start = document.cookie.indexOf(name + '='); - var len = start + name.length + 1; - if ((!start) && (name != document.cookie.substring(0, name.length))) { - return defa; - } - if (start == -1) - return defa; - var end = document.cookie.indexOf(';', len); - if (end == -1) - end = document.cookie.length; - return unescape(document.cookie.substring(len, end)); -} - - -function setCookie(name, value, expires, path, domain, secure) { - "use strict"; - var today = new Date(); - today.setTime(today.getTime()); - if (expires) { - expires = expires * 1000; // * 60 * 60 * 24; - } - var expires_date = new Date(today.getTime() + (expires)); - document.cookie = name + '=' - + escape(value) - + ((expires) ? ';expires=' + expires_date.toGMTString() : '') - + ((path) ? ';path=' + path : '') - + ((domain) ? ';domain=' + domain : '') - + ((secure) ? ';secure' : ''); -} - - -function deleteCookie(name, path, domain) { - "use strict"; - if (getCookie(name)) - document.cookie = name + '=' + ((path) ? ';path=' + path : '') - + ((domain) ? ';domain=' + domain : '') - + ';expires=Thu, 01-Jan-1970 00:00:01 GMT'; -} - - -//============================================================= -//== Date manipulations -//============================================================= - -// Return array[Year, Month, Day, Hours, Minutes, Seconds] -// from string: Year[-/.]Month[-/.]Day[T ]Hours:Minutes:Seconds -function dateParse(dt) { - "use strict"; - dt = dt.replace(/\//g, '-').replace(/\./g, '-').replace(/T/g, ' ').split('+')[0]; - var dt2 = dt.split(' '); - var d = dt2[0].split('-'); - var t = dt2[1].split(':'); - d.push(t[0], t[1], t[2]); - return d; -} - -function dateDifference(dt1) { - "use strict"; - var dt2 = arguments[1]!==undefined ? arguments[1] : ''; - var short_date = arguments[2]!==undefined ? arguments[2] : true; - var sec = arguments[3]!==undefined ? arguments[3] : false; - var a1 = dateParse(dt1); - dt1 = Date.UTC(a1[0], a1[1], a1[2], a1[3], a1[4], a1[5]); - if (dt2 == '') { - dt2 = new Date(); - var a2 = [dt2.getFullYear(), dt2.getMonth()+1, dt2.getDate(), dt2.getHours(), dt2.getMinutes(), dt2.getSeconds()]; - } else - var a2 = dateParse(dt2); - dt2 = Date.UTC(a2[0], a2[1], a2[2], a2[3], a2[4], a2[5]); - var diff = Math.round((dt2 - dt1)/1000); - var days = Math.floor(diff / (24*3600)); - diff -= days * 24 * 3600; - var hours = Math.floor(diff / 3600); - diff -= hours * 3600; - var minutes = Math.floor(diff / 60); - diff -= minutes * 60; - rez = ''; - if (days > 0) - rez += (rez!='' ? ' ' : '') + days + ' day' + (days > 1 ? 's' : ''); - if ((!short_date || rez=='') && hours > 0) - rez += (rez!='' ? ' ' : '') + hours + ' hour' + (hours > 1 ? 's' : ''); - if ((!short_date || rez=='') && minutes > 0) - rez += (rez!='' ? ' ' : '') + minutes + ' minute' + (minutes > 1 ? 's' : ''); - if (sec || rez=='') - rez += rez!='' || sec ? (' ' + diff + ' second' + (diff > 1 ? 's' : '')) : 'less then minute'; - return rez; -} - - - -//============================================================= -//== Form validation -//============================================================= - -/* // Usage example: - var error = formValidate(jQuery(form_selector), { // -------- Options - error_message_show: true, // Display or not error message - error_message_time: 5000, // Time to display error message - error_message_class: 'sc_infobox sc_infobox_style_error', // Class, appended to error message block - error_message_text: 'Global error text', // Global error message text (if don't write message in checked field) - error_fields_class: 'error_fields_class', // Class, appended to error fields - exit_after_first_error: false, // Cancel validation and exit after first error - rules: [ - { - field: 'author', // Checking field name - min_length: { value: 1, message: 'The author name can\'t be empty' }, // Min character count (0 - don't check), message - if error occurs - max_length: { value: 60, message: 'Too long author name'} // Max character count (0 - don't check), message - if error occurs - }, - { - field: 'email', - min_length: { value: 7, message: 'Too short (or empty) email address' }, - max_length: { value: 60, message: 'Too long email address'}, - mask: { value: '^([a-z0-9_\\-]+\\.)*[a-z0-9_\\-]+@[a-z0-9_\\-]+(\\.[a-z0-9_\\-]+)*\\.[a-z]{2,6}$', message: 'Invalid email address'} - }, - { - field: 'comment', - min_length: { value: 1, message: 'The comment text can\'t be empty' }, - max_length: { value: 200, message: 'Too long comment'} - }, - { - field: 'pwd1', - min_length: { value: 5, message: 'The password can\'t be less then 5 characters' }, - max_length: { value: 20, message: 'Too long password'} - }, - { - field: 'pwd2', - equal_to: { value: 'pwd1', message: 'The passwords in both fields must be equals' } - } - ] - }); -*/ - -function formValidate(form, opt) { - "use strict"; - var error_msg = ''; - form.find(":input").each(function() { - "use strict"; - if (error_msg!='' && opt.exit_after_first_error) return; - for (var i = 0; i < opt.rules.length; i++) { - if (jQuery(this).attr("name") == opt.rules[i].field) { - var val = jQuery(this).val(); - var error = false; - if (typeof(opt.rules[i].min_length) == 'object') { - if (opt.rules[i].min_length.value > 0 && val.length < opt.rules[i].min_length.value) { - if (error_msg=='') jQuery(this).get(0).focus(); - error_msg += '

    ' + (typeof(opt.rules[i].min_length.message)!='undefined' ? opt.rules[i].min_length.message : opt.error_message_text ) + '

    ' - error = true; - } - } - if ((!error || !opt.exit_after_first_error) && typeof(opt.rules[i].max_length) == 'object') { - if (opt.rules[i].max_length.value > 0 && val.length > opt.rules[i].max_length.value) { - if (error_msg=='') jQuery(this).get(0).focus(); - error_msg += '

    ' + (typeof(opt.rules[i].max_length.message)!='undefined' ? opt.rules[i].max_length.message : opt.error_message_text ) + '

    ' - error = true; - } - } - if ((!error || !opt.exit_after_first_error) && typeof(opt.rules[i].mask) == 'object') { - if (opt.rules[i].mask.value != '') { - var regexp = new RegExp(opt.rules[i].mask.value); - if (!regexp.test(val)) { - if (error_msg=='') jQuery(this).get(0).focus(); - error_msg += '

    ' + (typeof(opt.rules[i].mask.message)!='undefined' ? opt.rules[i].mask.message : opt.error_message_text ) + '

    ' - error = true; - } - } - } - if ((!error || !opt.exit_after_first_error) && typeof(opt.rules[i].equal_to) == 'object') { - if (opt.rules[i].equal_to.value != '' && val!=jQuery(jQuery(this).get(0).form[opt.rules[i].equal_to.value]).val()) { - if (error_msg=='') jQuery(this).get(0).focus(); - error_msg += '

    ' + (typeof(opt.rules[i].equal_to.message)!='undefined' ? opt.rules[i].equal_to.message : opt.error_message_text ) + '

    ' - error = true; - } - } - if (opt.error_fields_class != '') jQuery(this).toggleClass(opt.error_fields_class, error); - } - } - }); - if (error_msg!='' && opt.error_message_show) { - THEMEREX_error_msg_box = form.find(".result"); - if (THEMEREX_error_msg_box.length == 0) { - form.append('
    '); - THEMEREX_error_msg_box = form.find(".result"); - } - if (opt.error_message_class) THEMEREX_error_msg_box.toggleClass(opt.error_message_class, true); - THEMEREX_error_msg_box.html(error_msg).fadeIn(); - setTimeout(function() { THEMEREX_error_msg_box.fadeOut(); }, opt.error_message_time); - } - return error_msg!=''; -} - - - - -//============================================================= -//== Document manipulations -//============================================================= - -// Animated scroll to selected id -function animateTo(id) { - if (id.indexOf('#')==-1) id = '#' + id; - var obj = jQuery(id).eq(0); - if (obj.length == 0) return; - var oft = jQuery(id).offset().top; - var st = jQuery(window).scrollTop(); - var speed = Math.min(1600, Math.max(400, Math.round(Math.abs(oft-st) / jQuery(window).height() * 100))); - jQuery('body,html').animate( {scrollTop: oft - jQuery('#wpadminbar').height() - jQuery('header.fixedTopMenu .topWrap').height()}, speed, 'swing'); -} - -// Change browser address without reload page -function setLocation(curLoc){ - try { - history.pushState(null, null, curLoc); - return; - } catch(e) {} - location.href = curLoc; -} - - - - -//============================================================= -//== Browser detection -//============================================================= -function isMobile() { - var check = false; - (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera); - return check; -} -function isiOS() { - return navigator.userAgent.match(/iPad|iPhone|iPod/i) != null; -} - - - - -//============================================================= -//== File functions -//============================================================= -function getFileName(path) { - path = path.replace(/\\/g, '/'); - var pos = path.lastIndexOf('/'); - if (pos >= 0) - path = path.substr(pos+1); - return path; -} - -function getFileExt(path) { - var pos = path.lastIndexOf('.'); - path = pos >= 0 ? path.substr(pos+1) : ''; - return path; -} - - - - -//============================================================= -//== PHP-style functions -//============================================================= -function isset(obj) { - return obj != undefined; -} - -function empty(obj) { - return obj == undefined || (typeof(obj)=='object' && obj == null) || (typeof(obj)=='array' && obj.length == 0) || (typeof(obj)=='string' && alltrim(obj)==''); -} - -function is_array(obj) { - "use strict"; - return typeof(obj)=='array'; -} - -function is_object(obj) { - "use strict"; - return typeof(obj)=='object'; -} - -function in_array(val, thearray) { - "use strict"; - var rez = false; - for (var x=0; x0) { - dispStr += (obj===null ? "null" : typeof(obj)) + (html ? "\n
    " : "\n"); - addStr = replicate(html ? ' ' : ' ', level*2); - } - if (obj!==null) { - for (var prop in obj) { - if (!showMethods && typeof(obj[prop])=='function') // || prop=='innerHTML' || prop=='outerHTML' || prop=='innerText' || prop=='outerText') - continue; - if (recursive && (typeof(obj[prop])=='object' || typeof(obj[prop])=='array') && obj[prop]!=obj) - dispStr += addStr + (html ? "" : "")+prop+(html ? "" : "")+'='+objDisplay(obj[prop], html, recursive, showMethods, level+1); - else - dispStr += addStr + (html ? "" : "")+prop+(html ? "" : "")+'='+(typeof(obj[prop])=='string' ? '"' : '')+obj[prop]+(typeof(obj[prop])=='string' ? '"' : '')+(html ? "\n
    " : "\n"); - } - } - return dispStr; -} - -function cl(s) { console.log(s); } -function cd(s) { console.log(objDisplay(s)); } -function al(s) { if (typeof THEMEREX_userLoggedIn != 'undefined' && THEMEREX_userLoggedIn) alert(s); } -function ad(s) { if (typeof THEMEREX_userLoggedIn != 'undefined' && THEMEREX_userLoggedIn) alert(objDisplay(s)); } -function dl(s) { - if (typeof THEMEREX_userLoggedIn != 'undefined' && THEMEREX_userLoggedIn) { - if (jQuery('#debugLog').length == 0) jQuery('body').append('
    x
    '); - jQuery('#debugLogContent').append('
    '+s); - jQuery('#debugLog').show(); - } -} -function dd(s) { - if (typeof THEMEREX_userLoggedIn != 'undefined' && THEMEREX_userLoggedIn) { - if (jQuery('#debugLog').length == 0) jQuery('body').append('
    x
    '); - jQuery('#debugLogContent').html(objDisplay(s)); - jQuery('#debugLog').show(); - } -} - - - - -//============================================================= -//== smartresize -//============================================================= -(function($,sr){ - var debounce = function (func, threshold, execAsap) { - var timeout; - - return function debounced () { - var obj = this, args = arguments; - function delayed () { - if (!execAsap) - func.apply(obj, args); - timeout = null; - }; - - if (timeout) - clearTimeout(timeout); - else if (execAsap) - func.apply(obj, args); - - timeout = setTimeout(delayed, threshold || 500); - }; - } - // smartresize - jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; - -})(jQuery,'smartresize'); \ No newline at end of file diff --git a/client/js/vendor/SmoothScroll.min.js b/client/js/vendor/SmoothScroll.min.js deleted file mode 100644 index 3054f2b9e..000000000 --- a/client/js/vendor/SmoothScroll.min.js +++ /dev/null @@ -1,8 +0,0 @@ -// SmoothScroll for websites v1.2.1 -// Licensed under the terms of the MIT license. - -// People involved -// - Balazs Galambosi (maintainer) -// - Michael Herf (Pulse Algorithm) - -!function(){function e(){var e=!1;e&&c("keydown",r),v.keyboardSupport&&!e&&u("keydown",r)}function t(){if(document.body){var t=document.body,o=document.documentElement,n=window.innerHeight,r=t.scrollHeight;if(S=document.compatMode.indexOf("CSS")>=0?o:t,w=t,e(),x=!0,top!=self)y=!0;else if(r>n&&(t.offsetHeight<=n||o.offsetHeight<=n)){var a=!1,i=function(){a||o.scrollHeight==document.height||(a=!0,setTimeout(function(){o.style.height=document.height+"px",a=!1},500))};if(o.style.height="auto",setTimeout(i,10),S.offsetHeight<=n){var l=document.createElement("div");l.style.clear="both",t.appendChild(l)}}v.fixedBackground||b||(t.style.backgroundAttachment="scroll",o.style.backgroundAttachment="scroll")}}function o(e,t,o,n){if(n||(n=1e3),d(t,o),1!=v.accelerationMax){var r=+new Date,a=r-C;if(a1&&(i=Math.min(i,v.accelerationMax),t*=i,o*=i)}C=+new Date}if(M.push({x:t,y:o,lastX:0>t?.99:-.99,lastY:0>o?.99:-.99,start:+new Date}),!T){var l=e===document.body,u=function(){for(var r=+new Date,a=0,i=0,c=0;c=v.animationTime,h=f?1:d/v.animationTime;v.pulseAlgorithm&&(h=p(h));var m=s.x*h-s.lastX>>0,w=s.y*h-s.lastY>>0;a+=m,i+=w,s.lastX+=m,s.lastY+=w,f&&(M.splice(c,1),c--)}l?window.scrollBy(a,i):(a&&(e.scrollLeft+=a),i&&(e.scrollTop+=i)),t||o||(M=[]),M.length?E(u,e,n/v.frameRate+1):T=!1};E(u,e,0),T=!0}}function n(e){x||t();var n=e.target,r=l(n);if(!r||e.defaultPrevented||s(w,"embed")||s(n,"embed")&&/\.pdf/i.test(n.src))return!0;var a=e.wheelDeltaX||0,i=e.wheelDeltaY||0;return a||i||(i=e.wheelDelta||0),!v.touchpadSupport&&f(i)?!0:(Math.abs(a)>1.2&&(a*=v.stepSize/120),Math.abs(i)>1.2&&(i*=v.stepSize/120),o(r,-a,-i),void e.preventDefault())}function r(e){var t=e.target,n=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==H.spacebar;if(/input|textarea|select|embed/i.test(t.nodeName)||t.isContentEditable||e.defaultPrevented||n)return!0;if(s(t,"button")&&e.keyCode===H.spacebar)return!0;var r,a=0,i=0,u=l(w),c=u.clientHeight;switch(u==document.body&&(c=window.innerHeight),e.keyCode){case H.up:i=-v.arrowScroll;break;case H.down:i=v.arrowScroll;break;case H.spacebar:r=e.shiftKey?1:-1,i=-r*c*.9;break;case H.pageup:i=.9*-c;break;case H.pagedown:i=.9*c;break;case H.home:i=-u.scrollTop;break;case H.end:var d=u.scrollHeight-u.scrollTop-c;i=d>0?d+10:0;break;case H.left:a=-v.arrowScroll;break;case H.right:a=v.arrowScroll;break;default:return!0}o(u,a,i),e.preventDefault()}function a(e){w=e.target}function i(e,t){for(var o=e.length;o--;)z[N(e[o])]=t;return t}function l(e){var t=[],o=S.scrollHeight;do{var n=z[N(e)];if(n)return i(t,n);if(t.push(e),o===e.scrollHeight){if(!y||S.clientHeight+100?1:-1,t=t>0?1:-1,(k.x!==e||k.y!==t)&&(k.x=e,k.y=t,M=[],C=0)}function f(e){if(e){e=Math.abs(e),D.push(e),D.shift(),clearTimeout(A);var t=D[0]==D[1]&&D[1]==D[2],o=h(D[0],120)&&h(D[1],120)&&h(D[2],120);return!(t||o)}}function h(e,t){return Math.floor(e/t)==e/t}function m(e){var t,o,n;return e*=v.pulseScale,1>e?t=e-(1-Math.exp(-e)):(o=Math.exp(-1),e-=1,n=1-Math.exp(-e),t=o+n*(1-o)),t*v.pulseNormalize}function p(e){return e>=1?1:0>=e?0:(1==v.pulseNormalize&&(v.pulseNormalize/=m(1)),m(e))}var w,g={frameRate:150,animationTime:800,stepSize:120,pulseAlgorithm:!0,pulseScale:8,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:!0,arrowScroll:50,touchpadSupport:!0,fixedBackground:!0,excluded:""},v=g,b=!1,y=!1,k={x:0,y:0},x=!1,S=document.documentElement,D=[120,120,120],H={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v=g,M=[],T=!1,C=+new Date,z={};setInterval(function(){z={}},1e4);var A,N=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),E=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)}}(),K=/chrome/i.test(window.navigator.userAgent),L="onmousewheel"in document;L&&K&&(u("mousedown",a),u("mousewheel",n),u("load",t))}(); \ No newline at end of file diff --git a/client/js/vendor/bootstrap.min.js b/client/js/vendor/bootstrap.min.js deleted file mode 100644 index 7c1561a8b..000000000 --- a/client/js/vendor/bootstrap.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Bootstrap v3.2.0 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('