|
| 1 | + |
| 2 | +<script> |
| 3 | + $(document).ready(function () { |
| 4 | + $('#facebook').sharrre({ |
| 5 | + share: { |
| 6 | + facebook: true |
| 7 | + }, |
| 8 | + enableHover: false, |
| 9 | + enableTracking: false, |
| 10 | + enableCounter: false, |
| 11 | + click: function (api, options) { |
| 12 | + api.simulateClick(); |
| 13 | + api.openPopup('facebook'); |
| 14 | + }, |
| 15 | + template: '<i class="fab fa-facebook-f"></i> Facebook', |
| 16 | + url: 'https://demos.creative-tim.com/paper-dashboard/examples/dashboard.html' |
| 17 | + }); |
| 18 | + $('#google').sharrre({ |
| 19 | + share: { |
| 20 | + googlePlus: true |
| 21 | + }, |
| 22 | + enableCounter: false, |
| 23 | + enableHover: false, |
| 24 | + enableTracking: true, |
| 25 | + click: function (api, options) { |
| 26 | + api.simulateClick(); |
| 27 | + api.openPopup('googlePlus'); |
| 28 | + }, |
| 29 | + template: '<i class="fab fa-google-plus"></i> Google', |
| 30 | + url: 'https://demos.creative-tim.com/paper-dashboard/examples/dashboard.html' |
| 31 | + }); |
| 32 | + $('#twitter').sharrre({ |
| 33 | + share: { |
| 34 | + twitter: true |
| 35 | + }, |
| 36 | + enableHover: false, |
| 37 | + enableTracking: false, |
| 38 | + enableCounter: false, |
| 39 | + buttons: { |
| 40 | + twitter: { |
| 41 | + via: 'CreativeTim' |
| 42 | + } |
| 43 | + }, |
| 44 | + click: function (api, options) { |
| 45 | + api.simulateClick(); |
| 46 | + api.openPopup('twitter'); |
| 47 | + }, |
| 48 | + template: '<i class="fab fa-twitter"></i> Twitter', |
| 49 | + url: 'https://demos.creative-tim.com/paper-dashboard/examples/dashboard.html' |
| 50 | + }); |
| 51 | + // Facebook Pixel Code Don't Delete |
| 52 | + ! function (f, b, e, v, n, t, s) { |
| 53 | + if (f.fbq) return; |
| 54 | + n = f.fbq = function () { |
| 55 | + n.callMethod ? |
| 56 | + n.callMethod.apply(n, arguments) : n.queue.push(arguments) |
| 57 | + }; |
| 58 | + if (!f._fbq) f._fbq = n; |
| 59 | + n.push = n; |
| 60 | + n.loaded = !0; |
| 61 | + n.version = '2.0'; |
| 62 | + n.queue = []; |
| 63 | + t = b.createElement(e); |
| 64 | + t.async = !0; |
| 65 | + t.src = v; |
| 66 | + s = b.getElementsByTagName(e)[0]; |
| 67 | + s.parentNode.insertBefore(t, s) |
| 68 | + }(window, |
| 69 | + document, 'script', '//connect.facebook.net/en_US/fbevents.js'); |
| 70 | + try { |
| 71 | + fbq('init', '111649226022273'); |
| 72 | + fbq('track', "PageView"); |
| 73 | + } catch (err) { |
| 74 | + console.log('Facebook Track Error:', err); |
| 75 | + } |
| 76 | + }); |
| 77 | +</script> |
| 78 | +<script> |
| 79 | + $(document).ready(function () { |
| 80 | + $sidebar = $('.sidebar'); |
| 81 | + $sidebar_img_container = $sidebar.find('.sidebar-background'); |
| 82 | + $full_page = $('.full-page'); |
| 83 | + $sidebar_responsive = $('body > .navbar-collapse'); |
| 84 | + sidebar_mini_active = true; |
| 85 | + window_width = $(window).width(); |
| 86 | + fixed_plugin_open = $('.sidebar .sidebar-wrapper .nav li.active a p').html(); |
| 87 | + // if( window_width > 767 && fixed_plugin_open == 'Dashboard' ){ |
| 88 | + // if($('.fixed-plugin .dropdown').hasClass('show-dropdown')){ |
| 89 | + // $('.fixed-plugin .dropdown').addClass('show'); |
| 90 | + // } |
| 91 | + // |
| 92 | + // } |
| 93 | + $('.fixed-plugin a').click(function (event) { |
| 94 | + // Alex if we click on switch, stop propagation of the event, so the dropdown will not be hide, otherwise we set the section active |
| 95 | + if ($(this).hasClass('switch-trigger')) { |
| 96 | + if (event.stopPropagation) { |
| 97 | + event.stopPropagation(); |
| 98 | + } else if (window.event) { |
| 99 | + window.event.cancelBubble = true; |
| 100 | + } |
| 101 | + } |
| 102 | + }); |
| 103 | + $('.fixed-plugin .active-color span').click(function () { |
| 104 | + $full_page_background = $('.full-page-background'); |
| 105 | + $(this).siblings().removeClass('active'); |
| 106 | + $(this).addClass('active'); |
| 107 | + var new_color = $(this).data('color'); |
| 108 | + if ($sidebar.length != 0) { |
| 109 | + $sidebar.attr('data-active-color', new_color); |
| 110 | + } |
| 111 | + if ($full_page.length != 0) { |
| 112 | + $full_page.attr('data-active-color', new_color); |
| 113 | + } |
| 114 | + if ($sidebar_responsive.length != 0) { |
| 115 | + $sidebar_responsive.attr('data-active-color', new_color); |
| 116 | + } |
| 117 | + }); |
| 118 | + $('.fixed-plugin .background-color span').click(function () { |
| 119 | + $(this).siblings().removeClass('active'); |
| 120 | + $(this).addClass('active'); |
| 121 | + var new_color = $(this).data('color'); |
| 122 | + if ($sidebar.length != 0) { |
| 123 | + $sidebar.attr('data-color', new_color); |
| 124 | + } |
| 125 | + if ($full_page.length != 0) { |
| 126 | + $full_page.attr('filter-color', new_color); |
| 127 | + } |
| 128 | + if ($sidebar_responsive.length != 0) { |
| 129 | + $sidebar_responsive.attr('data-color', new_color); |
| 130 | + } |
| 131 | + }); |
| 132 | + $('.fixed-plugin .img-holder').click(function () { |
| 133 | + $full_page_background = $('.full-page-background'); |
| 134 | + $(this).parent('li').siblings().removeClass('active'); |
| 135 | + $(this).parent('li').addClass('active'); |
| 136 | + var new_image = $(this).find("img").attr('src'); |
| 137 | + if ($sidebar_img_container.length != 0 && $('.switch-sidebar-image input:checked').length != 0) { |
| 138 | + $sidebar_img_container.fadeOut('fast', function () { |
| 139 | + $sidebar_img_container.css('background-image', 'url("' + new_image + '")'); |
| 140 | + $sidebar_img_container.fadeIn('fast'); |
| 141 | + }); |
| 142 | + } |
| 143 | + if ($full_page_background.length != 0 && $('.switch-sidebar-image input:checked').length != 0) { |
| 144 | + var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src'); |
| 145 | + $full_page_background.fadeOut('fast', function () { |
| 146 | + $full_page_background.css('background-image', 'url("' + new_image_full_page + '")'); |
| 147 | + $full_page_background.fadeIn('fast'); |
| 148 | + }); |
| 149 | + } |
| 150 | + if ($('.switch-sidebar-image input:checked').length == 0) { |
| 151 | + var new_image = $('.fixed-plugin li.active .img-holder').find("img").attr('src'); |
| 152 | + var new_image_full_page = $('.fixed-plugin li.active .img-holder').find('img').data('src'); |
| 153 | + $sidebar_img_container.css('background-image', 'url("' + new_image + '")'); |
| 154 | + $full_page_background.css('background-image', 'url("' + new_image_full_page + '")'); |
| 155 | + } |
| 156 | + if ($sidebar_responsive.length != 0) { |
| 157 | + $sidebar_responsive.css('background-image', 'url("' + new_image + '")'); |
| 158 | + } |
| 159 | + }); |
| 160 | + $('.switch-sidebar-image input').on("switchChange.bootstrapSwitch", function () { |
| 161 | + $full_page_background = $('.full-page-background'); |
| 162 | + $input = $(this); |
| 163 | + if ($input.is(':checked')) { |
| 164 | + if ($sidebar_img_container.length != 0) { |
| 165 | + $sidebar_img_container.fadeIn('fast'); |
| 166 | + $sidebar.attr('data-image', '#'); |
| 167 | + } |
| 168 | + if ($full_page_background.length != 0) { |
| 169 | + $full_page_background.fadeIn('fast'); |
| 170 | + $full_page.attr('data-image', '#'); |
| 171 | + } |
| 172 | + background_image = true; |
| 173 | + } else { |
| 174 | + if ($sidebar_img_container.length != 0) { |
| 175 | + $sidebar.removeAttr('data-image'); |
| 176 | + $sidebar_img_container.fadeOut('fast'); |
| 177 | + } |
| 178 | + if ($full_page_background.length != 0) { |
| 179 | + $full_page.removeAttr('data-image', '#'); |
| 180 | + $full_page_background.fadeOut('fast'); |
| 181 | + } |
| 182 | + background_image = false; |
| 183 | + } |
| 184 | + }); |
| 185 | + $('.switch-mini input').on("switchChange.bootstrapSwitch", function () { |
| 186 | + $body = $('body'); |
| 187 | + $input = $(this); |
| 188 | + if (paperDashboard.misc.sidebar_mini_active == true) { |
| 189 | + $('body').removeClass('sidebar-mini'); |
| 190 | + paperDashboard.misc.sidebar_mini_active = false; |
| 191 | + $('.sidebar .sidebar-wrapper, .main-panel').perfectScrollbar(); |
| 192 | + } else { |
| 193 | + $('.sidebar .sidebar-wrapper, .main-panel').perfectScrollbar('destroy'); |
| 194 | + setTimeout(function () { |
| 195 | + $('body').addClass('sidebar-mini'); |
| 196 | + paperDashboard.misc.sidebar_mini_active = true; |
| 197 | + }, 300); |
| 198 | + } |
| 199 | + // we simulate the window Resize so the charts will get updated in realtime. |
| 200 | + var simulateWindowResize = setInterval(function () { |
| 201 | + window.dispatchEvent(new Event('resize')); |
| 202 | + }, 180); |
| 203 | + // we stop the simulation of Window Resize after the animations are completed |
| 204 | + setTimeout(function () { |
| 205 | + clearInterval(simulateWindowResize); |
| 206 | + }, 1000); |
| 207 | + }); |
| 208 | + }); |
| 209 | +</script> |
0 commit comments