1$(function(){ 2 try{ 3 // Tooltips 4 $('.hints').tooltip({trigger: 'hover'}); 5 $('.tips').tooltip({placement: 'left'}); 6 $('.tip-top').tooltip({placement: 'top'}); 7 $('.tip-right').tooltip({placement: 'right'}); 8 $('.tip-bottom').tooltip({placement: 'bottom'}); 9 // Tour tip 10 $('#joyRideTipContent').joyride({'nextButton': false}); 11 } catch (e){ 12 errorMessage(e); 13 } 14 15 // Popovers 16 try{ 17 $('.pop-top').popover({trigger:'hover', placement: 'top'}); 18 $('.pop-right').popover({trigger:'hover', placement: 'right'}); 19 $('.pop-bottom').popover({trigger:'hover', placement: 'bottom'}); 20 $('.pop-left').popover({trigger:'hover', placement: 'left'}); 21 } catch (e){ 22 errorMessage(e); 23 } 24 25 // Modal 26 try{ 27 $('.modal').modal('hide'); 28 } catch (e){ 29 errorMessage(e); 30 } 31 32 // Slider input js 33 try{ 34 jQuery("#Slider1").slider({ from: 5, to: 50, step: 2.5, round: 1, dimension: ' $', skin: "round_plastic" }); 35 jQuery("#Slider2").slider({ from: 5000, to: 150000, heterogeneity: ['50/50000'], step: 1000, dimension: ' $', skin: "round_plastic" }); 36 jQuery("#Slider3").slider({ from: 1, to: 30, heterogeneity: ['50/5', '75/15'], scale: [1, '|', 3, '|', '5', '|', 15, '|', 30], limits: false, step: 1, dimension: '', skin: "round_plastic" }); 37 jQuery("#Slider4").slider({ from: 480, to: 1020, step: 15, dimension: '', scale: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'], limits: false, skin: "round_plastic", calculate: function( value ){ 38 var hours = Math.floor( value / 60 ); 39 var mins = ( value - hours*60 ); 40 return (hours < 10 ? "0"+hours : hours) + ":" + ( mins == 0 ? "00" : mins ); 41 }}); 42 } catch (e){ 43 errorMessage(e); 44 } 45 // Drop down menu 46 $('.breadcrumb li').hover( 47 function () { 48 //show its submenu 49 $('.submenu', this).slideDown(100); 50 51 }, 52 function () { 53 //hide its submenu 54 $('.submenu', this).slideUp(100); 55 } 56 ); 57 58 // Elastice text area 59 try{ 60 $('.elastic').elastic(); 61 } catch (e){ 62 errorMessage(e); 63 } 64 65 // Date picker 66 try{ 67 $('.dpicker').datepicker(); 68 } catch (e){ 69 errorMessage(e); 70 } 71 72 // Color picker 73 try{ 74 $('.cpicker').colorpicker().on('changeColor', function(ev){ 75 $('[class*="cpicker"]').css({backgroundColor: ev.color.toHex()}); 76 }); 77 } catch (e){ 78 79 } 80 81 // Mask input 82 try{ 83 $("#date").mask("99/99/9999"); 84 $("#phone").mask("(999) 999-9999"); 85 $("#phnext").mask("(999) 999-9999? x99999"); 86 $("#tin").mask("99-9999999"); 87 $("#ssn").mask("999-99-9999"); 88 $('#cid').mask("CID: 9999-aaa-9a*"); 89 $('#uilid').mask("999-9-99999"); 90 $('#percentage').mask("99%"); 91 } catch (e){ 92 errorMessage(e); 93 } 94 95 // Data table js call 96 try{ 97 $('.dynamicTable_one').dataTable({ 98 "bPaginate": true, 99 "sPaginationType": "two_button", 100 "bLengthChange": false, 101 "bFilter": false, 102 "bSort": true, 103 "bInfo": true, 104 "bAutoWidth": false 105 }); 106 } catch (e){ 107 errorMessage(e); 108 } 109 try{ 110 $('.dynamicTable_two').dataTable({ 111 "bPaginate": true, 112 "sPaginationType": "full_numbers", 113 "bLengthChange": true, 114 "bFilter": true, 115 "bSort": true, 116 "bInfo": true, 117 "bAutoWidth": true, 118 "aLengthMenu": [[20, 50, 100, 200, -1], [20, 50, 100, 200, "All"]], 119 "iDisplayLength" : 20 120 }); 121 } catch (e){ 122 errorMessage(e); 123 } 124 125 // ColResize js call 126 try{ 127 $(".resizable").colResizable({ 128 liveDrag:true, 129 gripInnerHtml:"<div class='grip'></div>", 130 draggingClass:"dragging" 131 }); 132 } catch (e){ 133 errorMessage(e); 134 } 135 136 // Sortable table js call 137 try{ 138 $('.sortable').tablesorter(); 139 } catch (e){ 140 errorMessage(e); 141 } 142 143 // Uniform selects 144 try{ 145 $(".u_select").uniform(); 146 } catch (e){ 147 errorMessage(e); 148 } 149 150 // Chosen selects 151 try{ 152 $(".c_select").chosen(); 153 } catch (e){ 154 errorMessage(e); 155 } 156 // iButton call 157 try{ 158 $(".chkbox1").iButton({className: "on_off", labelOn: "", labelOff: "", easing: "swing"}); 159 } catch (e){ 160 errorMessage(e); 161 } 162 163 try{ 164 $(".chkbox2").iButton({className: "enabled_disabled", labelOn: "ENABLE", labelOff: "DISABLE", easing: "swing"}); 165 } catch (e){ 166 errorMessage(e); 167 } 168 169 try{ 170 $(".radio1").iButton({className: "on_off", labelOn: "", labelOff: "", easing: "swing"}); 171 } catch (e){ 172 errorMessage(e); 173 } 174 try{ 175 $(".radio2").iButton({className: "yes_no", labelOn: "ON", labelOff: "OFF", easing: "swing"}); 176 } catch (e){ 177 errorMessage(e); 178 } 179 180 // Spinner input call 181 try{ 182 $( ".decimal" ).spinner(); 183 } catch (e){ 184 errorMessage(e); 185 } 186 try{ 187 $( ".spinner_list" ).spinner(); 188 } catch (e){ 189 errorMessage(e); 190 } 191 try{ 192 $( ".currency" ).spinner({currency:'$'}); 193 } catch (e){ 194 errorMessage(e); 195 } 196 // Form validation 197 try{ 198 $('.p_form').validationEngine({promptPosition: 'topLeft'}); 199 } catch (e){ 200 errorMessage(e); 201 } 202 //$('.j_form').validate(); 203 try{ 204 $(".j_form").validate({ 205 rules: { 206 regular: "required", 207 classif: "required", 208 pwd: { 209 required: true, 210 minlength: 5 211 }, 212 confirm_password: { 213 required: true, 214 minlength: 5, 215 equalTo: "#pwd" 216 }, 217 minl: { 218 required: true, 219 minlength: 3 220 }, 221 maxl: { 222 required: true, 223 maxlength: 5 224 }, 225 minno: { 226 required: true, 227 min: 3 228 }, 229 maxno: { 230 required: true, 231 max: 5 232 }, 233 digit:{ 234 required: true, 235 digits: true 236 }, 237 connumber:{ 238 required: true, 239 digits: true 240 }, 241 numstu:{ 242 required: true, 243 digits: true 244 }, 245 range: { 246 required: true, 247 range: [10, 25] 248 }, 249 email: { 250 required: true, 251 email: true 252 }, 253 date: { 254 required: true, 255 date: true 256 }, 257 url: { 258 required: true, 259 url: true 260 }, 261 textarea: { 262 required: true, 263 min: 10 264 } 265 }, 266 messages: { 267 password: { 268 required: "Please provide a password", 269 minlength: "Your password must be at least 5 characters long" 270 }, 271 confirm_password: { 272 required: "Please provide a password", 273 minlength: "Your password must be at least 5 characters long", 274 equalTo: "Please enter the same password as above" 275 }, 276 email: "Please enter a valid email address", 277 agree: "Please accept our policy" 278 } 279 }); 280 } catch (e){ 281 errorMessage(e); 282 } 283 284 // Wizard form 285 try{ 286 $('.wizard').smartWizard(); 287 $('#wizard').smartWizard({transitionEffect:'slide'}); 288 } catch (e){ 289 errorMessage(e); 290 } 291 292 293 // BlockSit Js Call Script Starts 294 295 $(window).load( function() { 296 $('#bolt-containers').BlocksIt({ 297 numOfCol: 5, 298 offsetX: 8, 299 offsetY: 8 300 }); 301 });
302 303 //window resize 304 var currentWidth = 1100; 305 $(window).resize(function() { 306 var winWidth = $(window).width(); 307 var conWidth; 308 if(winWidth < 660) { 309 conWidth = 440; 310 col = 2 311 } else if(winWidth < 880) { 312 conWidth = 660; 313 col = 3 314 } else if(winWidth < 1100) { 315 conWidth = 880; 316 col = 4; 317 } else { 318 conWidth = 1100; 319 col = 5; 320 } 321 322 if(conWidth != currentWidth) { 323 currentWidth = conWidth; 324 $('#bolt-containers').width(conWidth); 325 $('#bolt-containers').BlocksIt({ 326 numOfCol: col, 327 offsetX: 8, 328 offsetY: 8 329 }); 330 } 331 }); 332 333 // BlockSit Js Call Script Ends 334 335 336 337 // Montage Js Call Script Starts 338 339 montageGallery(); 340 341 // Montage Js Call Script Ends 342 343 // Raphael gallery Js Call Script Starts 344 try{ 345 var li = $('.gallery').find('li'); 346 347 li.each(function(i){ 348 var t = $(this), 349 img = t.find('img'), 350 src = img.attr('src'), 351 width = li.width(), 352 height = li.height(); 353 354 img.hide().after($('<div />').attr('id', 'holder'+i).addClass('holder')); 355 356 var r = Raphael('holder'+i, width*2, height*2), 357 rimg = r.image(src, width/2, height/2, width, height); 358 359 rimg.hover(function(event) { 360 this.animate({ 361 scale: 2, 362 rotation : 0 363 }, 1200, 'elastic'); 364 }, function (event) { 365 this.animate({ 366 scale: 1, 367 rotation : 0 368 }, 1200, 'elastic'); 369 }); 370 371 }); 372 li.hover(function(){ 373 li.css({ 'z-index': 0 }); 374 $(this).css({ 'z-index': 2 }); 375 }); 376 } catch (e){ 377 errorMessage(e); 378 } 379 380 381 // Raphael gallery Js Call Script Ends 382 383 //ColorBox Js Call Script Starts 384 385 try{ 386 $(".bolt-colorbox").colorbox({rel:'bolt-colorbox', slideshow:true}); 387 } catch (e){ 388 errorMessage(e); 389 } 390 try{ 391 $(".bolt-colorbox2").colorbox({rel:'bolt-colorbox2', slideshow:true}); 392 } catch (e){ 393 errorMessage(e); 394 } 395 try{ 396 $(".bolt-colorbox3").colorbox({rel:'bolt-colorbox3', slideshow:true}); 397 } catch (e){ 398 errorMessage(e); 399 } 400 try{ 401 $(".bolt-colorbox4").colorbox({rel:'bolt-colorbox4', slideshow:true}); 402 } catch (e){ 403 errorMessage(e); 404 } 405 406 //ColorBox Js Call Script Ends 407 408 // Embedly Js Call Script Starts 409 try{ 410 $(".bolt-embed-video a").embedly({key:'132409jafq09f3', maxWidth:'498', maxHeight:'280' }, function (oembed, dict) { 411 if (oembed == null) 412 return; 413 var output = "<a class='embedly' href='#'></a>"; 414 output += oembed['code']; 415 $(dict["node"]).parent().html(output); 416 }); 417 } catch (e){ 418 errorMessage(e); 419 } 420 421 $('a.embedly').live("click", function (e) { 422 e.preventDefault(); 423 $(this).parents('a').find('.embed').toggle(); 424 }); 425 426 try{ 427 // Embedly Js Call Script Ends 428 429 //Video Flowplayer Js Call Script Starts 430 431 flowplayer("player", "swf/flowplayer-3.2.14.swf", { 432 433 clip:{ 434 autoPlay: false, 435 baseUrl:'http://stream.flowplayer.org' 436 } 437 }).playlist("#myplaylist", {loop:true}); 438 439 // Video Flowplayer Js Call Script Ends 440 }catch(e){ 441 errorMessage(e); 442 } 443 444 /********************************** File upload js start **********************/ 445 try{ 446 var dropbox = $('#dropbox'), 447 message = $('.message', dropbox); 448 449 dropbox.filedrop({ 450 // The name of the $_FILES entry: 451 paramname:'pic', 452 453 maxfiles: 5, 454 maxfilesize: 2, 455 url: 'post_file.php', 456 457 uploadFinished:function(i,file,response){ 458 $.data(file).addClass('done'); 459 // response is the JSON object that post_file.php returns 460 }, 461 462 error: function(err, file) { 463 switch(err) { 464 case 'BrowserNotSupported': 465 showMessage('Your browser does not support HTML5 file uploads!'); 466 break; 467 case 'TooManyFiles': 468 alert('Too many files! Please select 5 at most! (configurable)'); 469 break; 470 case 'FileTooLarge': 471 alert(file.name+' is too large! Please upload files up to 2mb (configurable).'); 472 break; 473 default: 474 break; 475 } 476 }, 477 478 // Called before each upload is started 479 beforeEach: function(file){ 480 if(!file.type.match(/^image\//)){ 481 alert('Only images are allowed!'); 482 483 // Returning false will cause the 484 // file to be rejected 485 return false; 486 } 487 }, 488 489 uploadStarted:function(i, file, len){ 490 createImage(file); 491 }, 492 493 progressUpdated: function(i, file, progress) { 494 $.data(file).find('.progress').width(progress); 495 } 496 497 }); 498 } catch (e){ 499 console.log(e); 500 } 501 502 var template = '<div class="preview">'+ 503 '<span class="imageHolder">'+ 504 '<img />'+ 505 '<span class="uploaded"></span>'+ 506 '</span>'+ 507 '<div class="progressHolder progress_striped">'+ 508 '<div class="progress"></div>'+ 509 '</div>'+ 510 '</div>'; 511 512 513 function createImage(file){ 514 515 var preview = $(template), 516 image = $('img', preview); 517 518 var reader = new FileReader(); 519 520 image.width = 100; 521 image.height = 100; 522 523 reader.onload = function(e){
524 525 // e.target.result holds the DataURL which 526 // can be used as a source of the image: 527 528 image.attr('src',e.target.result); 529 }; 530 531 // Reading the file as a DataURL. When finished, 532 // this will trigger the onload function above: 533 reader.readAsDataURL(file); 534 535 message.hide(); 536 preview.appendTo(dropbox); 537 538 // Associating a preview container 539 // with the file, using jQuery's $.data(): 540 541 $.data(file,preview); 542 } 543 544 function showMessage(msg){ 545 message.html(msg); 546 } 547 548 /********************************** File upload js end **********************/ 549 550 // Little tabs js 551 try{ 552 $('.leftTabs').easytabs(); 553 } catch (e){ 554 errorMessage(e); 555 } 556 try{ 557 $('.rightTabs').easytabs(); 558 } catch (e){ 559 errorMessage(e); 560 } 561 562 563 // Event calendar js 564 565 var date = new Date(); 566 var d = date.getDate(); 567 var m = date.getMonth(); 568 var y = date.getFullYear(); 569 try{ 570 $('#utopia-fullcalendar-2').fullCalendar({ 571 header:{ 572 left:'prev,next today', 573 center:'title', 574 right: 'month,agendaWeek,agendaDay' 575 }, 576 editable:false, 577 height:540, 578 events:[ 579 { 580 title:'All Day Event', 581 start:new Date(y, m, 1) 582 }, 583 { 584 title:'Long Event', 585 start:new Date(y, m, d - 5), 586 end:new Date(y, m, d - 2) 587 }, 588 { 589 id:999, 590 title:'Repeating Event', 591 start:new Date(y, m, d - 3, 16, 0), 592 allDay:false 593 }, 594 { 595 id:999, 596 title:'Repeating Event', 597 start:new Date(y, m, d + 4, 16, 0), 598 allDay:false 599 }, 600 { 601 title:'Meeting', 602 start:new Date(y, m, d, 10, 30), 603 allDay:false 604 }, 605 { 606 title:'Lunch', 607 start:new Date(y, m, d, 12, 0), 608 end:new Date(y, m, d, 14, 0), 609 allDay:false 610 }, 611 { 612 title:'Birthday Party', 613 start:new Date(y, m, d + 1, 19, 0), 614 end:new Date(y, m, d + 1, 22, 30), 615 allDay:false 616 }, 617 { 618 title:'Click for Google', 619 start:new Date(y, m, 28), 620 end:new Date(y, m, 29), 621 url:'http://google.com/' 622 } 623 ] 624 }); 625 } catch (e){ 626 errorMessage(e); 627 } 628 629 // ClEditor call 630 try{ 631 $(".textEditor").cleditor({width:"100%", height:"100%"}); 632 } catch (e){ 633 errorMessage(e); 634 } 635 636 637 // Responsiveness 638 639 responsiveWindow(); 640 641 // Isotope Js Call Script Starts 642 643 try{ 644 var $container = $('#bolt-container'); 645 646 $container.isotope({ 647 itemSelector:'.bolt-img-element', 648 layoutMode : 'fitRows', 649 itemSelector:'.bolt-img-element'
650 }); 651 652 $container.infinitescroll({ 653 navSelector:'#page_nav', // selector for the paged navigation 654 nextSelector:'#page_nav a', // selector for the NEXT link (to page 2) 655 itemSelector:'.bolt-img-element', // selector for all items you'll retrieve 656 loading:{ 657 finishedMsg:'No more pages to load.' 658 } 659 }, 660 function (newElements) { 661 $container.isotope('appended', $(newElements)); 662 $(".bolt-colorbox2").colorbox({rel:'bolt-colorbox2', slideshow:true}); 663 } 664 ); 665 } catch (e){ 666 errorMessage(e); 667 } 668 669 function errorMessage(e){ 670 //console.log(e); 671 } 672 673 // Isotope Js Call Script Ends 674 675 if ($.browser.msie && parseInt($.browser.version, 10) === 8) { 676 ie8(); 677 } 678}); 679 680// Search box toggle 681$('.user_search').on('click', function(){ 682 $('.search').toggle(); 683 $('.search > .search_form').toggleClass('visible'); 684}); 685 686$('.menuDrop').on('click', function(){ 687 if($('.search_form').hasClass('visible')){ 688 $('.search_form').removeClass('visible'); 689 $('.search').css({display: 'none'}); 690 } 691}); 692 693// Show all js 694$(".list_expand a").on('click', function(e){ 695 e.preventDefault(); 696 e.stopPropagation(); 697 var elem = $(this).parents('li'); 698 elem.find('.list .list_expand').html('<img src="img/loading.gif" alt="Loading...">'); 699 setTimeout(function() { 700 elem.find('.list .list_expand').parent().hide(); 701 elem.find('.list_hidden').removeClass('list_hidden'); 702 }, 500); 703}); 704 705// Form drop menu js fix 706$(document).mouseup(function(e) { 707 if(jQuery(e.target).parents().index() < 4 || jQuery(e.target).parents().index() > 5){ 708 $('.search').hide(); 709 } 710}); 711 712 713// Text area counter 714$('.counter').keyup(function(){ 715 var max = $(this).data('limit'), 716 len = $(this).val().length; 717 718 if (len >= max) { 719 $(this).val($(this).val().substring(0, max)); 720 $('.counter_info').text('You have reached the limit'); 721 }else { 722 var char = max - len; 723 $('.counter_info').text( char + ' characters left'); 724 } 725}); 726 727// Check or un-check all checkboxes 728$('.selectAll').on('click', function() { 729 var $this = $(this); 730 //console.log($(this).parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked', $(this).is(':checked'))); 731 $this.parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked', $this.is(':checked')); 732 if($this.is(':checked')){ 733 $this.parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked', $this.is(':checked')).parent().addClass('checked'); 734 }else{ 735 $this.parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked', $this.is(':checked')).parent().removeClass('checked'); 736 } 737}); 738 739/* Widget hover event */ 740// show arrow image in the right side of the title upon hover 741jQuery('.collapsible').hover(function(){ 742 var w = $(this).children('h3').outerWidth(true)+5; 743 jQuery(this).prepend('<span class="collapse-widget" style="left: '+w+'px"> </span>'); 744}, function(){ 745 jQuery(this).children('.collapse-widget').remove() 746}); 747 748 749//show/hide widget content when widget title is clicked 750jQuery('.collapsible').click(function(){ 751 if(jQuery(this).next().is(':visible')) { 752 jQuery(this).next().slideUp('fast'); 753 } else { 754 jQuery(this).next().slideDown('fast'); 755 } 756}); 757 758 759// Responsive js 760jQuery(window).load(function(){ 761 responsiveWindow(); 762 montageGallery(); 763}); 764 765//screen resize 766jQuery(window).resize(function(){ 767 responsiveWindow(); 768 montageGallery(); 769}); 770 771function responsiveWindow(){ 772 if(jQuery(this).width() < 600 || jQuery(this).width() <= 1152) { 773 jQuery('.sidebar_navigation ul li a > span').css({visibility: 'hidden'}); 774 jQuery('.sidebar_navigation ul li').css({height: '55px'}); 775 }else if(jQuery(this).width() > 1152){ 776 jQuery('.sidebar_navigation ul li a > span').css({visibility: 'visible'}); 777 jQuery('.sidebar_navigation ul li').css({height: 'auto'}); 778 } 779} 780 781 782function montageGallery(){ 783 try{ 784 var $container = $('#am-container'), 785 $imgs = $container.find('img').hide(), 786 totalImgs = $imgs.length, 787 cnt = 0; 788 789 $imgs.each(function(i) { 790 var $img = $(this); 791 $('<img/>').load(function() { 792 ++cnt; 793 if( cnt === totalImgs ) { 794 $imgs.show(); 795 $container.montage({ 796 fillLastRow : true, 797 alternateHeight : true, 798 margin : 2, 799 liquid: true, 800 alternateHeightRange : { 801 min : 100, 802 max : 250 803 } 804 }); 805 } 806 }).attr('src',$img.attr('src')); 807 }); 808 } catch (e){ 809 errorMessage(e); 810 } 811} 812 813function ie8(){ 814 $(".header_wrapper .user_nav > li:first-child").css({borderLeft: 'none'}); 815 $(".header_wrapper .user_nav > li:first-child, .header_wrapper .user_nav > li:last-child").css({height: '38px', padding: 0}); 816 $(".header_wrapper .user_nav > li:last-child").css({borderRight:"none"}); 817}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.