File indexing completed on 2024-05-19 06:00:15

0001 // Some general UI pack related JS
0002 // Extend JS String with repeat method
0003 String.prototype.repeat = function(num) {
0004     return new Array(num + 1).join(this);
0005 };
0006 
0007 (function($) {
0008 
0009   // Add segments to a slider
0010   $.fn.addSliderSegments = function (amount) {
0011     return this.each(function () {
0012       var segmentGap = 100 / (amount - 1) + "%"
0013         , segment = "<div class='ui-slider-segment' style='margin-left: " + segmentGap + ";'></div>";
0014       $(this).prepend(segment.repeat(amount - 2));
0015     });
0016   };
0017 
0018   $(function() {
0019   
0020     // Todo list
0021     /*$(".todo li").click(function() {
0022         $(this).toggleClass("todo-done");
0023     });*/
0024 
0025     // Custom Select
0026     /*$("select[name='herolist']").selectpicker({style: 'btn-primary', menuStyle: 'dropdown-inverse'});*/
0027 
0028     // Tooltips
0029     /*$("[data-toggle=tooltip]").tooltip("show");*/
0030 
0031     // Tags Input
0032     /*$(".tagsinput").tagsInput();*/
0033 
0034     // jQuery UI Sliders
0035     /*var $slider = $("#slider");
0036     if ($slider.length) {
0037       $slider.slider({
0038         min: 1,
0039         max: 5,
0040         value: 2,
0041         orientation: "horizontal",
0042         range: "min"
0043       }).addSliderSegments($slider.slider("option").max);
0044     }*/
0045 
0046     // Placeholders for input/textarea
0047     /*$("input, textarea").placeholder();*/
0048 
0049     // Make pagination demo work
0050     /*$(".pagination a").on('click', function() {
0051       $(this).parent().siblings("li").removeClass("active").end().addClass("active");
0052     });*/
0053 
0054     /*$(".btn-group a").on('click', function() {
0055       $(this).siblings().removeClass("active").end().addClass("active");
0056     });*/
0057 
0058     // Disable link clicks to prevent page scrolling
0059     /*$('a[href="#fakelink"]').on('click', function (e) {
0060       e.preventDefault();
0061     });*/
0062 
0063     // Switch
0064     /*$("[data-toggle='switch']").wrap('<div class="switch" />').parent().bootstrapSwitch();*/
0065     
0066   });
0067   
0068 })(jQuery);