├── README.md ├── css ├── app.js ├── bootstrap.min.js ├── jquery-1.10.1.min.js ├── jquery.backstretch.min.js ├── jquery.validate.min.js ├── login-soft.js ├── select2.min.js └── style.css ├── images ├── bg │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ └── 5.jpg ├── icons.png ├── mem2.jpg ├── s-colr.png └── tick.png └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # Hotspot Reponsivo Captive Portal Pfsense. 2 | Um template responsivo para Captive Portal do Pfsense, fique livre para baixar e modificar. 3 | 4 | Para trocar o texto da página do captive portal, basta editar o conteúdo da página index. 5 | Agora para trocar as imagens de fundo da página do captive portal, você deve editar o arquivo: login-soft.js, dentro da pasta css. 6 | 7 | Espero que gostem. 8 | -------------------------------------------------------------------------------- /css/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | Core script to handle the entire layout and base functions 3 | **/ 4 | var App = function () { 5 | 6 | // IE mode 7 | var isRTL = false; 8 | var isIE8 = false; 9 | var isIE9 = false; 10 | var isIE10 = false; 11 | 12 | var sidebarWidth = 225; 13 | var sidebarCollapsedWidth = 35; 14 | 15 | var responsiveHandlers = []; 16 | 17 | // theme layout color set 18 | var layoutColorCodes = { 19 | 'blue': '#4b8df8', 20 | 'red': '#e02222', 21 | 'green': '#35aa47', 22 | 'purple': '#852b99', 23 | 'grey': '#555555', 24 | 'light-grey': '#fafafa', 25 | 'yellow': '#ffb848' 26 | }; 27 | 28 | // last popep popover 29 | var lastPopedPopover; 30 | 31 | var handleInit = function() { 32 | 33 | if ($('body').css('direction') === 'rtl') { 34 | isRTL = true; 35 | } 36 | 37 | isIE8 = !! navigator.userAgent.match(/MSIE 8.0/); 38 | isIE9 = !! navigator.userAgent.match(/MSIE 9.0/); 39 | isIE10 = !! navigator.userAgent.match(/MSIE 10.0/); 40 | 41 | if (isIE10) { 42 | jQuery('html').addClass('ie10'); // detect IE10 version 43 | } 44 | } 45 | 46 | var handleDesktopTabletContents = function () { 47 | // loops all page elements with "responsive" class and applies classes for tablet mode 48 | // For Metronic 1280px or less set as tablet mode to display the content properly 49 | if ($(window).width() <= 1280 || $('body').hasClass('page-boxed')) { 50 | $(".responsive").each(function () { 51 | var forTablet = $(this).attr('data-tablet'); 52 | var forDesktop = $(this).attr('data-desktop'); 53 | if (forTablet) { 54 | $(this).removeClass(forDesktop); 55 | $(this).addClass(forTablet); 56 | } 57 | }); 58 | } 59 | 60 | // loops all page elements with "responsive" class and applied classes for desktop mode 61 | // For Metronic higher 1280px set as desktop mode to display the content properly 62 | if ($(window).width() > 1280 && $('body').hasClass('page-boxed') === false) { 63 | $(".responsive").each(function () { 64 | var forTablet = $(this).attr('data-tablet'); 65 | var forDesktop = $(this).attr('data-desktop'); 66 | if (forTablet) { 67 | $(this).removeClass(forTablet); 68 | $(this).addClass(forDesktop); 69 | } 70 | }); 71 | } 72 | } 73 | 74 | var handleSidebarState = function () { 75 | // remove sidebar toggler if window width smaller than 900(for table and phone mode) 76 | if ($(window).width() < 980) { 77 | $('body').removeClass("page-sidebar-closed"); 78 | } 79 | } 80 | 81 | var runResponsiveHandlers = function () { 82 | // reinitialize other subscribed elements 83 | for (var i in responsiveHandlers) { 84 | var each = responsiveHandlers[i]; 85 | each.call(); 86 | } 87 | } 88 | 89 | var handleResponsive = function () { 90 | handleTooltips(); 91 | handleSidebarState(); 92 | handleDesktopTabletContents(); 93 | handleSidebarAndContentHeight(); 94 | handleChoosenSelect(); 95 | handleFixedSidebar(); 96 | runResponsiveHandlers(); 97 | } 98 | 99 | var handleResponsiveOnInit = function () { 100 | handleSidebarState(); 101 | handleDesktopTabletContents(); 102 | handleSidebarAndContentHeight(); 103 | } 104 | 105 | var handleResponsiveOnResize = function () { 106 | var resize; 107 | if (isIE8) { 108 | var currheight; 109 | $(window).resize(function() { 110 | if(currheight == document.documentElement.clientHeight) { 111 | return; //quite event since only body resized not window. 112 | } 113 | if (resize) { 114 | clearTimeout(resize); 115 | } 116 | resize = setTimeout(function() { 117 | handleResponsive(); 118 | }, 50); // wait 50ms until window resize finishes. 119 | currheight = document.documentElement.clientHeight; // store last body client height 120 | }); 121 | } else { 122 | $(window).resize(function() { 123 | if (resize) { 124 | clearTimeout(resize); 125 | } 126 | resize = setTimeout(function() { 127 | handleResponsive(); 128 | }, 50); // wait 50ms until window resize finishes. 129 | }); 130 | } 131 | } 132 | 133 | //* BEGIN:CORE HANDLERS *// 134 | // this function handles responsive layout on screen size resize or mobile device rotate. 135 | 136 | var handleSidebarAndContentHeight = function () { 137 | var content = $('.page-content'); 138 | var sidebar = $('.page-sidebar'); 139 | var body = $('body'); 140 | var height; 141 | 142 | if (body.hasClass("page-footer-fixed") === true && body.hasClass("page-sidebar-fixed") === false) { 143 | var available_height = $(window).height() - $('.footer').height(); 144 | if (content.height() < available_height) { 145 | content.attr('style', 'min-height:' + available_height + 'px !important'); 146 | } 147 | } else { 148 | if (body.hasClass('page-sidebar-fixed')) { 149 | height = _calculateFixedSidebarViewportHeight(); 150 | } else { 151 | height = sidebar.height() + 20; 152 | } 153 | if (height >= content.height()) { 154 | content.attr('style', 'min-height:' + height + 'px !important'); 155 | } 156 | } 157 | } 158 | 159 | var handleSidebarMenu = function () { 160 | jQuery('.page-sidebar').on('click', 'li > a', function (e) { 161 | if ($(this).next().hasClass('sub-menu') == false) { 162 | if ($('.btn-navbar').hasClass('collapsed') == false) { 163 | $('.btn-navbar').click(); 164 | } 165 | return; 166 | } 167 | 168 | var parent = $(this).parent().parent(); 169 | var the = $(this); 170 | 171 | parent.children('li.open').children('a').children('.arrow').removeClass('open'); 172 | parent.children('li.open').children('.sub-menu').slideUp(200); 173 | parent.children('li.open').removeClass('open'); 174 | 175 | var sub = jQuery(this).next(); 176 | var slideOffeset = -200; 177 | var slideSpeed = 200; 178 | 179 | if (sub.is(":visible")) { 180 | jQuery('.arrow', jQuery(this)).removeClass("open"); 181 | jQuery(this).parent().removeClass("open"); 182 | sub.slideUp(slideSpeed, function () { 183 | if ($('body').hasClass('page-sidebar-fixed') == false && $('body').hasClass('page-sidebar-closed') == false) { 184 | App.scrollTo(the, slideOffeset); 185 | } 186 | handleSidebarAndContentHeight(); 187 | }); 188 | } else { 189 | jQuery('.arrow', jQuery(this)).addClass("open"); 190 | jQuery(this).parent().addClass("open"); 191 | sub.slideDown(slideSpeed, function () { 192 | if ($('body').hasClass('page-sidebar-fixed') == false && $('body').hasClass('page-sidebar-closed') == false) { 193 | App.scrollTo(the, slideOffeset); 194 | } 195 | handleSidebarAndContentHeight(); 196 | }); 197 | } 198 | 199 | e.preventDefault(); 200 | }); 201 | 202 | // handle ajax links 203 | jQuery('.page-sidebar').on('click', ' li > a.ajaxify', function (e) { 204 | e.preventDefault(); 205 | App.scrollTop(); 206 | 207 | var url = $(this).attr("href"); 208 | var menuContainer = jQuery('.page-sidebar ul'); 209 | var pageContent = $('.page-content'); 210 | var pageContentBody = $('.page-content .page-content-body'); 211 | 212 | menuContainer.children('li.active').removeClass('active'); 213 | menuContainer.children('arrow.open').removeClass('open'); 214 | 215 | $(this).parents('li').each(function () { 216 | $(this).addClass('active'); 217 | $(this).children('a > span.arrow').addClass('open'); 218 | }); 219 | $(this).parents('li').addClass('active'); 220 | 221 | App.blockUI(pageContent, false); 222 | 223 | $.ajax({ 224 | type: "GET", 225 | cache: false, 226 | url: url, 227 | dataType: "html", 228 | success: function(res) 229 | { 230 | App.unblockUI(pageContent); 231 | pageContentBody.html(res); 232 | App.fixContentHeight(); // fix content height 233 | App.initUniform(); // initialize uniform elements 234 | }, 235 | error: function(xhr, ajaxOptions, thrownError) 236 | { 237 | pageContentBody.html('

