├── 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('').insertBefore(e(this)).on("click",r),s.toggleClass("open")),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:''}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:'',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
--------------------------------------------------------------------------------
/css/jquery.backstretch.min.js:
--------------------------------------------------------------------------------
1 | /*! Backstretch - v2.0.3 - 2012-11-30
2 | * http://srobbin.com/jquery-plugins/backstretch/
3 | * Copyright (c) 2012 Scott Robbin; Licensed MIT */
4 | (function(e,t,n){"use strict";e.fn.backstretch=function(r,s){return(r===n||r.length===0)&&e.error("No images were supplied for Backstretch"),e(t).scrollTop()===0&&t.scrollTo(0,0),this.each(function(){var t=e(this),n=t.data("backstretch");n&&(s=e.extend(n.options,s),n.destroy(!0)),n=new i(this,r,s),t.data("backstretch",n)})},e.backstretch=function(t,n){return e("body").backstretch(t,n).data("backstretch")},e.expr[":"].backstretch=function(t){return e(t).data("backstretch")!==n},e.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5e3,fade:0};var r={wrap:{left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},img:{position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxWidth:"none",zIndex:-999999}},i=function(n,i,o){this.options=e.extend({},e.fn.backstretch.defaults,o||{}),this.images=e.isArray(i)?i:[i],e.each(this.images,function(){e("
")[0].src=this}),this.isBody=n===document.body,this.$container=e(n),this.$wrap=e('').css(r.wrap).appendTo(this.$container),this.$root=this.isBody?s?e(t):e(document):this.$container;if(!this.isBody){var u=this.$container.css("position"),a=this.$container.css("zIndex");this.$container.css({position:u==="static"?"relative":u,zIndex:a==="auto"?0:a,background:"none"}),this.$wrap.css({zIndex:-999998})}this.$wrap.css({position:this.isBody&&s?"fixed":"absolute"}),this.index=0,this.show(this.index),e(t).on("resize.backstretch",e.proxy(this.resize,this)).on("orientationchange.backstretch",e.proxy(function(){this.isBody&&t.pageYOffset===0&&(t.scrollTo(0,1),this.resize())},this))};i.prototype={resize:function(){try{var e={left:0,top:0},n=this.isBody?this.$root.width():this.$root.innerWidth(),r=n,i=this.isBody?t.innerHeight?t.innerHeight:this.$root.height():this.$root.innerHeight(),s=r/this.$img.data("ratio"),o;s>=i?(o=(s-i)/2,this.options.centeredY&&(e.top="-"+o+"px")):(s=i,r=s*this.$img.data("ratio"),o=(r-n)/2,this.options.centeredX&&(e.left="-"+o+"px")),this.$wrap.css({width:n,height:i}).find("img:not(.deleteable)").css({width:r,height:s}).css(e)}catch(u){}return this},show:function(t){if(Math.abs(t)>this.images.length-1)return;this.index=t;var n=this,i=n.$wrap.find("img").addClass("deleteable"),s=e.Event("backstretch.show",{relatedTarget:n.$container[0]});return clearInterval(n.interval),n.$img=e("
").css(r.img).bind("load",function(t){var r=this.width||e(t.target).width(),o=this.height||e(t.target).height();e(this).data("ratio",r/o),e(this).fadeIn(n.options.speed||n.options.fade,function(){i.remove(),n.paused||n.cycle(),n.$container.trigger(s,n)}),n.resize()}).appendTo(n.$wrap),n.$img.attr("src",n.images[t]),n},next:function(){return this.show(this.index1&&(clearInterval(this.interval),this.interval=setInterval(e.proxy(function(){this.paused||this.next()},this),this.options.duration)),this},destroy:function(n){e(t).off("resize.backstretch orientationchange.backstretch"),clearInterval(this.interval),n||this.$wrap.remove(),this.$container.removeData("backstretch")}};var s=function(){var e=navigator.userAgent,n=navigator.platform,r=e.match(/AppleWebKit\/([0-9]+)/),i=!!r&&r[1],s=e.match(/Fennec\/([0-9]+)/),o=!!s&&s[1],u=e.match(/Opera Mobi\/([0-9]+)/),a=!!u&&u[1],f=e.match(/MSIE ([0-9]+)/),l=!!f&&f[1];return!((n.indexOf("iPhone")>-1||n.indexOf("iPad")>-1||n.indexOf("iPod")>-1)&&i&&i<534||t.operamini&&{}.toString.call(t.operamini)==="[object OperaMini]"||u&&a<7458||e.indexOf("Android")>-1&&i&&i<533||o&&o<6||"palmGetResource"in t&&i&&i<534||e.indexOf("MeeGo")>-1&&e.indexOf("NokiaBrowser/8.5.0")>-1||l&&l<=6)}()})(jQuery,window);
--------------------------------------------------------------------------------
/css/jquery.validate.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery Validation Plugin 1.11.1
3 | *
4 | * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
5 | * http://docs.jquery.com/Plugins/Validation
6 | *
7 | * Copyright 2013 Jörn Zaefferer
8 | * Modified by KeenThemes(refer line #665)
9 | * Released under the MIT license:
10 | * http://www.opensource.org/licenses/mit-license.php
11 | */
12 | (function(a){a.extend(a.fn,{validate:function(b){if(!this.length){if(b&&b.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.")}return}var c=a.data(this[0],"validator");if(c){return c}this.attr("novalidate","novalidate");c=new a.validator(b,this[0]);a.data(this[0],"validator",c);if(c.settings.onsubmit){this.validateDelegate(":submit","click",function(d){if(c.settings.submitHandler){c.submitButton=d.target}if(a(d.target).hasClass("cancel")){c.cancelSubmit=true}if(a(d.target).attr("formnovalidate")!==undefined){c.cancelSubmit=true}});this.submit(function(d){if(c.settings.debug){d.preventDefault()}function e(){var f;if(c.settings.submitHandler){if(c.submitButton){f=a("").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)}c.settings.submitHandler.call(c,c.currentForm,d);if(c.submitButton){f.remove()}return false}return true}if(c.cancelSubmit){c.cancelSubmit=false;return e()}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false}return e()}else{c.focusInvalid();return false}})}return c},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var c=true;var b=a(this[0].form).validate();this.each(function(){c=c&&b.element(this)});return c}},removeAttrs:function(d){var b={},c=this;a.each(d.split(/\s/),function(e,f){b[f]=c.attr(f);c.removeAttr(f)});return b},rules:function(e,b){var g=this[0];if(e){var d=a.data(g.form,"validator").settings;var i=d.rules;var j=a.validator.staticRules(g);switch(e){case"add":a.extend(j,a.validator.normalizeRule(b));delete j.messages;i[g.name]=j;if(b.messages){d.messages[g.name]=a.extend(d.messages[g.name],b.messages)}break;case"remove":if(!b){delete i[g.name];return j}var h={};a.each(b.split(/\s/),function(k,l){h[l]=j[l];delete j[l]});return h}}var f=a.validator.normalizeRules(a.extend({},a.validator.classRules(g),a.validator.attributeRules(g),a.validator.dataRules(g),a.validator.staticRules(g)),g);if(f.required){var c=f.required;delete f.required;f=a.extend({required:c},f)}return f}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(""+a(b).val())},filled:function(b){return !!a.trim(""+a(b).val())},unchecked:function(b){return !a(b).prop("checked")}});a.validator=function(b,c){this.settings=a.extend(true,{},a.validator.defaults,b);this.currentForm=c;this.init()};a.validator.format=function(b,c){if(arguments.length===1){return function(){var d=a.makeArray(arguments);d.unshift(b);return a.validator.format.apply(this,d)}}if(arguments.length>2&&c.constructor!==Array){c=a.makeArray(arguments).slice(1)}if(c.constructor!==Array){c=[c]}a.each(c,function(d,e){b=b.replace(new RegExp("\\{"+d+"\\}","g"),function(){return e})});return b};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(b,c){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,b,this.settings.errorClass,this.settings.validClass)}this.addWrapper(this.errorsFor(b)).hide()}},onfocusout:function(b,c){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b,c){if(c.which===9&&this.elementValue(b)===""){return}else{if(b.name in this.submitted||b===this.lastElement){this.element(b)}}},onclick:function(b,c){if(b.name in this.submitted){this.element(b)}else{if(b.parentNode.name in this.submitted){this.element(b.parentNode)}}},highlight:function(d,b,c){if(d.type==="radio"){this.findByName(d.name).addClass(b).removeClass(c)}else{a(d).addClass(b).removeClass(c)}},unhighlight:function(d,b,c){if(d.type==="radio"){this.findByName(d.name).removeClass(b).addClass(c)}else{a(d).removeClass(b).addClass(c)}}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=(this.groups={});a.each(this.settings.groups,function(e,f){if(typeof f==="string"){f=f.split(/\s/)}a.each(f,function(h,g){b[g]=e})});var d=this.settings.rules;a.each(d,function(e,f){d[e]=a.validator.normalizeRule(f)});function c(g){var f=a.data(this[0].form,"validator"),e="on"+g.type.replace(/^validate/,"");if(f.settings[e]){f.settings[e].call(f,this[0],g)}}a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",c).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",c);if(this.settings.invalidHandler){a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);if(!this.valid()){a(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var b=0,c=(this.currentElements=this.elements());c[b];b++){this.check(c[b])}return this.valid()},element:function(c){c=this.validationTargetFor(this.clean(c));this.lastElement=c;this.prepareElement(c);this.currentElements=a(c);var b=this.check(c)!==false;if(b){delete this.invalid[c.name]}else{this.invalid[c.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return b},showErrors:function(c){if(c){a.extend(this.errorMap,c);this.errorList=[];for(var b in c){this.errorList.push({message:c[b],element:this.findByName(b)[0]})}this.successList=a.grep(this.successList,function(d){return !(d.name in c)})}if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList)}else{this.defaultShowErrors()}},resetForm:function(){if(a.fn.resetForm){a(this.currentForm).resetForm()}this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(d){var c=0;for(var b in d){c++}return c},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name===b.name}).length===1&&b},elements:function(){var c=this,b={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){if(!this.name&&c.settings.debug&&window.console){console.error("%o has no name assigned",this)}if(this.name in b||!c.objectLength(a(this).rules())){return false}b[this.name]=true;return true})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.replace(" ",".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b)},elementValue:function(b){var c=a(b).attr("type"),d=a(b).val();if(c==="radio"||c==="checkbox"){return a("input[name='"+a(b).attr("name")+"']:checked").val()}if(typeof d==="string"){return d.replace(/\r/g,"")}return d},check:function(c){c=this.validationTargetFor(this.clean(c));var i=a(c).rules();var d=false;var h=this.elementValue(c);var b;for(var j in i){var g={method:j,parameters:i[j]};try{b=a.validator.methods[j].call(this,h,c,g.parameters);if(b==="dependency-mismatch"){d=true;continue}d=false;if(b==="pending"){this.toHide=this.toHide.not(this.errorsFor(c));return}if(!b){this.formatAndAdd(c,g);return false}}catch(f){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+c.id+", check the '"+g.method+"' method.",f)}throw f}}if(d){return}if(this.objectLength(i)){this.successList.push(c)}return true},customDataMessage:function(b,c){return a(b).data("msg-"+c.toLowerCase())||(b.attributes&&a(b).attr("data-msg-"+c.toLowerCase()))},customMessage:function(c,d){var b=this.settings.messages[c];return b&&(b.constructor===String?b:b[d])},findDefined:function(){for(var b=0;bWarning: No message defined for "+b.name+"")},formatAndAdd:function(c,e){var d=this.defaultMessage(c,e.method),b=/\$?\{(\d+)\}/g;if(typeof d==="function"){d=d.call(this,e.parameters,c)}else{if(b.test(d)){d=a.validator.format(d.replace(b,"{$1}"),e.parameters)}}this.errorList.push({message:d,element:c});this.errorMap[c.name]=d;this.submitted[c.name]=d},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parent(this.settings.wrapper))}return b},defaultShowErrors:function(){var c,d;for(c=0;this.errorList[c];c++){var b=this.errorList[c];if(this.settings.highlight){this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass)}this.showLabel(b.element,b.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(c=0;this.successList[c];c++){this.showLabel(this.successList[c])}}if(this.settings.unhighlight){for(c=0,d=this.validElements();d[c];c++){this.settings.unhighlight.call(this,d[c],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);if(this.settings.doNotHideMessage==true){}else{this.hideErrors()}this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(c,d){var b=this.errorsFor(c);if(b.length){b.removeClass(this.settings.validClass).addClass(this.settings.errorClass);b.html(d)}else{b=a("<"+this.settings.errorElement+">").attr("for",this.idOrName(c)).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper){b=b.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(b).length){if(this.settings.errorPlacement){this.settings.errorPlacement(b,a(c))}else{b.insertAfter(c)}}}if(!d&&this.settings.success){b.text("");if(typeof this.settings.success==="string"){b.addClass(this.settings.success)}else{this.settings.success(b,c)}}this.toShow=this.toShow.add(b)},errorsFor:function(c){var b=this.idOrName(c);return this.errors().filter(function(){return a(this).attr("for")===b})},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},validationTargetFor:function(b){if(this.checkable(b)){b=this.findByName(b.name).not(this.settings.ignore)[0]}return b},checkable:function(b){return(/radio|checkbox/i).test(b.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length}}return c.length},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true},dependTypes:{"boolean":function(c,b){return c},string:function(c,b){return !!a(c,b.form).length},"function":function(c,b){return c(b)}},optional:function(b){var c=this.elementValue(b);return !a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(c&&this.pendingRequest===0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();this.formSubmitted=false}else{if(!c&&this.pendingRequest===0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},number:{number:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){if(b.constructor===String){this.classRuleSettings[b]=c}else{a.extend(this.classRuleSettings,b)}},classRules:function(c){var d={};var b=a(c).attr("class");if(b){a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this])}})}return d},attributeRules:function(c){var f={};var b=a(c);var d=b[0].getAttribute("type");for(var g in a.validator.methods){var e;if(g==="required"){e=b.get(0).getAttribute(g);if(e===""){e=true}e=!!e}else{e=b.attr(g)}if(/min|max/.test(g)&&(d===null||/number|range|text/.test(d))){e=Number(e)}if(e){f[g]=e}else{if(d===g&&d!=="range"){f[g]=true}}}if(f.maxlength&&/-1|2147483647|524288/.test(f.maxlength)){delete f.maxlength}return f},dataRules:function(c){var f,d,e={},b=a(c);for(f in a.validator.methods){d=b.data("rule-"+f.toLowerCase());if(d!==undefined){e[f]=d}}return e},staticRules:function(c){var d={};var b=a.data(c.form,"validator");if(b.settings.rules){d=a.validator.normalizeRule(b.settings.rules[c.name])||{}}return d},normalizeRules:function(c,b){a.each(c,function(f,e){if(e===false){delete c[f];return}if(e.param||e.depends){var d=true;switch(typeof e.depends){case"string":d=!!a(e.depends,b.form).length;break;case"function":d=e.depends.call(b,b);break}if(d){c[f]=e.param!==undefined?e.param:true}else{delete c[f]}}});a.each(c,function(d,e){c[d]=a.isFunction(e)?e(b):e});a.each(["minlength","maxlength"],function(){if(c[this]){c[this]=Number(c[this])}});a.each(["rangelength","range"],function(){var d;if(c[this]){if(a.isArray(c[this])){c[this]=[Number(c[this][0]),Number(c[this][1])]}else{if(typeof c[this]==="string"){d=c[this].split(/[\s,]+/);c[this]=[Number(d[0]),Number(d[1])]}}}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength}}return c},normalizeRule:function(c){if(typeof c==="string"){var b={};a.each(c.split(/\s/),function(){b[this]=true});c=b}return c},addMethod:function(b,d,c){a.validator.methods[b]=d;a.validator.messages[b]=c!==undefined?c:a.validator.messages[b];if(d.length<3){a.validator.addClassRules(b,a.validator.normalizeRule(b))}},methods:{required:function(c,b,e){if(!this.depend(e,b)){return"dependency-mismatch"}if(b.nodeName.toLowerCase()==="select"){var d=a(b).val();return d&&d.length>0}if(this.checkable(b)){return this.getLength(c,b)>0}return a.trim(c).length>0},email:function(c,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(c)},url:function(c,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c)},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c).toString())},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(c)},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(c)},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c)},creditcard:function(f,c){if(this.optional(c)){return"dependency-mismatch"}if(/[^0-9 \-]+/.test(f)){return false}var g=0,e=0,b=false;f=f.replace(/\D/g,"");for(var h=f.length-1;h>=0;h--){var d=f.charAt(h);e=parseInt(d,10);if(b){if((e*=2)>9){e-=9}}g+=e;b=!b}return(g%10)===0},minlength:function(d,b,e){var c=a.isArray(d)?d.length:this.getLength(a.trim(d),b);return this.optional(b)||c>=e},maxlength:function(d,b,e){var c=a.isArray(d)?d.length:this.getLength(a.trim(d),b);return this.optional(b)||c<=e},rangelength:function(d,b,e){var c=a.isArray(d)?d.length:this.getLength(a.trim(d),b);return this.optional(b)||(c>=e[0]&&c<=e[1])},min:function(c,b,d){return this.optional(b)||c>=d},max:function(c,b,d){return this.optional(b)||c<=d},range:function(c,b,d){return this.optional(b)||(c>=d[0]&&c<=d[1])},equalTo:function(c,b,e){var d=a(e);if(this.settings.onfocusout){d.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(b).valid()})}return c===d.val()},remote:function(f,c,g){if(this.optional(c)){return"dependency-mismatch"}var d=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={}}d.originalMessage=this.settings.messages[c.name].remote;this.settings.messages[c.name].remote=d.message;g=typeof g==="string"&&{url:g}||g;if(d.old===f){return d.valid}d.old=f;var b=this;this.startRequest(c);var e={};e[c.name]=f;a.ajax(a.extend(true,{url:g,mode:"abort",port:"validate"+c.name,dataType:"json",data:e,success:function(i){b.settings.messages[c.name].remote=d.originalMessage;var k=i===true||i==="true";if(k){var h=b.formSubmitted;b.prepareElement(c);b.formSubmitted=h;b.successList.push(c);delete b.invalid[c.name];b.showErrors()}else{var l={};var j=i||b.defaultMessage(c,"remote");l[c.name]=d.message=a.isFunction(j)?j(f):j;b.invalid[c.name]=true;b.showErrors(l)}d.valid=k;b.stopRequest(c,k)}},g));return"pending"}}});a.format=a.validator.format}(jQuery));(function(c){var a={};if(c.ajaxPrefilter){c.ajaxPrefilter(function(f,e,g){var d=f.port;if(f.mode==="abort"){if(a[d]){a[d].abort()}a[d]=g}})}else{var b=c.ajax;c.ajax=function(e){var f=("mode" in e?e:c.ajaxSettings).mode,d=("port" in e?e:c.ajaxSettings).port;if(f==="abort"){if(a[d]){a[d].abort()}a[d]=b.apply(this,arguments);return a[d]}return b.apply(this,arguments)}}}(jQuery));(function(a){a.extend(a.fn,{validateDelegate:function(d,c,b){return this.bind(c,function(e){var f=a(e.target);if(f.is(d)){return b.apply(f,arguments)}})}})}(jQuery));
--------------------------------------------------------------------------------
/css/login-soft.js:
--------------------------------------------------------------------------------
1 | var Login = function () {
2 |
3 | var handleLogin = function() {
4 | $('.login-form').validate({
5 | errorElement: 'label', //default input error message container
6 | errorClass: 'help-inline', // default input error message class
7 | focusInvalid: false, // do not focus the last invalid input
8 | rules: {
9 | username: {
10 | required: true
11 | },
12 | password: {
13 | required: true
14 | },
15 | remember: {
16 | required: false
17 | }
18 | },
19 |
20 | messages: {
21 | username: {
22 | required: "Username is required1."
23 | },
24 | password: {
25 | required: "Password is required2."
26 | }
27 | },
28 |
29 | invalidHandler: function (event, validator) { //display error alert on form submit
30 | $('.alert-error', $('.login-form')).show();
31 | },
32 |
33 | highlight: function (element) { // hightlight error inputs
34 | $(element)
35 | .closest('.control-group').addClass('error'); // set error class to the control group
36 | },
37 |
38 | success: function (label) {
39 | label.closest('.control-group').removeClass('error');
40 | label.remove();
41 | },
42 |
43 | errorPlacement: function (error, element) {
44 | error.addClass('help-small no-left-padding').insertAfter(element.closest('.input-icon'));
45 | },
46 |
47 | submitHandler: function (form) {
48 | form.submit();
49 | }
50 | });
51 |
52 | $('.login-form input').keypress(function (e) {
53 | if (e.which == 13) {
54 | if ($('.login-form').validate().form()) {
55 | $('.login-form').submit();
56 | }
57 | return false;
58 | }
59 | });
60 | }
61 |
62 | var handleForgetPassword = function () {
63 | $('.forget-form').validate({
64 | errorElement: 'label', //default input error message container
65 | errorClass: 'help-inline', // default input error message class
66 | focusInvalid: false, // do not focus the last invalid input
67 | ignore: "",
68 | rules: {
69 | email: {
70 | required: true,
71 | email: true
72 | }
73 | },
74 |
75 | messages: {
76 | email: {
77 | required: "Email is required."
78 | }
79 | },
80 |
81 | invalidHandler: function (event, validator) { //display error alert on form submit
82 |
83 | },
84 |
85 | highlight: function (element) { // hightlight error inputs
86 | $(element)
87 | .closest('.control-group').addClass('error'); // set error class to the control group
88 | },
89 |
90 | success: function (label) {
91 | label.closest('.control-group').removeClass('error');
92 | label.remove();
93 | },
94 |
95 | errorPlacement: function (error, element) {
96 | error.addClass('help-small no-left-padding').insertAfter(element.closest('.input-icon'));
97 | },
98 |
99 | submitHandler: function (form) {
100 | form.submit();
101 | }
102 | });
103 |
104 | $('.forget-form input').keypress(function (e) {
105 | if (e.which == 13) {
106 | if ($('.forget-form').validate().form()) {
107 | $('.forget-form').submit();
108 | }
109 | return false;
110 | }
111 | });
112 |
113 | jQuery('#forget-password').click(function () {
114 | jQuery('.login-form').hide();
115 | jQuery('.forget-form').show();
116 | });
117 |
118 | jQuery('#back-btn').click(function () {
119 | jQuery('.login-form').show();
120 | jQuery('.forget-form').hide();
121 | });
122 |
123 | }
124 |
125 | var handleRegister = function () {
126 |
127 | function format(state) {
128 | if (!state.id) return state.text; // optgroup
129 | return "
" + state.text;
130 | }
131 |
132 |
133 | $("#select2_sample4").select2({
134 | placeholder: ' Select a Country',
135 | allowClear: true,
136 | formatResult: format,
137 | formatSelection: format,
138 | escapeMarkup: function (m) {
139 | return m;
140 | }
141 | });
142 |
143 |
144 | $('#select2_sample4').change(function () {
145 | $('.register-form').validate().element($(this)); //revalidate the chosen dropdown value and show error or success message for the input
146 | });
147 |
148 |
149 |
150 | $('.register-form').validate({
151 | errorElement: 'label', //default input error message container
152 | errorClass: 'help-inline', // default input error message class
153 | focusInvalid: false, // do not focus the last invalid input
154 | ignore: "",
155 | rules: {
156 |
157 | fullname: {
158 | required: true
159 | },
160 | email: {
161 | required: true,
162 | email: true
163 | },
164 | address: {
165 | required: true
166 | },
167 | city: {
168 | required: true
169 | },
170 | country: {
171 | required: true
172 | },
173 |
174 | username: {
175 | required: true
176 | },
177 | password: {
178 | required: true
179 | },
180 | rpassword: {
181 | equalTo: "#register_password"
182 | },
183 |
184 | tnc: {
185 | required: true
186 | }
187 | },
188 |
189 | messages: { // custom messages for radio buttons and checkboxes
190 | tnc: {
191 | required: "Please accept TNC first."
192 | }
193 | },
194 |
195 | invalidHandler: function (event, validator) { //display error alert on form submit
196 |
197 | },
198 |
199 | highlight: function (element) { // hightlight error inputs
200 | $(element)
201 | .closest('.control-group').addClass('error'); // set error class to the control group
202 | },
203 |
204 | success: function (label) {
205 | label.closest('.control-group').removeClass('error');
206 | label.remove();
207 | },
208 |
209 | errorPlacement: function (error, element) {
210 | if (element.attr("name") == "tnc") { // insert checkbox errors after the container
211 | error.addClass('help-small no-left-padding').insertAfter($('#register_tnc_error'));
212 | } else if (element.closest('.input-icon').size() === 1) {
213 | error.addClass('help-small no-left-padding').insertAfter(element.closest('.input-icon'));
214 | } else {
215 | error.addClass('help-small no-left-padding').insertAfter(element);
216 | }
217 | },
218 |
219 | submitHandler: function (form) {
220 | form.submit();
221 | }
222 | });
223 |
224 | $('.register-form input').keypress(function (e) {
225 | if (e.which == 13) {
226 | if ($('.register-form').validate().form()) {
227 | $('.register-form').submit();
228 | }
229 | return false;
230 | }
231 | });
232 |
233 | jQuery('#register-btn').click(function () {
234 | jQuery('.login-form').hide();
235 | jQuery('.register-form').show();
236 | });
237 |
238 | jQuery('#register-back-btn').click(function () {
239 | jQuery('.login-form').show();
240 | jQuery('.register-form').hide();
241 | });
242 | }
243 |
244 | return {
245 | //main function to initiate the module
246 | init: function () {
247 |
248 | handleLogin();
249 | handleForgetPassword();
250 | handleRegister();
251 |
252 | $.backstretch([
253 | "images/bg/1.jpg",
254 | "images/bg/2.jpg",
255 | "images/bg/3.jpg",
256 | "images/bg/4.jpg",
257 | "images/bg/5.jpg"
258 | ], {
259 | fade: 1000,
260 | duration: 8000
261 | });
262 |
263 | }
264 |
265 | };
266 |
267 | }();
--------------------------------------------------------------------------------
/css/select2.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Igor Vaynberg
3 |
4 | Version: 3.4.1 Timestamp: Thu Jun 27 18:02:10 PDT 2013
5 |
6 | This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
7 | General Public License version 2 (the "GPL License"). You may choose either license to govern your
8 | use of this software only upon the condition that you accept all of the terms of either the Apache
9 | License or the GPL License.
10 |
11 | You may obtain a copy of the Apache License and the GPL License at:
12 |
13 | http://www.apache.org/licenses/LICENSE-2.0
14 | http://www.gnu.org/licenses/gpl-2.0.html
15 |
16 | Unless required by applicable law or agreed to in writing, software distributed under the Apache License
17 | or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
18 | either express or implied. See the Apache License and the GPL License for the specific language governing
19 | permissions and limitations under the Apache License and the GPL License.
20 | */
21 | (function(a){a.fn.each2===void 0&&a.fn.extend({each2:function(b){for(var c=a([0]),d=-1,e=this.length;e>++d&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})})(jQuery),function(a,b){"use strict";function m(a,b){for(var c=0,d=b.length;d>c;c+=1)if(o(a,b[c]))return c;return-1}function n(){var b=a(l);b.appendTo("body");var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function o(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function p(b,c){var d,e,f;if(null===b||1>b.length)return[];for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d}function q(a){return a.outerWidth(!1)-a.width()}function r(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function s(c){c.on("mousemove",function(c){var d=i;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function t(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function u(a){var c,b=!1;return function(){return b===!1&&(c=a(),b=!0),c}}function v(a,b){var c=t(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){m(a.target,b.get())>=0&&c(a)})}function w(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus(),a.is(":visible")&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function x(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function y(a){a.preventDefault(),a.stopPropagation()}function z(a){a.preventDefault(),a.stopImmediatePropagation()}function A(b){if(!h){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);h=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),h.attr("class","select2-sizer"),a("body").append(h)}return h.text(b.val()),h.width()}function B(b,c,d){var e,g,f=[];e=b.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=c.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(this))})),b.attr("class",f.join(" "))}function C(a,c,d,e){var f=a.toUpperCase().indexOf(c.toUpperCase()),g=c.length;return 0>f?(d.push(e(a)),b):(d.push(e(a.substring(0,f))),d.push(""),d.push(e(a.substring(f,f+g))),d.push(""),d.push(e(a.substring(f+g,a.length))),b)}function D(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return(a+"").replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function E(c){var d,e=0,f=null,g=c.quietMillis||100,h=c.url,i=this;return function(j){window.clearTimeout(d),d=window.setTimeout(function(){e+=1;var d=e,g=c.data,k=h,l=c.transport||a.fn.select2.ajaxDefaults.transport,m={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},n=a.extend({},a.fn.select2.ajaxDefaults.params,m);g=g?g.call(i,j.term,j.page,j.context):null,k="function"==typeof k?k.call(i,j.term,j.page,j.context):k,f&&f.abort(),c.params&&(a.isFunction(c.params)?a.extend(n,c.params.call(i)):a.extend(n,c.params)),a.extend(n,{url:k,dataType:c.dataType,data:g,success:function(a){if(!(e>d)){var b=c.results(a,j.page);j.callback(b)}}}),f=l.call(i,n)},g)}}function F(c){var e,f,d=c,g=function(a){return""+a.text};a.isArray(d)&&(f=d,d={results:f}),a.isFunction(d)===!1&&(f=d,d=function(){return f});var h=d();return h.text&&(g=h.text,a.isFunction(g)||(e=h.text,g=function(a){return a[e]})),function(c){var h,e=c.term,f={results:[]};return""===e?(c.callback(d()),b):(h=function(b,d){var f,i;if(b=b[0],b.children){f={};for(i in b)b.hasOwnProperty(i)&&(f[i]=b[i]);f.children=[],a(b.children).each2(function(a,b){h(b,f.children)}),(f.children.length||c.matcher(e,g(f),b))&&d.push(f)}else c.matcher(e,g(b),b)&&d.push(b)},a(d().results).each2(function(a,b){h(b,f.results)}),c.callback(f),b)}}function G(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]};a(d?c():c).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g)}}function H(b,c){if(a.isFunction(b))return!0;if(!b)return!1;throw Error(c+" must be a function or a falsy value")}function I(b){return a.isFunction(b)?b():b}function J(b){var c=0;return a.each(b,function(a,b){b.children?c+=J(b.children):c++}),c}function K(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||1>e.tokenSeparators.length)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(o(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:b}function L(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,h,j,k,i={x:0,y:0},c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case c.SHIFT:case c.CTRL:case c.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="";j=a(document),g=function(){var a=1;return function(){return a++}}(),j.on("mousemove",function(a){i.x=a.pageX,i.y=a.pageY}),d=L(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,h,i,f=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+g()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=u(function(){return c.element.closest("body")}),B(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(I(c.containerCss)),this.container.addClass(I(c.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(I(c.dropdownCssClass)),this.dropdown.data("select2",this),this.results=d=this.container.find(f),this.search=e=this.container.find("input.select2-input"),this.resultsPage=0,this.context=null,this.initContainer(),s(this.results),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",f,this.bind(this.highlightUnderEvent)),v(80,this.results),this.dropdown.on("scroll-debounced",f,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),y(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),y(a))}),r(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",f,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown",function(a){a.stopPropagation()}),a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),k=k||n(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus()},destroy:function(){var a=this.opts.element,c=a.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),c!==b&&(c.container.remove(),c.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show())},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:o(a.attr("locked"),"locked")||o(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:b},prepareOpts:function(c){var d,e,f,g,h=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw Error("Option '"+this+"' is not allowed for Select2 when attached to a