').addClass('scroll-wrapper').addClass(c.attr('class'))
+ .css('position', c.css('position') == 'absolute' ? 'absolute' : 'relative')
+ .insertBefore(c).append(c);
+
+ if (c.is('textarea')) {
+ this.containerWrapper = cw = $('
').insertBefore(c).append(c);
+ w.addClass('scroll-textarea');
+ }
+
+ cw.addClass('scroll-content').css({
+ "height": "auto",
+ "margin-bottom": browser.scroll.height * -1 + 'px',
+ "margin-right": browser.scroll.width * -1 + 'px',
+ "max-height": ""
+ });
+
+ c.on('scroll' + namespace, function (event) {
+ if ($.isFunction(o.onScroll)) {
+ o.onScroll.call(S, {
+ "maxScroll": s.y.maxScrollOffset,
+ "scroll": c.scrollTop(),
+ "size": s.y.size,
+ "visible": s.y.visible
+ }, {
+ "maxScroll": s.x.maxScrollOffset,
+ "scroll": c.scrollLeft(),
+ "size": s.x.size,
+ "visible": s.x.visible
+ });
+ }
+ s.x.isVisible && s.x.scroll.bar.css('left', c.scrollLeft() * s.x.kx + 'px');
+ s.y.isVisible && s.y.scroll.bar.css('top', c.scrollTop() * s.y.kx + 'px');
+ });
+
+ /* prevent native scrollbars to be visible on #anchor click */
+ w.on('scroll' + namespace, function () {
+ w.scrollTop(0).scrollLeft(0);
+ });
+
+ if (o.disableBodyScroll) {
+ var handleMouseScroll = function (event) {
+ isVerticalScroll(event) ?
+ s.y.isVisible && s.y.mousewheel(event) :
+ s.x.isVisible && s.x.mousewheel(event);
+ };
+ w.on('MozMousePixelScroll' + namespace, handleMouseScroll);
+ w.on('mousewheel' + namespace, handleMouseScroll);
+
+ if (browser.mobile) {
+ w.on('touchstart' + namespace, function (event) {
+ var touch = event.originalEvent.touches && event.originalEvent.touches[0] || event;
+ var originalTouch = {
+ "pageX": touch.pageX,
+ "pageY": touch.pageY
+ };
+ var originalScroll = {
+ "left": c.scrollLeft(),
+ "top": c.scrollTop()
+ };
+ $(document).on('touchmove' + namespace, function (event) {
+ var touch = event.originalEvent.targetTouches && event.originalEvent.targetTouches[0] || event;
+ c.scrollLeft(originalScroll.left + originalTouch.pageX - touch.pageX);
+ c.scrollTop(originalScroll.top + originalTouch.pageY - touch.pageY);
+ event.preventDefault();
+ });
+ $(document).on('touchend' + namespace, function () {
+ $(document).off(namespace);
+ });
+ });
+ }
+ }
+ if ($.isFunction(o.onInit)){
+ o.onInit.apply(this, [c]);
+ }
+ } else {
+ cw.css({
+ "height": "auto",
+ "margin-bottom": browser.scroll.height * -1 + 'px',
+ "margin-right": browser.scroll.width * -1 + 'px',
+ "max-height": ""
+ });
+ }
+
+ // init scrollbars & recalculate sizes
+ $.each(s, function (d, scrollx) {
+
+ var scrollCallback = null;
+ var scrollForward = 1;
+ var scrollOffset = (d === 'x') ? 'scrollLeft' : 'scrollTop';
+ var scrollStep = o.scrollStep;
+ var scrollTo = function () {
+ var currentOffset = c[scrollOffset]();
+ c[scrollOffset](currentOffset + scrollStep);
+ if (scrollForward == 1 && (currentOffset + scrollStep) >= scrollToValue)
+ currentOffset = c[scrollOffset]();
+ if (scrollForward == -1 && (currentOffset + scrollStep) <= scrollToValue)
+ currentOffset = c[scrollOffset]();
+ if (c[scrollOffset]() == currentOffset && scrollCallback) {
+ scrollCallback();
+ }
+ }
+ var scrollToValue = 0;
+
+ if (!scrollx.scroll) {
+
+ scrollx.scroll = S._getScroll(o['scroll' + d]).addClass('scroll-' + d);
+
+ if(o.showArrows){
+ scrollx.scroll.addClass('scroll-element_arrows_visible');
+ }
+
+ scrollx.mousewheel = function (event) {
+
+ if (!scrollx.isVisible || (d === 'x' && isVerticalScroll(event))) {
+ return true;
+ }
+ if (d === 'y' && !isVerticalScroll(event)) {
+ s.x.mousewheel(event);
+ return true;
+ }
+
+ var delta = event.originalEvent.wheelDelta * -1 || event.originalEvent.detail;
+ var maxScrollValue = scrollx.size - scrollx.visible - scrollx.offset;
+
+ if ((delta > 0 && scrollToValue < maxScrollValue) || (delta < 0 && scrollToValue > 0)) {
+ scrollToValue = scrollToValue + delta;
+ if (scrollToValue < 0)
+ scrollToValue = 0;
+ if (scrollToValue > maxScrollValue)
+ scrollToValue = maxScrollValue;
+
+ S.scrollTo = S.scrollTo || {};
+ S.scrollTo[scrollOffset] = scrollToValue;
+ setTimeout(function () {
+ if (S.scrollTo) {
+ c.stop().animate(S.scrollTo, 240, 'linear', function () {
+ scrollToValue = c[scrollOffset]();
+ });
+ S.scrollTo = null;
+ }
+ }, 1);
+ }
+
+ event.preventDefault();
+ return false;
+ };
+
+ scrollx.scroll
+ .on('MozMousePixelScroll' + namespace, scrollx.mousewheel)
+ .on('mousewheel' + namespace, scrollx.mousewheel)
+ .on('mouseenter' + namespace, function () {
+ scrollToValue = c[scrollOffset]();
+ });
+
+ // handle arrows & scroll inner mousedown event
+ scrollx.scroll.find('.scroll-arrow, .scroll-element_track')
+ .on('mousedown' + namespace, function (event) {
+
+ if (event.which != 1) // lmb
+ return true;
+
+ scrollForward = 1;
+
+ var data = {
+ "eventOffset": event[(d === 'x') ? 'pageX' : 'pageY'],
+ "maxScrollValue": scrollx.size - scrollx.visible - scrollx.offset,
+ "scrollbarOffset": scrollx.scroll.bar.offset()[(d === 'x') ? 'left' : 'top'],
+ "scrollbarSize": scrollx.scroll.bar[(d === 'x') ? 'outerWidth' : 'outerHeight']()
+ };
+ var timeout = 0, timer = 0;
+
+ if ($(this).hasClass('scroll-arrow')) {
+ scrollForward = $(this).hasClass("scroll-arrow_more") ? 1 : -1;
+ scrollStep = o.scrollStep * scrollForward;
+ scrollToValue = scrollForward > 0 ? data.maxScrollValue : 0;
+ } else {
+ scrollForward = (data.eventOffset > (data.scrollbarOffset + data.scrollbarSize) ? 1
+ : (data.eventOffset < data.scrollbarOffset ? -1 : 0));
+ scrollStep = Math.round(scrollx.visible * 0.75) * scrollForward;
+ scrollToValue = (data.eventOffset - data.scrollbarOffset -
+ (o.stepScrolling ? (scrollForward == 1 ? data.scrollbarSize : 0)
+ : Math.round(data.scrollbarSize / 2)));
+ scrollToValue = c[scrollOffset]() + (scrollToValue / scrollx.kx);
+ }
+
+ S.scrollTo = S.scrollTo || {};
+ S.scrollTo[scrollOffset] = o.stepScrolling ? c[scrollOffset]() + scrollStep : scrollToValue;
+
+ if (o.stepScrolling) {
+ scrollCallback = function () {
+ scrollToValue = c[scrollOffset]();
+ clearInterval(timer);
+ clearTimeout(timeout);
+ timeout = 0;
+ timer = 0;
+ };
+ timeout = setTimeout(function () {
+ timer = setInterval(scrollTo, 40);
+ }, o.duration + 100);
+ }
+
+ setTimeout(function () {
+ if (S.scrollTo) {
+ c.animate(S.scrollTo, o.duration);
+ S.scrollTo = null;
+ }
+ }, 1);
+
+ return S._handleMouseDown(scrollCallback, event);
+ });
+
+ // handle scrollbar drag'n'drop
+ scrollx.scroll.bar.on('mousedown' + namespace, function (event) {
+
+ if (event.which != 1) // lmb
+ return true;
+
+ var eventPosition = event[(d === 'x') ? 'pageX' : 'pageY'];
+ var initOffset = c[scrollOffset]();
+
+ scrollx.scroll.addClass('scroll-draggable');
+
+ $(document).on('mousemove' + namespace, function (event) {
+ var diff = parseInt((event[(d === 'x') ? 'pageX' : 'pageY'] - eventPosition) / scrollx.kx, 10);
+ c[scrollOffset](initOffset + diff);
+ });
+
+ return S._handleMouseDown(function () {
+ scrollx.scroll.removeClass('scroll-draggable');
+ scrollToValue = c[scrollOffset]();
+ }, event);
+ });
+ }
+ });
+
+ // remove classes & reset applied styles
+ $.each(s, function (d, scrollx) {
+ var scrollClass = 'scroll-scroll' + d + '_visible';
+ var scrolly = (d == "x") ? s.y : s.x;
+
+ scrollx.scroll.removeClass(scrollClass);
+ scrolly.scroll.removeClass(scrollClass);
+ cw.removeClass(scrollClass);
+ });
+
+ // calculate init sizes
+ $.each(s, function (d, scrollx) {
+ $.extend(scrollx, (d == "x") ? {
+ "offset": parseInt(c.css('left'), 10) || 0,
+ "size": c.prop('scrollWidth'),
+ "visible": w.width()
+ } : {
+ "offset": parseInt(c.css('top'), 10) || 0,
+ "size": c.prop('scrollHeight'),
+ "visible": w.height()
+ });
+ });
+
+ // update scrollbar visibility/dimensions
+ this._updateScroll('x', this.scrollx);
+ this._updateScroll('y', this.scrolly);
+
+ if ($.isFunction(o.onUpdate)){
+ o.onUpdate.apply(this, [c]);
+ }
+
+ // calculate scroll size
+ $.each(s, function (d, scrollx) {
+
+ var cssOffset = (d === 'x') ? 'left' : 'top';
+ var cssFullSize = (d === 'x') ? 'outerWidth' : 'outerHeight';
+ var cssSize = (d === 'x') ? 'width' : 'height';
+ var offset = parseInt(c.css(cssOffset), 10) || 0;
+
+ var AreaSize = scrollx.size;
+ var AreaVisible = scrollx.visible + offset;
+
+ var scrollSize = scrollx.scroll.size[cssFullSize]() + (parseInt(scrollx.scroll.size.css(cssOffset), 10) || 0);
+
+ if (o.autoScrollSize) {
+ scrollx.scrollbarSize = parseInt(scrollSize * AreaVisible / AreaSize, 10);
+ scrollx.scroll.bar.css(cssSize, scrollx.scrollbarSize + 'px');
+ }
+
+ scrollx.scrollbarSize = scrollx.scroll.bar[cssFullSize]();
+ scrollx.kx = ((scrollSize - scrollx.scrollbarSize) / (AreaSize - AreaVisible)) || 1;
+ scrollx.maxScrollOffset = AreaSize - AreaVisible;
+ });
+
+ c.scrollLeft(initScroll.scrollLeft).scrollTop(initScroll.scrollTop).trigger('scroll');
+ },
+
+ /**
+ * Get scrollx/scrolly object
+ *
+ * @param {Mixed} scroll
+ * @returns {jQuery} scroll object
+ */
+ _getScroll: function (scroll) {
+ var types = {
+ advanced: [
+ '
'
+ ].join(''),
+ simple: [
+ '
'
+ ].join('')
+ };
+ if (types[scroll]) {
+ scroll = types[scroll];
+ }
+ if (!scroll) {
+ scroll = types['simple'];
+ }
+ if (typeof (scroll) == 'string') {
+ scroll = $(scroll).appendTo(this.wrapper);
+ } else {
+ scroll = $(scroll);
+ }
+ $.extend(scroll, {
+ bar: scroll.find('.scroll-bar'),
+ size: scroll.find('.scroll-element_size'),
+ track: scroll.find('.scroll-element_track')
+ });
+ return scroll;
+ },
+
+ _handleMouseDown: function(callback, event) {
+
+ var namespace = this.namespace;
+
+ $(document).on('blur' + namespace, function () {
+ $(document).add('body').off(namespace);
+ callback && callback();
+ });
+ $(document).on('dragstart' + namespace, function (event) {
+ event.preventDefault();
+ return false;
+ });
+ $(document).on('mouseup' + namespace, function () {
+ $(document).add('body').off(namespace);
+ callback && callback();
+ });
+ $('body').on('selectstart' + namespace, function (event) {
+ event.preventDefault();
+ return false;
+ });
+
+ event && event.preventDefault();
+ return false;
+ },
+
+ _updateScroll: function (d, scrollx) {
+
+ var container = this.container,
+ containerWrapper = this.containerWrapper || container,
+ scrollClass = 'scroll-scroll' + d + '_visible',
+ scrolly = (d === 'x') ? this.scrolly : this.scrollx,
+ offset = parseInt(this.container.css((d === 'x') ? 'left' : 'top'), 10) || 0,
+ wrapper = this.wrapper;
+
+ var AreaSize = scrollx.size;
+ var AreaVisible = scrollx.visible + offset;
+
+ scrollx.isVisible = (AreaSize - AreaVisible) > 1; // bug in IE9/11 with 1px diff
+ if (scrollx.isVisible) {
+ scrollx.scroll.addClass(scrollClass);
+ scrolly.scroll.addClass(scrollClass);
+ containerWrapper.addClass(scrollClass);
+ } else {
+ scrollx.scroll.removeClass(scrollClass);
+ scrolly.scroll.removeClass(scrollClass);
+ containerWrapper.removeClass(scrollClass);
+ }
+
+ if (d === 'y') {
+ if(container.is('textarea') || AreaSize < AreaVisible){
+ containerWrapper.css({
+ "height": (AreaVisible + browser.scroll.height) + 'px',
+ "max-height": "none"
+ });
+ } else {
+ containerWrapper.css({
+ //"height": "auto", // do not reset height value: issue with height:100%!
+ "max-height": (AreaVisible + browser.scroll.height) + 'px'
+ });
+ }
+ }
+
+ if (scrollx.size != container.prop('scrollWidth')
+ || scrolly.size != container.prop('scrollHeight')
+ || scrollx.visible != wrapper.width()
+ || scrolly.visible != wrapper.height()
+ || scrollx.offset != (parseInt(container.css('left'), 10) || 0)
+ || scrolly.offset != (parseInt(container.css('top'), 10) || 0)
+ ) {
+ $.extend(this.scrollx, {
+ "offset": parseInt(container.css('left'), 10) || 0,
+ "size": container.prop('scrollWidth'),
+ "visible": wrapper.width()
+ });
+ $.extend(this.scrolly, {
+ "offset": parseInt(container.css('top'), 10) || 0,
+ "size": this.container.prop('scrollHeight'),
+ "visible": wrapper.height()
+ });
+ this._updateScroll(d === 'x' ? 'y' : 'x', scrolly);
+ }
+ }
+ };
+
+ var CustomScrollbar = BaseScrollbar;
+
+ /*
+ * Extend jQuery as plugin
+ *
+ * @param {Mixed} command to execute
+ * @param {Mixed} arguments as Array
+ * @return {jQuery}
+ */
+ $.fn.scrollbar = function (command, args) {
+ if (typeof command !== 'string') {
+ args = command;
+ command = 'init';
+ }
+ if (typeof args === 'undefined') {
+ args = [];
+ }
+ if (!$.isArray(args)) {
+ args = [args];
+ }
+ this.not('body, .scroll-wrapper').each(function () {
+ var element = $(this),
+ instance = element.data(browser.data.name);
+ if (instance || command === 'init') {
+ if (!instance) {
+ instance = new CustomScrollbar(element);
+ }
+ if (instance[command]) {
+ instance[command].apply(instance, args);
+ }
+ }
+ });
+ return this;
+ };
+
+ /**
+ * Connect default options to global object
+ */
+ $.fn.scrollbar.options = defaults;
+
+
+ /**
+ * Check if scroll content/container size is changed
+ */
+
+ var updateScrollbars = (function () {
+ var timer = 0,
+ timerCounter = 0;
+
+ return function (force) {
+ var i, container, options, scroll, wrapper, scrollx, scrolly;
+ for (i = 0; i < browser.scrolls.length; i++) {
+ scroll = browser.scrolls[i];
+ container = scroll.container;
+ options = scroll.options;
+ wrapper = scroll.wrapper;
+ scrollx = scroll.scrollx;
+ scrolly = scroll.scrolly;
+ if (force || (options.autoUpdate && wrapper && wrapper.is(':visible') &&
+ (container.prop('scrollWidth') != scrollx.size || container.prop('scrollHeight') != scrolly.size || wrapper.width() != scrollx.visible || wrapper.height() != scrolly.visible))) {
+ scroll.init();
+
+ if (options.debug) {
+ window.console && console.log({
+ scrollHeight: container.prop('scrollHeight') + ':' + scroll.scrolly.size,
+ scrollWidth: container.prop('scrollWidth') + ':' + scroll.scrollx.size,
+ visibleHeight: wrapper.height() + ':' + scroll.scrolly.visible,
+ visibleWidth: wrapper.width() + ':' + scroll.scrollx.visible
+ }, true);
+ timerCounter++;
+ }
+ }
+ }
+ if (debug && timerCounter > 10) {
+ window.console && console.log('Scroll updates exceed 10');
+ updateScrollbars = function () {};
+ } else {
+ clearTimeout(timer);
+ timer = setTimeout(updateScrollbars, 300);
+ }
+ };
+ })();
+
+ /* ADDITIONAL FUNCTIONS */
+ /**
+ * Get native browser scrollbar size (height/width)
+ *
+ * @param {Boolean} actual size or CSS size, default - CSS size
+ * @returns {Object} with height, width
+ */
+ function getBrowserScrollSize(actualSize) {
+
+ if (browser.webkit && !actualSize) {
+ return {
+ "height": 0,
+ "width": 0
+ };
+ }
+
+ if (!browser.data.outer) {
+ var css = {
+ "border": "none",
+ "box-sizing": "content-box",
+ "height": "200px",
+ "margin": "0",
+ "padding": "0",
+ "width": "200px"
+ };
+ browser.data.inner = $("
").css($.extend({}, css));
+ browser.data.outer = $("
").css($.extend({
+ "left": "-1000px",
+ "overflow": "scroll",
+ "position": "absolute",
+ "top": "-1000px"
+ }, css)).append(browser.data.inner).appendTo("body");
+ }
+
+ browser.data.outer.scrollLeft(1000).scrollTop(1000);
+
+ return {
+ "height": Math.ceil((browser.data.outer.offset().top - browser.data.inner.offset().top) || 0),
+ "width": Math.ceil((browser.data.outer.offset().left - browser.data.inner.offset().left) || 0)
+ };
+ }
+
+ /**
+ * Check if native browser scrollbars overlay content
+ *
+ * @returns {Boolean}
+ */
+ function isScrollOverlaysContent() {
+ var scrollSize = getBrowserScrollSize(true);
+ return !(scrollSize.height || scrollSize.width);
+ }
+
+ function isVerticalScroll(event) {
+ var e = event.originalEvent;
+ if (e.axis && e.axis === e.HORIZONTAL_AXIS)
+ return false;
+ if (e.wheelDeltaX)
+ return false;
+ return true;
+ }
+
+
+ /**
+ * Extend AngularJS as UI directive
+ * and expose a provider for override default config
+ *
+ */
+ if (window.angular) {
+ (function (angular) {
+ angular.module('jQueryScrollbar', [])
+ .provider('jQueryScrollbar', function () {
+ var defaultOptions = defaults;
+ return {
+ setOptions: function (options) {
+ angular.extend(defaultOptions, options);
+ },
+ $get: function () {
+ return {
+ options: angular.copy(defaultOptions)
+ };
+ }
+ };
+ })
+ .directive('jqueryScrollbar', ['jQueryScrollbar', '$parse', function (jQueryScrollbar, $parse) {
+ return {
+ "restrict": "AC",
+ "link": function (scope, element, attrs) {
+ var model = $parse(attrs.jqueryScrollbar),
+ options = model(scope);
+ element.scrollbar(options || jQueryScrollbar.options)
+ .on('$destroy', function () {
+ element.scrollbar('destroy');
+ });
+ }
+ };
+ }]);
+ })(window.angular);
+ }
+}));
diff --git a/assets/global/vendor/jquery-scrollbar/jquery.scrollbar.min.js b/assets/global/vendor/jquery-scrollbar/jquery.scrollbar.min.js
new file mode 100755
index 0000000..14031fd
--- /dev/null
+++ b/assets/global/vendor/jquery-scrollbar/jquery.scrollbar.min.js
@@ -0,0 +1,16 @@
+/**
+ * jQuery CSS Customizable Scrollbar
+ *
+ * Copyright 2015, Yuriy Khabarov
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * If you found bug, please contact me via email <13real008@gmail.com>
+ *
+ * Compressed by http://jscompress.com/
+ *
+ * @author Yuriy Khabarov aka Gromo
+ * @version 0.2.10
+ * @url https://github.com/gromo/jquery.scrollbar/
+ *
+ */
+!function(l,e){"function"==typeof define&&define.amd?define(["jquery"],e):e(l.jQuery)}(this,function(l){"use strict";function e(e){if(t.webkit&&!e)return{height:0,width:0};if(!t.data.outer){var o={border:"none","box-sizing":"content-box",height:"200px",margin:"0",padding:"0",width:"200px"};t.data.inner=l("
").css(l.extend({},o)),t.data.outer=l("
").css(l.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},o)).append(t.data.inner).appendTo("body")}return t.data.outer.scrollLeft(1e3).scrollTop(1e3),{height:Math.ceil(t.data.outer.offset().top-t.data.inner.offset().top||0),width:Math.ceil(t.data.outer.offset().left-t.data.inner.offset().left||0)}}function o(){var l=e(!0);return!(l.height||l.width)}function s(l){var e=l.originalEvent;return e.axis&&e.axis===e.HORIZONTAL_AXIS?!1:e.wheelDeltaX?!1:!0}var r=!1,t={data:{index:0,name:"scrollbar"},macosx:/mac/i.test(navigator.platform),mobile:/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent),overlay:null,scroll:null,scrolls:[],webkit:/webkit/i.test(navigator.userAgent)&&!/edge\/\d+/i.test(navigator.userAgent)};t.scrolls.add=function(l){this.remove(l).push(l)},t.scrolls.remove=function(e){for(;l.inArray(e,this)>=0;)this.splice(l.inArray(e,this),1);return this};var i={autoScrollSize:!0,autoUpdate:!0,debug:!1,disableBodyScroll:!1,duration:200,ignoreMobile:!1,ignoreOverlay:!1,scrollStep:30,showArrows:!1,stepScrolling:!0,scrollx:null,scrolly:null,onDestroy:null,onInit:null,onScroll:null,onUpdate:null},n=function(s){t.scroll||(t.overlay=o(),t.scroll=e(),a(),l(window).resize(function(){var l=!1;if(t.scroll&&(t.scroll.height||t.scroll.width)){var o=e();(o.height!==t.scroll.height||o.width!==t.scroll.width)&&(t.scroll=o,l=!0)}a(l)})),this.container=s,this.namespace=".scrollbar_"+t.data.index++,this.options=l.extend({},i,window.jQueryScrollbarOptions||{}),this.scrollTo=null,this.scrollx={},this.scrolly={},s.data(t.data.name,this),t.scrolls.add(this)};n.prototype={destroy:function(){if(this.wrapper){this.container.removeData(t.data.name),t.scrolls.remove(this);var e=this.container.scrollLeft(),o=this.container.scrollTop();this.container.insertBefore(this.wrapper).css({height:"",margin:"","max-height":""}).removeClass("scroll-content scroll-scrollx_visible scroll-scrolly_visible").off(this.namespace).scrollLeft(e).scrollTop(o),this.scrollx.scroll.removeClass("scroll-scrollx_visible").find("div").andSelf().off(this.namespace),this.scrolly.scroll.removeClass("scroll-scrolly_visible").find("div").andSelf().off(this.namespace),this.wrapper.remove(),l(document).add("body").off(this.namespace),l.isFunction(this.options.onDestroy)&&this.options.onDestroy.apply(this,[this.container])}},init:function(e){var o=this,r=this.container,i=this.containerWrapper||r,n=this.namespace,c=l.extend(this.options,e||{}),a={x:this.scrollx,y:this.scrolly},d=this.wrapper,h={scrollLeft:r.scrollLeft(),scrollTop:r.scrollTop()};if(t.mobile&&c.ignoreMobile||t.overlay&&c.ignoreOverlay||t.macosx&&!t.webkit)return!1;if(d)i.css({height:"auto","margin-bottom":-1*t.scroll.height+"px","margin-right":-1*t.scroll.width+"px","max-height":""});else{if(this.wrapper=d=l("
").addClass("scroll-wrapper").addClass(r.attr("class")).css("position","absolute"==r.css("position")?"absolute":"relative").insertBefore(r).append(r),r.is("textarea")&&(this.containerWrapper=i=l("
").insertBefore(r).append(r),d.addClass("scroll-textarea")),i.addClass("scroll-content").css({height:"auto","margin-bottom":-1*t.scroll.height+"px","margin-right":-1*t.scroll.width+"px","max-height":""}),r.on("scroll"+n,function(e){l.isFunction(c.onScroll)&&c.onScroll.call(o,{maxScroll:a.y.maxScrollOffset,scroll:r.scrollTop(),size:a.y.size,visible:a.y.visible},{maxScroll:a.x.maxScrollOffset,scroll:r.scrollLeft(),size:a.x.size,visible:a.x.visible}),a.x.isVisible&&a.x.scroll.bar.css("left",r.scrollLeft()*a.x.kx+"px"),a.y.isVisible&&a.y.scroll.bar.css("top",r.scrollTop()*a.y.kx+"px")}),d.on("scroll"+n,function(){d.scrollTop(0).scrollLeft(0)}),c.disableBodyScroll){var p=function(l){s(l)?a.y.isVisible&&a.y.mousewheel(l):a.x.isVisible&&a.x.mousewheel(l)};d.on("MozMousePixelScroll"+n,p),d.on("mousewheel"+n,p),t.mobile&&d.on("touchstart"+n,function(e){var o=e.originalEvent.touches&&e.originalEvent.touches[0]||e,s={pageX:o.pageX,pageY:o.pageY},t={left:r.scrollLeft(),top:r.scrollTop()};l(document).on("touchmove"+n,function(l){var e=l.originalEvent.targetTouches&&l.originalEvent.targetTouches[0]||l;r.scrollLeft(t.left+s.pageX-e.pageX),r.scrollTop(t.top+s.pageY-e.pageY),l.preventDefault()}),l(document).on("touchend"+n,function(){l(document).off(n)})})}l.isFunction(c.onInit)&&c.onInit.apply(this,[r])}l.each(a,function(e,t){var i=null,d=1,h="x"===e?"scrollLeft":"scrollTop",p=c.scrollStep,u=function(){var l=r[h]();r[h](l+p),1==d&&l+p>=f&&(l=r[h]()),-1==d&&f>=l+p&&(l=r[h]()),r[h]()==l&&i&&i()},f=0;t.scroll||(t.scroll=o._getScroll(c["scroll"+e]).addClass("scroll-"+e),c.showArrows&&t.scroll.addClass("scroll-element_arrows_visible"),t.mousewheel=function(l){if(!t.isVisible||"x"===e&&s(l))return!0;if("y"===e&&!s(l))return a.x.mousewheel(l),!0;var i=-1*l.originalEvent.wheelDelta||l.originalEvent.detail,n=t.size-t.visible-t.offset;return(i>0&&n>f||0>i&&f>0)&&(f+=i,0>f&&(f=0),f>n&&(f=n),o.scrollTo=o.scrollTo||{},o.scrollTo[h]=f,setTimeout(function(){o.scrollTo&&(r.stop().animate(o.scrollTo,240,"linear",function(){f=r[h]()}),o.scrollTo=null)},1)),l.preventDefault(),!1},t.scroll.on("MozMousePixelScroll"+n,t.mousewheel).on("mousewheel"+n,t.mousewheel).on("mouseenter"+n,function(){f=r[h]()}),t.scroll.find(".scroll-arrow, .scroll-element_track").on("mousedown"+n,function(s){if(1!=s.which)return!0;d=1;var n={eventOffset:s["x"===e?"pageX":"pageY"],maxScrollValue:t.size-t.visible-t.offset,scrollbarOffset:t.scroll.bar.offset()["x"===e?"left":"top"],scrollbarSize:t.scroll.bar["x"===e?"outerWidth":"outerHeight"]()},a=0,v=0;return l(this).hasClass("scroll-arrow")?(d=l(this).hasClass("scroll-arrow_more")?1:-1,p=c.scrollStep*d,f=d>0?n.maxScrollValue:0):(d=n.eventOffset>n.scrollbarOffset+n.scrollbarSize?1:n.eventOffset
','','','','",""].join(""),simple:['
"].join("")};return o[e]&&(e=o[e]),e||(e=o.simple),e="string"==typeof e?l(e).appendTo(this.wrapper):l(e),l.extend(e,{bar:e.find(".scroll-bar"),size:e.find(".scroll-element_size"),track:e.find(".scroll-element_track")}),e},_handleMouseDown:function(e,o){var s=this.namespace;return l(document).on("blur"+s,function(){l(document).add("body").off(s),e&&e()}),l(document).on("dragstart"+s,function(l){return l.preventDefault(),!1}),l(document).on("mouseup"+s,function(){l(document).add("body").off(s),e&&e()}),l("body").on("selectstart"+s,function(l){return l.preventDefault(),!1}),o&&o.preventDefault(),!1},_updateScroll:function(e,o){var s=this.container,r=this.containerWrapper||s,i="scroll-scroll"+e+"_visible",n="x"===e?this.scrolly:this.scrollx,c=parseInt(this.container.css("x"===e?"left":"top"),10)||0,a=this.wrapper,d=o.size,h=o.visible+c;o.isVisible=d-h>1,o.isVisible?(o.scroll.addClass(i),n.scroll.addClass(i),r.addClass(i)):(o.scroll.removeClass(i),n.scroll.removeClass(i),r.removeClass(i)),"y"===e&&(s.is("textarea")||h>d?r.css({height:h+t.scroll.height+"px","max-height":"none"}):r.css({"max-height":h+t.scroll.height+"px"})),(o.size!=s.prop("scrollWidth")||n.size!=s.prop("scrollHeight")||o.visible!=a.width()||n.visible!=a.height()||o.offset!=(parseInt(s.css("left"),10)||0)||n.offset!=(parseInt(s.css("top"),10)||0))&&(l.extend(this.scrollx,{offset:parseInt(s.css("left"),10)||0,size:s.prop("scrollWidth"),visible:a.width()}),l.extend(this.scrolly,{offset:parseInt(s.css("top"),10)||0,size:this.container.prop("scrollHeight"),visible:a.height()}),this._updateScroll("x"===e?"y":"x",n))}};var c=n;l.fn.scrollbar=function(e,o){return"string"!=typeof e&&(o=e,e="init"),"undefined"==typeof o&&(o=[]),l.isArray(o)||(o=[o]),this.not("body, .scroll-wrapper").each(function(){var s=l(this),r=s.data(t.data.name);(r||"init"===e)&&(r||(r=new c(s)),r[e]&&r[e].apply(r,o))}),this},l.fn.scrollbar.options=i;var a=function(){var l=0,e=0;return function(o){var s,i,n,c,d,h,p;for(s=0;s
10?(window.console&&console.log("Scroll updates exceed 10"),a=function(){}):(clearTimeout(l),l=setTimeout(a,300))}}();window.angular&&!function(l){l.module("jQueryScrollbar",[]).provider("jQueryScrollbar",function(){var e=i;return{setOptions:function(o){l.extend(e,o)},$get:function(){return{options:l.copy(e)}}}}).directive("jqueryScrollbar",["jQueryScrollbar","$parse",function(l,e){return{restrict:"AC",link:function(o,s,r){var t=e(r.jqueryScrollbar),i=t(o);s.scrollbar(i||l.options).on("$destroy",function(){s.scrollbar("destroy")})}}}])}(window.angular)});
\ No newline at end of file
diff --git a/assets/images/cryptologo/litecoin.png b/assets/images/cryptologo/litecoin.png
new file mode 100644
index 0000000..42fad23
Binary files /dev/null and b/assets/images/cryptologo/litecoin.png differ
diff --git a/assets/scripts/dashboard.js b/assets/scripts/dashboard.js
index 48e04c6..8727658 100644
--- a/assets/scripts/dashboard.js
+++ b/assets/scripts/dashboard.js
@@ -17,6 +17,134 @@ var Dashboard = function() {
var handleWalletWidgets = function() {
+ var walletDivContent = '';
+
+ $.ajax({
+ type: 'GET',
+ url: 'http://127.0.0.1:7778/api/InstantDEX/allcoins',
+ dataType: 'text',
+ success: function(data, textStatus, jqXHR) {
+ var AllcoinsDataOutput = JSON.parse(data);
+ //console.log('== Data OutPut ==');
+ //console.log(AllcoinsDataOutput.basilisk);
+
+ $.each(AllcoinsDataOutput.basilisk, function(index) {
+
+ var coinlogo = '';
+ var coinname = '';
+
+ if ( AllcoinsDataOutput.basilisk[index] == 'BTC' ) {
+ coinlogo = 'bitcoin';
+ coinname = 'Bitcoin';
+ }
+ if ( AllcoinsDataOutput.basilisk[index] == 'BTCD' ) {
+ coinlogo = 'bitcoindark';
+ coinname = 'BitcoinDark';
+ }
+ if ( AllcoinsDataOutput.basilisk[index] == 'LTC' ) {
+ coinlogo = 'litecoin';
+ coinname = 'Litecoin';
+ }
+
+ //console.log(AllcoinsDataOutput.basilisk[index]);
+ walletDivContent += '';
+ walletDivContent += '';
+ walletDivContent += '
';
+ walletDivContent += '
';
+ walletDivContent += '';
+
+ $('#wallet-widgets').html(walletDivContent);
+ $('.scrollbar-dynamic').scrollbar(); //Make sure widget-body has scrollbar for transactions history
+ $('[data-toggle="tooltip"]').tooltip(); //Make sure tooltips are working for wallet widgets and anywhere else in wallet.
+ //console.log(walletDivContent);
+
+ //console.log('http://127.0.0.1:7778/api/bitcoinrpc/getaddressesbyaccount?coin=' + AllcoinsDataOutput.basilisk[index] + '&account=*');
+ //$('select[data-currency="' + AllcoinsDataOutput.basilisk[index] + '"]').empty();
+ $.getJSON( 'http://127.0.0.1:7778/api/bitcoinrpc/getaddressesbyaccount?coin=' + AllcoinsDataOutput.basilisk[index] + '&account=*', function( data ) {
+ var CoinAddrList = '';
+ //console.log(data.result);
+ $.each(data.result, function(coin_index){
+ //console.log(coin_index);
+ //console.log(data.result[index]);
+ //console.log(AllcoinsDataOutput.basilisk[index]);
+ CoinAddrList = '';
+
+ //console.log(CoinAddrList);
+ // Inject the whole content string into our existing HTML table
+ $('select[data-currency="' + AllcoinsDataOutput.basilisk[index] + '"]').append(CoinAddrList);
+
+ });
+ //console.log(data);
+ //console.log(data[0]);*/
+ });
+ });
+ },
+ error: function(xhr, textStatus, error) {
+ console.log('failed starting BitcoinDark.');
+ console.log(xhr.statusText);
+ console.log(textStatus);
+ console.log(error);
+ //swal("Oops...", "Something went wrong!", "error");
+ if (xhr.readyState == '0' ) {
+ toastr.error("Unable to connect to Iguana", "Account Notification")
+ }
+ }
+ });
}
diff --git a/assets/scripts/login.js b/assets/scripts/login.js
index cdb2530..63a8b1d 100644
--- a/assets/scripts/login.js
+++ b/assets/scripts/login.js
@@ -499,55 +499,58 @@ var Login = function() {
};
var handleCoinsRunningCheck = function() {
-
- $.each([ 'BTC', 'BTCD' ], function( index, value ) {
- var AddCoinBasiliskData = {
- "poll": 100,
- "active": 1,
- "newcoin": value,
- "startpend": 1,
- "endpend": 1,
- "services": 128,
- "maxpeers": 16,
- "RELAY": 0,
- "VALIDATE": 0,
- "portp2p": 14631
- }
- //Start BitcoinDark in Basilisk mode
- $.ajax({
- type: 'GET',
- data: AddCoinBasiliskData,
- url: 'http://127.0.0.1:7778/api/iguana/addcoin',
- dataType: 'text',
- success: function(data, textStatus, jqXHR) {
- var CoinBasiliskDataOutput = JSON.parse(data);
- //console.log('== Data OutPut ==');
- //console.log(CoinBasiliskDataOutput);
-
- if (CoinBasiliskDataOutput.result === 'coin added') {
- console.log('coin added');
- toastr.success(value + " started in Basilisk Mode", "Coin Notification");
- } else if (CoinBasiliskDataOutput.result === 'coin already there') {
- console.log('coin already there');
- toastr.info("Looks like" + value + "already running.", "Coin Notification");
- } else if (CoinBasiliskDataOutput.result === null) {
- console.log('coin already there');
- toastr.info("Looks like" + value + "already running.", "Coin Notification");
- }
- },
- error: function(xhr, textStatus, error) {
- console.log('failed starting BitcoinDark.');
- console.log(xhr.statusText);
- console.log(textStatus);
- console.log(error);
- //swal("Oops...", "Something went wrong!", "error");
- if (xhr.readyState == '0' ) {
- toastr.error("Unable to connect to Iguana", "Account Notification")
- }
+
+ if ( sessionStorage.getItem('IguanaActiveAccount') === null ) {
+ $.each([ 'BTC', 'BTCD' ], function( index, value ) {
+ var AddCoinBasiliskData = {
+ "poll": 100,
+ "active": 1,
+ "newcoin": value,
+ "startpend": 1,
+ "endpend": 1,
+ "services": 128,
+ "maxpeers": 16,
+ "RELAY": 0,
+ "VALIDATE": 0,
+ "portp2p": 14631
}
+ //Start BitcoinDark in Basilisk mode
+ $.ajax({
+ type: 'GET',
+ data: AddCoinBasiliskData,
+ url: 'http://127.0.0.1:7778/api/iguana/addcoin',
+ dataType: 'text',
+ success: function(data, textStatus, jqXHR) {
+ var CoinBasiliskDataOutput = JSON.parse(data);
+ //console.log('== Data OutPut ==');
+ //console.log(CoinBasiliskDataOutput);
+
+ if (CoinBasiliskDataOutput.result === 'coin added') {
+ console.log('coin added');
+ toastr.success(value + " started in Basilisk Mode", "Coin Notification");
+ } else if (CoinBasiliskDataOutput.result === 'coin already there') {
+ console.log('coin already there');
+ //toastr.info("Looks like" + value + "already running.", "Coin Notification");
+ } else if (CoinBasiliskDataOutput.result === null) {
+ console.log('coin already there');
+ //toastr.info("Looks like" + value + "already running.", "Coin Notification");
+ }
+ },
+ error: function(xhr, textStatus, error) {
+ console.log('failed starting BitcoinDark.');
+ console.log(xhr.statusText);
+ console.log(textStatus);
+ console.log(error);
+ //swal("Oops...", "Something went wrong!", "error");
+ if (xhr.readyState == '0' ) {
+ toastr.error("Unable to connect to Iguana", "Account Notification")
+ }
+ }
+ });
});
- //return false;
- });
+ }
+
+
}
var handleLoginAnotherWallet = function() {
@@ -588,7 +591,6 @@ var Login = function() {
console.log(data.statusText);
console.log(textStatus);
console.log(jqXHR);
-
}
},
error: function(xhr, textStatus, error) {
@@ -598,7 +600,6 @@ var Login = function() {
console.log(error);
//swal("Oops...", "Something went wrong!", "error");
toastr.warning("Opps... Something went wrong!", "Account Notification")
-
}
});
});
diff --git a/index.html b/index.html
index b56c4d6..99b5ddf 100755
--- a/index.html
+++ b/index.html
@@ -21,6 +21,7 @@
+
@@ -247,7 +248,7 @@