Could not load the requested content.

'); 238 | App.unblockUI(pageContent); 239 | }, 240 | async: false 241 | }); 242 | }); 243 | } 244 | 245 | var _calculateFixedSidebarViewportHeight = function () { 246 | var sidebarHeight = $(window).height() - $('.header').height() + 1; 247 | if ($('body').hasClass("page-footer-fixed")) { 248 | sidebarHeight = sidebarHeight - $('.footer').height(); 249 | } 250 | 251 | return sidebarHeight; 252 | } 253 | 254 | var handleFixedSidebar = function () { 255 | var menu = $('.page-sidebar-menu'); 256 | 257 | if (menu.parent('.slimScrollDiv').size() === 1) { // destroy existing instance before updating the height 258 | menu.slimScroll({ 259 | destroy: true 260 | }); 261 | menu.removeAttr('style'); 262 | $('.page-sidebar').removeAttr('style'); 263 | } 264 | 265 | if ($('.page-sidebar-fixed').size() === 0) { 266 | handleSidebarAndContentHeight(); 267 | return; 268 | } 269 | 270 | if ($(window).width() >= 980) { 271 | var sidebarHeight = _calculateFixedSidebarViewportHeight(); 272 | 273 | menu.slimScroll({ 274 | size: '7px', 275 | color: '#a1b2bd', 276 | opacity: .3, 277 | position: isRTL ? 'left' : ($('.page-sidebar-on-right').size() === 1 ? 'left' : 'right'), 278 | height: sidebarHeight, 279 | allowPageScroll: false, 280 | disableFadeOut: false 281 | }); 282 | handleSidebarAndContentHeight(); 283 | } 284 | } 285 | 286 | var handleFixedSidebarHoverable = function () { 287 | if ($('body').hasClass('page-sidebar-fixed') === false) { 288 | return; 289 | } 290 | 291 | $('.page-sidebar').off('mouseenter').on('mouseenter', function () { 292 | var body = $('body'); 293 | 294 | if ((body.hasClass('page-sidebar-closed') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) { 295 | return; 296 | } 297 | 298 | body.removeClass('page-sidebar-closed').addClass('page-sidebar-hover-on'); 299 | $(this).addClass('page-sidebar-hovering'); 300 | $(this).animate({ 301 | width: sidebarWidth 302 | }, 400, '', function () { 303 | $(this).removeClass('page-sidebar-hovering'); 304 | }); 305 | }); 306 | 307 | $('.page-sidebar').off('mouseleave').on('mouseleave', function () { 308 | var body = $('body'); 309 | 310 | if ((body.hasClass('page-sidebar-hover-on') === false || body.hasClass('page-sidebar-fixed') === false) || $(this).hasClass('page-sidebar-hovering')) { 311 | return; 312 | } 313 | 314 | $(this).addClass('page-sidebar-hovering'); 315 | $(this).animate({ 316 | width: sidebarCollapsedWidth 317 | }, 400, '', function () { 318 | $('body').addClass('page-sidebar-closed').removeClass('page-sidebar-hover-on'); 319 | $(this).removeClass('page-sidebar-hovering'); 320 | }); 321 | }); 322 | } 323 | 324 | var handleSidebarToggler = function () { 325 | // handle sidebar show/hide 326 | $('.page-sidebar').on('click', '.sidebar-toggler', function (e) { 327 | var body = $('body'); 328 | var sidebar = $('.page-sidebar'); 329 | 330 | if ((body.hasClass("page-sidebar-hover-on") && body.hasClass('page-sidebar-fixed')) || sidebar.hasClass('page-sidebar-hovering')) { 331 | body.removeClass('page-sidebar-hover-on'); 332 | sidebar.css('width', '').hide().show(); 333 | e.stopPropagation(); 334 | runResponsiveHandlers(); 335 | return; 336 | } 337 | 338 | $(".sidebar-search", sidebar).removeClass("open"); 339 | 340 | if (body.hasClass("page-sidebar-closed")) { 341 | body.removeClass("page-sidebar-closed"); 342 | if (body.hasClass('page-sidebar-fixed')) { 343 | sidebar.css('width', ''); 344 | } 345 | } else { 346 | body.addClass("page-sidebar-closed"); 347 | } 348 | runResponsiveHandlers(); 349 | }); 350 | 351 | // handle the search bar close 352 | $('.page-sidebar').on('click', '.sidebar-search .remove', function (e) { 353 | e.preventDefault(); 354 | $('.sidebar-search').removeClass("open"); 355 | }); 356 | 357 | // handle the search query submit on enter press 358 | $('.page-sidebar').on('keypress', '.sidebar-search input', function (e) { 359 | if (e.which == 13) { 360 | window.location.href = "extra_search.html"; 361 | return false; //<---- Add this line 362 | } 363 | }); 364 | 365 | // handle the search submit 366 | $('.sidebar-search .submit').on('click', function (e) { 367 | e.preventDefault(); 368 | 369 | if ($('body').hasClass("page-sidebar-closed")) { 370 | if ($('.sidebar-search').hasClass('open') == false) { 371 | if ($('.page-sidebar-fixed').size() === 1) { 372 | $('.page-sidebar .sidebar-toggler').click(); //trigger sidebar toggle button 373 | } 374 | $('.sidebar-search').addClass("open"); 375 | } else { 376 | window.location.href = "extra_search.html"; 377 | } 378 | } else { 379 | window.location.href = "extra_search.html"; 380 | } 381 | }); 382 | } 383 | 384 | var handleHorizontalMenu = function () { 385 | //handle hor menu search form toggler click 386 | $('.header').on('click', '.hor-menu .hor-menu-search-form-toggler', function (e) { 387 | if ($(this).hasClass('hide')) { 388 | $(this).removeClass('hide'); 389 | $('.header .hor-menu .search-form').hide(); 390 | } else { 391 | $(this).addClass('hide'); 392 | $('.header .hor-menu .search-form').show(); 393 | } 394 | e.preventDefault(); 395 | }); 396 | 397 | //handle hor menu search button click 398 | $('.header').on('click', '.hor-menu .search-form .btn', function (e) { 399 | window.location.href = "extra_search.html"; 400 | e.preventDefault(); 401 | }); 402 | 403 | //handle hor menu search form on enter press 404 | $('.header').on('keypress', '.hor-menu .search-form input', function (e) { 405 | if (e.which == 13) { 406 | window.location.href = "extra_search.html"; 407 | return false; 408 | } 409 | }); 410 | } 411 | 412 | var handleGoTop = function () { 413 | /* set variables locally for increased performance */ 414 | jQuery('.footer').on('click', '.go-top', function (e) { 415 | App.scrollTo(); 416 | e.preventDefault(); 417 | }); 418 | } 419 | 420 | var handlePortletTools = function () { 421 | jQuery('body').on('click', '.portlet > .portlet-title > .tools > a.remove', function (e) { 422 | e.preventDefault(); 423 | jQuery(this).closest(".portlet").remove(); 424 | }); 425 | 426 | jQuery('body').on('click', '.portlet > .portlet-title > .tools > a.reload', function (e) { 427 | e.preventDefault(); 428 | var el = jQuery(this).closest(".portlet").children(".portlet-body"); 429 | App.blockUI(el); 430 | window.setTimeout(function () { 431 | App.unblockUI(el); 432 | }, 1000); 433 | }); 434 | 435 | jQuery('body').on('click', '.portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand', function (e) { 436 | e.preventDefault(); 437 | var el = jQuery(this).closest(".portlet").children(".portlet-body"); 438 | if (jQuery(this).hasClass("collapse")) { 439 | jQuery(this).removeClass("collapse").addClass("expand"); 440 | el.slideUp(200); 441 | } else { 442 | jQuery(this).removeClass("expand").addClass("collapse"); 443 | el.slideDown(200); 444 | } 445 | }); 446 | } 447 | 448 | var handleUniform = function () { 449 | if (!jQuery().uniform) { 450 | return; 451 | } 452 | var test = $("input[type=checkbox]:not(.toggle), input[type=radio]:not(.toggle, .star)"); 453 | if (test.size() > 0) { 454 | test.each(function () { 455 | if ($(this).parents(".checker").size() == 0) { 456 | $(this).show(); 457 | $(this).uniform(); 458 | } 459 | }); 460 | } 461 | } 462 | 463 | var handleAccordions = function () { 464 | $(".accordion").collapse().height('auto'); 465 | var lastClicked; 466 | //add scrollable class name if you need scrollable panes 467 | jQuery('body').on('click', '.accordion.scrollable .accordion-toggle', function () { 468 | lastClicked = jQuery(this); 469 | }); //move to faq section 470 | 471 | jQuery('body').on('shown', '.accordion.scrollable', function () { 472 | jQuery('html,body').animate({ 473 | scrollTop: lastClicked.offset().top - 150 474 | }, 'slow'); 475 | }); 476 | } 477 | 478 | var handleTabs = function () { 479 | 480 | // function to fix left/right tab contents 481 | var fixTabHeight = function(tab) { 482 | $(tab).each(function() { 483 | var content = $($($(this).attr("href"))); 484 | var tab = $(this).parent().parent(); 485 | if (tab.height() > content.height()) { 486 | content.css('min-height', tab.height()); 487 | } 488 | }); 489 | } 490 | 491 | // fix tab content on tab shown 492 | $('body').on('shown', '.nav.nav-tabs.tabs-left a[data-toggle="tab"], .nav.nav-tabs.tabs-right a[data-toggle="tab"]', function(){ 493 | fixTabHeight($(this)); 494 | }); 495 | 496 | $('body').on('shown', '.nav.nav-tabs', function(){ 497 | handleSidebarAndContentHeight(); 498 | }); 499 | 500 | //fix tab contents for left/right tabs 501 | fixTabHeight('.nav.nav-tabs.tabs-left > li.active > a[data-toggle="tab"], .nav.nav-tabs.tabs-right > li.active > a[data-toggle="tab"]'); 502 | 503 | //activate tab if tab id provided in the URL 504 | if(location.hash) { 505 | var tabid = location.hash.substr(1); 506 | $('a[href="#'+tabid+'"]').click(); 507 | } 508 | } 509 | 510 | var handleScrollers = function () { 511 | $('.scroller').each(function () { 512 | var height; 513 | if ($(this).attr("data-height")) { 514 | height = $(this).attr("data-height"); 515 | } else { 516 | height = $(this).css('height'); 517 | } 518 | $(this).slimScroll({ 519 | size: '7px', 520 | color: '#a1b2bd', 521 | position: isRTL ? 'left' : 'right', 522 | height: height, 523 | alwaysVisible: ($(this).attr("data-always-visible") == "1" ? true : false), 524 | railVisible: ($(this).attr("data-rail-visible") == "1" ? true : false), 525 | disableFadeOut: true 526 | }); 527 | }); 528 | } 529 | 530 | var handleTooltips = function () { 531 | if (App.isTouchDevice()) { // if touch device, some tooltips can be skipped in order to not conflict with click events 532 | jQuery('.tooltips:not(.no-tooltip-on-touch-device)').tooltip(); 533 | } else { 534 | jQuery('.tooltips').tooltip(); 535 | } 536 | } 537 | 538 | var handleDropdowns = function () { 539 | $('body').on('click', '.dropdown-menu.hold-on-click', function(e){ 540 | e.stopPropagation(); 541 | }) 542 | } 543 | 544 | var handleModal = function () { 545 | // this function adds .modal-open class to body element for select2 and chosen dropdown hacks 546 | if (jQuery().modalmanager) { 547 | return; // skip if Extended Modal plugin is used 548 | } 549 | 550 | $('body').on('shown', '.modal', function(e){ 551 | $('body').addClass('modal-open'); 552 | }); 553 | 554 | $('body').on('hidden', '.modal', function(e){ 555 | if ($('.modal').size() === 0) { 556 | $('body').removeClass('modal-open'); 557 | } 558 | }); 559 | } 560 | 561 | var handlePopovers = function () { 562 | jQuery('.popovers').popover(); 563 | 564 | // close last poped popover 565 | 566 | $(document).on('click.popover.data-api',function(e) { 567 | if(lastPopedPopover){ 568 | lastPopedPopover.popover('hide'); 569 | } 570 | }); 571 | } 572 | 573 | var handleChoosenSelect = function () { 574 | if (!jQuery().chosen) { 575 | return; 576 | } 577 | 578 | $(".chosen").each(function () { 579 | $(this).chosen({ 580 | allow_single_deselect: $(this).attr("data-with-deselect") == "1" ? true : false 581 | }); 582 | }); 583 | } 584 | 585 | var handleFancybox = function () { 586 | if (!jQuery.fancybox) { 587 | return; 588 | } 589 | 590 | if (jQuery(".fancybox-button").size() > 0) { 591 | jQuery(".fancybox-button").fancybox({ 592 | groupAttr: 'data-rel', 593 | prevEffect: 'none', 594 | nextEffect: 'none', 595 | closeBtn: true, 596 | helpers: { 597 | title: { 598 | type: 'inside' 599 | } 600 | } 601 | }); 602 | } 603 | } 604 | 605 | var handleTheme = function () { 606 | 607 | var panel = $('.color-panel'); 608 | 609 | if ($('body').hasClass('page-boxed') == false) { 610 | $('.layout-option', panel).val("fluid"); 611 | } 612 | 613 | $('.sidebar-option', panel).val("default"); 614 | $('.header-option', panel).val("fixed"); 615 | $('.footer-option', panel).val("default"); 616 | 617 | //handle theme layout 618 | var resetLayout = function () { 619 | $("body"). 620 | removeClass("page-boxed"). 621 | removeClass("page-footer-fixed"). 622 | removeClass("page-sidebar-fixed"). 623 | removeClass("page-header-fixed"); 624 | 625 | $('.header > .navbar-inner > .container').removeClass("container").addClass("container-fluid"); 626 | 627 | if ($('.page-container').parent(".container").size() === 1) { 628 | $('.page-container').insertAfter('.header'); 629 | } 630 | 631 | if ($('.footer > .container').size() === 1) { 632 | $('.footer').html($('.footer > .container').html()); 633 | } else if ($('.footer').parent(".container").size() === 1) { 634 | $('.footer').insertAfter('.page-container'); 635 | } 636 | 637 | $('body > .container').remove(); 638 | } 639 | 640 | var lastSelectedLayout = ''; 641 | 642 | var setLayout = function () { 643 | 644 | var layoutOption = $('.layout-option', panel).val(); 645 | var sidebarOption = $('.sidebar-option', panel).val(); 646 | var headerOption = $('.header-option', panel).val(); 647 | var footerOption = $('.footer-option', panel).val(); 648 | 649 | if (sidebarOption == "fixed" && headerOption == "default") { 650 | alert('Default Header with Fixed Sidebar option is not supported. Proceed with Default Header with Default Sidebar.'); 651 | $('.sidebar-option', panel).val("default"); 652 | sidebarOption = 'default'; 653 | } 654 | 655 | resetLayout(); // reset layout to default state 656 | 657 | if (layoutOption === "boxed") { 658 | $("body").addClass("page-boxed"); 659 | 660 | // set header 661 | $('.header > .navbar-inner > .container-fluid').removeClass("container-fluid").addClass("container"); 662 | var cont = $('.header').after('
'); 663 | 664 | // set content 665 | $('.page-container').appendTo('body > .container'); 666 | 667 | // set footer 668 | if (footerOption === 'fixed' || sidebarOption === 'default') { 669 | $('.footer').html('
'+$('.footer').html()+'
'); 670 | } else { 671 | $('.footer').appendTo('body > .container'); 672 | } 673 | } 674 | 675 | if (lastSelectedLayout != layoutOption) { 676 | //layout changed, run responsive handler: 677 | runResponsiveHandlers(); 678 | } 679 | lastSelectedLayout = layoutOption; 680 | 681 | //header 682 | if (headerOption === 'fixed') { 683 | $("body").addClass("page-header-fixed"); 684 | $(".header").removeClass("navbar-static-top").addClass("navbar-fixed-top"); 685 | } else { 686 | $("body").removeClass("page-header-fixed"); 687 | $(".header").removeClass("navbar-fixed-top").addClass("navbar-static-top"); 688 | } 689 | 690 | //sidebar 691 | if (sidebarOption === 'fixed') { 692 | $("body").addClass("page-sidebar-fixed"); 693 | } else { 694 | $("body").removeClass("page-sidebar-fixed"); 695 | } 696 | 697 | //footer 698 | if (footerOption === 'fixed') { 699 | $("body").addClass("page-footer-fixed"); 700 | } else { 701 | $("body").removeClass("page-footer-fixed"); 702 | } 703 | 704 | handleSidebarAndContentHeight(); // fix content height 705 | handleFixedSidebar(); // reinitialize fixed sidebar 706 | handleFixedSidebarHoverable(); // reinitialize fixed sidebar hover effect 707 | } 708 | 709 | // handle theme colors 710 | var setColor = function (color) { 711 | $('#style_color').attr("href", "assets/css/themes/" + color + ".css"); 712 | $.cookie('style_color', color); 713 | } 714 | 715 | $('.icon-color', panel).click(function () { 716 | $('.color-mode').show(); 717 | $('.icon-color-close').show(); 718 | }); 719 | 720 | $('.icon-color-close', panel).click(function () { 721 | $('.color-mode').hide(); 722 | $('.icon-color-close').hide(); 723 | }); 724 | 725 | $('li', panel).click(function () { 726 | var color = $(this).attr("data-style"); 727 | setColor(color); 728 | $('.inline li', panel).removeClass("current"); 729 | $(this).addClass("current"); 730 | }); 731 | 732 | $('.layout-option, .header-option, .sidebar-option, .footer-option', panel).change(setLayout); 733 | } 734 | 735 | var handleFixInputPlaceholderForIE = function () { 736 | //fix html5 placeholder attribute for ie7 & ie8 737 | if (isIE8 || isIE9) { // ie7&ie8 738 | // this is html5 placeholder fix for inputs, inputs with placeholder-no-fix class will be skipped(e.g: we need this for password fields) 739 | jQuery('input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)').each(function () { 740 | 741 | var input = jQuery(this); 742 | 743 | if(input.val()=='' && input.attr("placeholder") != '') { 744 | input.addClass("placeholder").val(input.attr('placeholder')); 745 | } 746 | 747 | input.focus(function () { 748 | if (input.val() == input.attr('placeholder')) { 749 | input.val(''); 750 | } 751 | }); 752 | 753 | input.blur(function () { 754 | if (input.val() == '' || input.val() == input.attr('placeholder')) { 755 | input.val(input.attr('placeholder')); 756 | } 757 | }); 758 | }); 759 | } 760 | } 761 | 762 | var handleFullScreenMode = function() { 763 | // mozfullscreenerror event handler 764 | 765 | // toggle full screen 766 | function toggleFullScreen() { 767 | if (!document.fullscreenElement && // alternative standard method 768 | !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods 769 | if (document.documentElement.requestFullscreen) { 770 | document.documentElement.requestFullscreen(); 771 | } else if (document.documentElement.mozRequestFullScreen) { 772 | document.documentElement.mozRequestFullScreen(); 773 | } else if (document.documentElement.webkitRequestFullscreen) { 774 | document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); 775 | } 776 | } else { 777 | if (document.cancelFullScreen) { 778 | document.cancelFullScreen(); 779 | } else if (document.mozCancelFullScreen) { 780 | document.mozCancelFullScreen(); 781 | } else if (document.webkitCancelFullScreen) { 782 | document.webkitCancelFullScreen(); 783 | } 784 | } 785 | } 786 | 787 | $('#trigger_fullscreen').click(function() { 788 | toggleFullScreen(); 789 | }); 790 | } 791 | 792 | //* END:CORE HANDLERS *// 793 | 794 | return { 795 | 796 | //main function to initiate template pages 797 | init: function () { 798 | 799 | //IMPORTANT!!!: Do not modify the core handlers call order. 800 | 801 | //core handlers 802 | handleInit(); 803 | handleResponsiveOnResize(); // set and handle responsive 804 | handleUniform(); 805 | handleScrollers(); // handles slim scrolling contents 806 | handleResponsiveOnInit(); // handler responsive elements on page load 807 | 808 | //layout handlers 809 | handleFixedSidebar(); // handles fixed sidebar menu 810 | handleFixedSidebarHoverable(); // handles fixed sidebar on hover effect 811 | handleSidebarMenu(); // handles main menu 812 | handleHorizontalMenu(); // handles horizontal menu 813 | handleSidebarToggler(); // handles sidebar hide/show 814 | handleFixInputPlaceholderForIE(); // fixes/enables html5 placeholder attribute for IE9, IE8 815 | handleGoTop(); //handles scroll to top functionality in the footer 816 | handleTheme(); // handles style customer tool 817 | 818 | //ui component handlers 819 | handlePortletTools(); // handles portlet action bar functionality(refresh, configure, toggle, remove) 820 | handleDropdowns(); // handle dropdowns 821 | handleTabs(); // handle tabs 822 | handleTooltips(); // handle bootstrap tooltips 823 | handlePopovers(); // handles bootstrap popovers 824 | handleAccordions(); //handles accordions 825 | handleChoosenSelect(); // handles bootstrap chosen dropdowns 826 | handleModal(); 827 | 828 | App.addResponsiveHandler(handleChoosenSelect); // reinitiate chosen dropdown on main content resize. disable this line if you don't really use chosen dropdowns. 829 | handleFullScreenMode() // handles full screen 830 | }, 831 | 832 | fixContentHeight: function () { 833 | handleSidebarAndContentHeight(); 834 | }, 835 | 836 | setLastPopedPopover: function (el) { 837 | lastPopedPopover = el; 838 | }, 839 | 840 | addResponsiveHandler: function (func) { 841 | responsiveHandlers.push(func); 842 | }, 843 | 844 | // useful function to make equal height for contacts stand side by side 845 | setEqualHeight: function (els) { 846 | var tallestEl = 0; 847 | els = jQuery(els); 848 | els.each(function () { 849 | var currentHeight = $(this).height(); 850 | if (currentHeight > tallestEl) { 851 | tallestColumn = currentHeight; 852 | } 853 | }); 854 | els.height(tallestEl); 855 | }, 856 | 857 | // wrapper function to scroll to an element 858 | scrollTo: function (el, offeset) { 859 | pos = el ? el.offset().top : 0; 860 | jQuery('html,body').animate({ 861 | scrollTop: pos + (offeset ? offeset : 0) 862 | }, 'slow'); 863 | }, 864 | 865 | scrollTop: function () { 866 | App.scrollTo(); 867 | }, 868 | 869 | // wrapper function to block element(indicate loading) 870 | blockUI: function (el, centerY) { 871 | var el = jQuery(el); 872 | el.block({ 873 | message: '', 874 | centerY: centerY != undefined ? centerY : true, 875 | css: { 876 | top: '10%', 877 | border: 'none', 878 | padding: '2px', 879 | backgroundColor: 'none' 880 | }, 881 | overlayCSS: { 882 | backgroundColor: '#000', 883 | opacity: 0.05, 884 | cursor: 'wait' 885 | } 886 | }); 887 | }, 888 | 889 | // wrapper function to un-block element(finish loading) 890 | unblockUI: function (el) { 891 | jQuery(el).unblock({ 892 | onUnblock: function () { 893 | jQuery(el).removeAttr("style"); 894 | } 895 | }); 896 | }, 897 | 898 | // initializes uniform elements 899 | initUniform: function (els) { 900 | 901 | if (els) { 902 | jQuery(els).each(function () { 903 | if ($(this).parents(".checker").size() == 0) { 904 | $(this).show(); 905 | $(this).uniform(); 906 | } 907 | }); 908 | } else { 909 | handleUniform(); 910 | } 911 | 912 | }, 913 | 914 | updateUniform : function(els) { 915 | $.uniform.update(els); 916 | }, 917 | 918 | // initializes choosen dropdowns 919 | initChosenSelect: function (els) { 920 | $(els).chosen({ 921 | allow_single_deselect: true 922 | }); 923 | }, 924 | 925 | initFancybox: function () { 926 | handleFancybox(); 927 | }, 928 | 929 | getActualVal: function (el) { 930 | var el = jQuery(el); 931 | if (el.val() === el.attr("placeholder")) { 932 | return ""; 933 | } 934 | 935 | return el.val(); 936 | }, 937 | 938 | getURLParameter: function (paramName) { 939 | var searchString = window.location.search.substring(1), 940 | i, val, params = searchString.split("&"); 941 | 942 | for (i = 0; i < params.length; i++) { 943 | val = params[i].split("="); 944 | if (val[0] == paramName) { 945 | return unescape(val[1]); 946 | } 947 | } 948 | return null; 949 | }, 950 | 951 | // check for device touch support 952 | isTouchDevice: function () { 953 | try { 954 | document.createEvent("TouchEvent"); 955 | return true; 956 | } catch (e) { 957 | return false; 958 | } 959 | }, 960 | 961 | isIE8: function () { 962 | return isIE8; 963 | }, 964 | 965 | isRTL: function () { 966 | return isRTL; 967 | }, 968 | 969 | getLayoutColorCode: function (name) { 970 | if (layoutColorCodes[name]) { 971 | return layoutColorCodes[name]; 972 | } else { 973 | return ''; 974 | } 975 | } 976 | 977 | }; 978 | 979 | }(); -------------------------------------------------------------------------------- /css/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap.js by @fat & @mdo 3 | * Copyright 2012 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('