/res/themes/zeus/js/custom.js

https://bitbucket.org/igormatkovic/project-manager · JavaScript · 934 lines · 551 code · 288 blank · 95 comment · 20 complexity · 975c7c837a5cedf07923ca7e3f709d80 MD5 · raw file

  1. var currentRequest;
  2. function flash(bool) {
  3. if(bool) {
  4. $("#flash").show();
  5. } else {
  6. $("#flash").fadeOut("slow");
  7. $(".tipsy").fadeOut();
  8. }
  9. }
  10. function fb(bool) {
  11. $.facebox.close();
  12. }
  13. function fb_close(time) {
  14. setInterval(function(){$.facebox.close();},time+'000');
  15. }
  16. $(function() {
  17. //CUSTOM STUFF
  18. //FACEBOX
  19. $('.ajax_box').facebox();
  20. $('.ajax_close').live('click', function () {
  21. $.facebox.close();
  22. });
  23. /* Form related plugins
  24. ================================================== */
  25. //===== Usual validation engine=====//
  26. $("#usualValidate").validate({
  27. rules: {
  28. firstname: "required",
  29. minChars: {
  30. required: true,
  31. minlength: 3
  32. },
  33. maxChars: {
  34. required: true,
  35. maxlength: 6
  36. },
  37. mini: {
  38. required: true,
  39. min: 3
  40. },
  41. maxi: {
  42. required: true,
  43. max: 6
  44. },
  45. range: {
  46. required: true,
  47. range: [6, 16]
  48. },
  49. emailField: {
  50. required: true,
  51. email: true
  52. },
  53. urlField: {
  54. required: true,
  55. url: true
  56. },
  57. dateField: {
  58. required: true,
  59. date: true
  60. },
  61. digitsOnly: {
  62. required: true,
  63. digits: true
  64. },
  65. enterPass: {
  66. required: true,
  67. minlength: 5
  68. },
  69. repeatPass: {
  70. required: true,
  71. minlength: 5,
  72. equalTo: "#enterPass"
  73. },
  74. customMessage: "required",
  75. topic: {
  76. required: "#newsletter:checked",
  77. minlength: 2
  78. },
  79. agree: "required"
  80. },
  81. messages: {
  82. customMessage: {
  83. required: "Bazinga! This message is editable",
  84. },
  85. agree: "Please accept our policy"
  86. }
  87. });
  88. //===== Input limiter =====//
  89. $('.lim').inputlimiter({
  90. limit: 100
  91. //boxClass: 'limBox',
  92. //boxAttach: false
  93. });
  94. //===== Multiple select with dropdown =====//
  95. $(".chzn-select").chosen();
  96. //===== Placeholder =====//
  97. $('input[placeholder], textarea[placeholder]').placeholder();
  98. //===== ShowCode plugin for <pre> tag =====//
  99. $('.showCode').sourcerer('js html css php'); // Display all languages
  100. $('.showCodeJS').sourcerer('js'); // Display JS only
  101. $('.showCodeHTML').sourcerer('html'); // Display HTML only
  102. $('.showCodePHP').sourcerer('php'); // Display PHP only
  103. $('.showCodeCSS').sourcerer('css'); // Display CSS only
  104. //===== Autocomplete =====//
  105. var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ];
  106. $( "#ac" ).autocomplete({
  107. source: availableTags
  108. });
  109. //===== Masked input =====//
  110. $.mask.definitions['~'] = "[+-]";
  111. $(".maskDate").mask("99/99/9999",{completed:function(){alert("Callback when completed");}});
  112. $(".maskPhone").mask("(999) 999-9999");
  113. $(".maskPhoneExt").mask("(999) 999-9999? x99999");
  114. $(".maskIntPhone").mask("+33 999 999 999");
  115. $(".maskTin").mask("99-9999999");
  116. $(".maskSsn").mask("999-99-9999");
  117. $(".maskProd").mask("a*-999-a999", { placeholder: " " });
  118. $(".maskEye").mask("~9.99 ~9.99 999");
  119. $(".maskPo").mask("PO: aaa-999-***");
  120. $(".maskPct").mask("99%");
  121. //===== Dual select boxes =====//
  122. $.configureBoxes();
  123. //===== Wizards =====//
  124. $("#wizard1").formwizard({
  125. formPluginEnabled: true,
  126. validationEnabled: false,
  127. focusFirstInput : false,
  128. disableUIStyles : true,
  129. formOptions :{
  130. success: function(data){$("#status1").fadeTo(500,1,function(){ $(this).html("<span>Form was submitted!</span>").fadeTo(5000, 0); })},
  131. beforeSubmit: function(data){$("#w1").html("<span>Form was submitted with ajax. Data sent to the server: " + $.param(data) + "</span>");},
  132. resetForm: true
  133. }
  134. });
  135. $("#wizard2").formwizard({
  136. formPluginEnabled: true,
  137. validationEnabled: true,
  138. focusFirstInput : false,
  139. disableUIStyles : true,
  140. formOptions :{
  141. success: function(data){$("#status2").fadeTo(500,1,function(){ $(this).html("<span>Form was submitted!</span>").fadeTo(5000, 0); })},
  142. beforeSubmit: function(data){$("#w2").html("<span>Form was submitted with ajax. Data sent to the server: " + $.param(data) + "</span>");},
  143. dataType: 'json',
  144. resetForm: true
  145. },
  146. validationOptions : {
  147. rules: {
  148. bazinga: "required",
  149. email: { required: true, email: true }
  150. },
  151. messages: {
  152. bazinga: "Bazinga. This note is editable",
  153. email: { required: "Please specify your email", email: "Correct format is name@domain.com" }
  154. }
  155. }
  156. });
  157. $("#wizard3").formwizard({
  158. formPluginEnabled: false,
  159. validationEnabled: false,
  160. focusFirstInput : false,
  161. disableUIStyles : true
  162. });
  163. //===== Validation engine =====//
  164. $("#validate").validationEngine();
  165. //===== WYSIWYG editor =====//
  166. $("#editor").cleditor({
  167. width:"100%",
  168. height:"100%",
  169. bodyStyle: "margin: 10px; font: 12px Arial,Verdana; cursor:text"
  170. });
  171. //===== File uploader =====//
  172. $("#uploader").pluploadQueue({
  173. runtimes : 'html5,html4',
  174. url : 'php/upload.php',
  175. max_file_size : '1mb',
  176. unique_names : true,
  177. filters : [
  178. {title : "Image files", extensions : "jpg,gif,png"}
  179. //{title : "Zip files", extensions : "zip"}
  180. ]
  181. });
  182. //===== Tags =====//
  183. $('.tags').tagsInput({width:'100%'});
  184. //===== Autogrowing textarea =====//
  185. $(".autoGrow").autoGrow();
  186. /* General stuff
  187. ================================================== */
  188. //===== Left navigation styling =====//
  189. $('li.this').prev('li').css('border-bottom-color', '#2c3237');
  190. $('li.this').next('li').css('border-top-color', '#2c3237');
  191. /*$('.smalldd ul li').mouseover(
  192. function() { $(this).prev('li').css('border-bottom-color', '#3d434a') }
  193. );
  194. $('.smalldd ul li').mouseout(
  195. function() { $(this).prev('li').css('border-bottom-color', '#1c252a') }
  196. );*/
  197. //$('.smalldd ul li').next('li').css('border-top-color', '#2c3237');
  198. /*$('ul.nav li a').mouseover(
  199. function(){
  200. $(this).parent().prev('li').children("> a").addClass('bottomBorder');
  201. }
  202. );
  203. $('ul.nav li a').mouseout(
  204. function(){
  205. $(this).parent().prev('li').children("a").removeClass('bottomBorder');
  206. }
  207. );*/
  208. //===== User nav dropdown =====//
  209. $('.dd').click(function () {
  210. $('.userDropdown').slideToggle(200);
  211. });
  212. $(document).bind('click', function(e) {
  213. var $clicked = $(e.target);
  214. if (! $clicked.parents().hasClass("dd"))
  215. $(".userDropdown").slideUp(200);
  216. });
  217. //===== Statistics row dropdowns =====//
  218. $('.ticketsStats > h2 a').click(function () {
  219. $('#s1').slideToggle(150);
  220. });
  221. $(document).bind('click', function(e) {
  222. var $clicked = $(e.target);
  223. if (! $clicked.parents().hasClass("ticketsStats"))
  224. $("#s1").slideUp(150);
  225. });
  226. $('.visitsStats > h2 a').click(function () {
  227. $('#s2').slideToggle(150);
  228. });
  229. $(document).bind('click', function(e) {
  230. var $clicked = $(e.target);
  231. if (! $clicked.parents().hasClass("visitsStats"))
  232. $("#s2").slideUp(150);
  233. });
  234. $('.usersStats > h2 a').click(function () {
  235. $('#s3').slideToggle(150);
  236. });
  237. $(document).bind('click', function(e) {
  238. var $clicked = $(e.target);
  239. if (! $clicked.parents().hasClass("usersStats"))
  240. $("#s3").slideUp(150);
  241. });
  242. $('.ordersStats > h2 a').click(function () {
  243. $('#s4').slideToggle(150);
  244. });
  245. $(document).bind('click', function(e) {
  246. var $clicked = $(e.target);
  247. if (! $clicked.parents().hasClass("ordersStats"))
  248. $("#s4").slideUp(150);
  249. });
  250. //===== Collapsible elements management =====//
  251. $('.exp').collapsible({
  252. defaultOpen: 'current',
  253. cookieName: 'navAct',
  254. cssOpen: 'active',
  255. cssClose: 'inactive',
  256. speed: 200
  257. });
  258. $('.opened').collapsible({
  259. defaultOpen: 'opened,toggleOpened',
  260. cssOpen: 'inactive',
  261. cssClose: 'normal',
  262. speed: 200
  263. });
  264. $('.closed').collapsible({
  265. defaultOpen: '',
  266. cssOpen: 'inactive',
  267. cssClose: 'normal',
  268. speed: 200
  269. });
  270. $('.goTo').collapsible({
  271. defaultOpen: 'openedDrop',
  272. cookieName: 'smallNavAct',
  273. cssOpen: 'active',
  274. cssClose: 'inactive',
  275. speed: 100
  276. });
  277. /*$(document).bind('click', function(e) {
  278. var $clicked = $(e.target);
  279. if (! $clicked.parents().hasClass("smalldd"))
  280. $(".smallDropdown").slideUp(200);
  281. });*/
  282. //===== Middle navigation dropdowns =====//
  283. $('.mUser').click(function () {
  284. $('.mSub1').slideToggle(100);
  285. });
  286. $(document).bind('click', function(e) {
  287. var $clicked = $(e.target);
  288. if (! $clicked.parents().hasClass("mUser"))
  289. $(".mSub1").slideUp(100);
  290. });
  291. $('.mMessages').click(function () {
  292. $('.mSub2').slideToggle(100);
  293. });
  294. $(document).bind('click', function(e) {
  295. var $clicked = $(e.target);
  296. if (! $clicked.parents().hasClass("mMessages"))
  297. $(".mSub2").slideUp(100);
  298. });
  299. $('.mFiles').click(function () {
  300. $('.mSub3').slideToggle(100);
  301. });
  302. $(document).bind('click', function(e) {
  303. var $clicked = $(e.target);
  304. if (! $clicked.parents().hasClass("mFiles"))
  305. $(".mSub3").slideUp(100);
  306. });
  307. $('.mOrders').click(function () {
  308. $('.mSub4').slideToggle(100);
  309. });
  310. $(document).bind('click', function(e) {
  311. var $clicked = $(e.target);
  312. if (! $clicked.parents().hasClass("mOrders"))
  313. $(".mSub4").slideUp(100);
  314. });
  315. //===== User nav dropdown =====//
  316. $('.sidedd').click(function () {
  317. $('.sideDropdown').slideToggle(200);
  318. });
  319. $(document).bind('click', function(e) {
  320. var $clicked = $(e.target);
  321. if (! $clicked.parents().hasClass("sidedd"))
  322. $(".sideDropdown").slideUp(200);
  323. });
  324. //$('.smalldd').click(function () {
  325. // $('.smallDropdown').slideDown(200);
  326. //});
  327. /* Tables
  328. ================================================== */
  329. //===== Check all checbboxes =====//
  330. $(".titleIcon input:checkbox").click(function() {
  331. var checkedStatus = this.checked;
  332. $("#checkAll tbody tr td:first-child input:checkbox").each(function() {
  333. this.checked = checkedStatus;
  334. if (checkedStatus == this.checked) {
  335. $(this).closest('.checker > span').removeClass('checked');
  336. }
  337. if (this.checked) {
  338. $(this).closest('.checker > span').addClass('checked');
  339. }
  340. });
  341. });
  342. $('#checkAll tbody tr td:first-child').next('td').css('border-left-color', '#CBCBCB');
  343. //===== Resizable columns =====//
  344. $("#res, #res1").colResizable({
  345. liveDrag:true,
  346. draggingClass:"dragging"
  347. });
  348. //===== Sortable columns =====//
  349. $("table").tablesorter();
  350. //===== Dynamic data table =====//
  351. oTable = $('.dTable').dataTable({
  352. "bJQueryUI": true,
  353. "bAutoWidth": false,
  354. "sPaginationType": "full_numbers",
  355. "sDom": '<"H"l>t<"F"fp>'
  356. });
  357. /* # Pickers
  358. ================================================== */
  359. //===== Color picker =====//
  360. $('#cPicker').ColorPicker({
  361. color: '#e62e90',
  362. onShow: function (colpkr) {
  363. $(colpkr).fadeIn(500);
  364. return false;
  365. },
  366. onHide: function (colpkr) {
  367. $(colpkr).fadeOut(500);
  368. return false;
  369. },
  370. onChange: function (hsb, hex, rgb) {
  371. $('#cPicker div').css('backgroundColor', '#' + hex);
  372. }
  373. });
  374. $('#flatPicker').ColorPicker({flat: true});
  375. //===== Time picker =====//
  376. $('.timepicker').timeEntry({
  377. show24Hours: true, // 24 hours format
  378. showSeconds: true, // Show seconds?
  379. spinnerImage: 'images/forms/spinnerUpDown.png', // Arrows image
  380. spinnerSize: [19, 30, 0], // Image size
  381. spinnerIncDecOnly: true // Only up and down arrows
  382. });
  383. //===== Datepickers =====//
  384. $( ".datepicker" ).datepicker({
  385. autoSize: true,
  386. appendText: '(dd-mm-yyyy)',
  387. dateFormat: 'dd-mm-yy'
  388. });
  389. $( ".datepickerInline" ).datepicker({
  390. defaultDate: +7,
  391. autoSize: true,
  392. appendText: '(yyyy-mm-dd)',
  393. dateFormat: 'yy-mm-dd',
  394. numberOfMonths: 1
  395. });
  396. //===== Progress bars =====//
  397. // default mode
  398. $('#progress1').anim_progressbar();
  399. // from second #5 till 15
  400. var iNow = new Date().setTime(new Date().getTime() + 5 * 1000); // now plus 5 secs
  401. var iEnd = new Date().setTime(new Date().getTime() + 15 * 1000); // now plus 15 secs
  402. $('#progress2').anim_progressbar({start: iNow, finish: iEnd, interval: 1});
  403. // jQuery UI progress bar
  404. $( "#progress" ).progressbar({
  405. value: 80
  406. });
  407. //===== Animated progress bars =====//
  408. var percent = $('.progressG').attr('title');
  409. $('.progressG').animate({width: percent},1000);
  410. var percent = $('.progressO').attr('title');
  411. $('.progressO').animate({width: percent},1000);
  412. var percent = $('.progressB').attr('title');
  413. $('.progressB').animate({width: percent},1000);
  414. var percent = $('.progressR').attr('title');
  415. $('.progressR').animate({width: percent},1000);
  416. var percent = $('#bar1').attr('title');
  417. $('#bar1').animate({width: percent},1000);
  418. var percent = $('#bar2').attr('title');
  419. $('#bar2').animate({width: percent},1000);
  420. var percent = $('#bar3').attr('title');
  421. $('#bar3').animate({width: percent},1000);
  422. var percent = $('#bar4').attr('title');
  423. $('#bar4').animate({width: percent},1000);
  424. var percent = $('#bar5').attr('title');
  425. $('#bar5').animate({width: percent},1000);
  426. var percent = $('#bar6').attr('title');
  427. $('#bar6').animate({width: percent},1000);
  428. var percent = $('#bar7').attr('title');
  429. $('#bar7').animate({width: percent},1000);
  430. var percent = $('#bar8').attr('title');
  431. $('#bar8').animate({width: percent},1000);
  432. var percent = $('#bar9').attr('title');
  433. $('#bar9').animate({width: percent},1000);
  434. /* Other plugins
  435. ================================================== */
  436. //===== File manager =====//
  437. $('#fm').elfinder({
  438. url : 'php/connector.php',
  439. });
  440. //===== Calendar =====//
  441. var date = new Date();
  442. var d = date.getDate();
  443. var m = date.getMonth();
  444. var y = date.getFullYear();
  445. $('.calendar').fullCalendar({
  446. header: {
  447. left: 'prev,next',
  448. center: 'title',
  449. right: 'month,basicWeek,basicDay'
  450. },
  451. editable: true,
  452. events: [
  453. {
  454. title: 'All day event',
  455. start: new Date(y, m, 1)
  456. },
  457. {
  458. title: 'Long event',
  459. start: new Date(y, m, 5),
  460. end: new Date(y, m, 8)
  461. },
  462. {
  463. id: 999,
  464. title: 'Repeating event',
  465. start: new Date(y, m, 2, 16, 0),
  466. end: new Date(y, m, 3, 18, 0),
  467. allDay: false
  468. },
  469. {
  470. id: 999,
  471. title: 'Repeating event',
  472. start: new Date(y, m, 9, 16, 0),
  473. end: new Date(y, m, 10, 18, 0),
  474. allDay: false
  475. },
  476. {
  477. title: 'Background color could be changed',
  478. start: new Date(y, m, 30, 10, 30),
  479. end: new Date(y, m, d+1, 14, 0),
  480. allDay: false,
  481. color: '#5c90b5'
  482. },
  483. {
  484. title: 'Lunch',
  485. start: new Date(y, m, 14, 12, 0),
  486. end: new Date(y, m, 15, 14, 0),
  487. allDay: false
  488. },
  489. {
  490. title: 'Birthday PARTY',
  491. start: new Date(y, m, 18),
  492. end: new Date(y, m, 20),
  493. allDay: false
  494. }
  495. ]
  496. });
  497. /* UI stuff
  498. ================================================== */
  499. //===== Sparklines =====//
  500. $('.negBar').sparkline('html', {type: 'bar', barColor: '#db6464'} );
  501. $('.posBar').sparkline('html', {type: 'bar', barColor: '#6daa24'} );
  502. $('.zeroBar').sparkline('html', {type: 'bar', barColor: '#4e8fc6'} );
  503. //===== Tooltips =====//
  504. $('.tipN').tipsy({gravity: 'n',fade: true, live: true});
  505. $('.tipS').tipsy({gravity: 's',fade: true, live: true});
  506. $('.tipW').tipsy({gravity: 'w',fade: true, live: true});
  507. $('.tipE').tipsy({gravity: 'e',fade: true, live: true});
  508. $('.tooltip').tipsy({gravity: 'n',fade: true, live: true});
  509. //===== Accordion =====//
  510. $('div.menu_body:eq(0)').show();
  511. $('.acc .title:eq(0)').show().css({color:"#2B6893"});
  512. $(".acc .title").click(function() {
  513. $(this).css({color:"#2B6893"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
  514. $(this).siblings().css({color:"#404040"});
  515. });
  516. //===== Tabs =====//
  517. $.fn.contentTabs = function(){
  518. $(this).find(".tab_content").hide(); //Hide all content
  519. $(this).find("ul.tabs li:first").addClass("activeTab").show(); //Activate first tab
  520. $(this).find(".tab_content:first").show(); //Show first tab content
  521. $("ul.tabs li").click(function() {
  522. $(this).parent().parent().find("ul.tabs li").removeClass("activeTab"); //Remove any "active" class
  523. $(this).addClass("activeTab"); //Add "active" class to selected tab
  524. $(this).parent().parent().find(".tab_content").hide(); //Hide all tab content
  525. var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
  526. $(activeTab).show(); //Fade in the active content
  527. return false;
  528. });
  529. };
  530. $("div[class^='widget']").contentTabs(); //Run function on any div with class name of "Content Tabs"
  531. //===== Notification boxes =====//
  532. $(".hideit").click(function() {
  533. $(this).fadeTo(200, 0.00, function(){ //fade
  534. $(this).slideUp(300, function() { //slide up
  535. $(this).remove(); //then remove from the DOM
  536. });
  537. });
  538. });
  539. //===== Lightbox =====//
  540. $("a[rel^='lightbox']").prettyPhoto();
  541. //===== Image gallery control buttons =====//
  542. $(".gallery ul li").hover(
  543. function() { $(this).children(".actions").show("fade", 200); },
  544. function() { $(this).children(".actions").hide("fade", 200); }
  545. );
  546. //===== Spinner options =====//
  547. var itemList = [
  548. {url: "http://ejohn.org", title: "John Resig"},
  549. {url: "http://bassistance.de/", title: "J&ouml;rn Zaefferer"},
  550. {url: "http://snook.ca/jonathan/", title: "Jonathan Snook"},
  551. {url: "http://rdworth.org/", title: "Richard Worth"},
  552. {url: "http://www.paulbakaus.com/", title: "Paul Bakaus"},
  553. {url: "http://www.yehudakatz.com/", title: "Yehuda Katz"},
  554. {url: "http://www.azarask.in/", title: "Aza Raskin"},
  555. {url: "http://www.karlswedberg.com/", title: "Karl Swedberg"},
  556. {url: "http://scottjehl.com/", title: "Scott Jehl"},
  557. {url: "http://jdsharp.us/", title: "Jonathan Sharp"},
  558. {url: "http://www.kevinhoyt.org/", title: "Kevin Hoyt"},
  559. {url: "http://www.codylindley.com/", title: "Cody Lindley"},
  560. {url: "http://malsup.com/jquery/", title: "Mike Alsup"}
  561. ];
  562. var opts = {
  563. 'sDec': {decimals:2},
  564. 'sStep': {stepping: 0.25},
  565. 'sCur': {currency: '$'},
  566. 'sInline': {},
  567. 'sLink': {
  568. //
  569. // Two methods of adding external items to the spinner
  570. //
  571. // method 1: on initalisation call the add method directly and format html manually
  572. init: function(e, ui) {
  573. for (var i=0; i<itemList.length; i++) {
  574. ui.add('<a href="'+ itemList[i].url +'" target="_blank">'+ itemList[i].title +'</a>');
  575. }
  576. },
  577. // method 2: use the format and items options in combination
  578. format: '<a href="%(url)" target="_blank">%(title)</a>',
  579. items: itemList
  580. }
  581. };
  582. for (var n in opts)
  583. $("#"+n).spinner(opts[n]);
  584. $("button").click(function(e){
  585. var ns = $(this).attr('id').match(/(s\d)\-(\w+)$/);
  586. if (ns != null)
  587. $('#'+ns[1]).spinner( (ns[2] == 'create') ? opts[ns[1]] : ns[2]);
  588. });
  589. //===== UI dialog =====//
  590. $( "#dialog-message" ).dialog({
  591. autoOpen: false,
  592. modal: true
  593. });
  594. $( "#opener" ).click(function() {
  595. $( "#dialog-message" ).dialog( "open" );
  596. return false;
  597. });
  598. //===== Breadcrumbs =====//
  599. $('#breadcrumbs').xBreadcrumbs();
  600. //===== jQuery UI sliders =====//
  601. $( ".uiSlider" ).slider(); /* Usual slider */
  602. $( ".uiSliderInc" ).slider({ /* Increments slider */
  603. value:100,
  604. min: 0,
  605. max: 500,
  606. step: 50,
  607. slide: function( event, ui ) {
  608. $( "#amount" ).val( "$" + ui.value );
  609. }
  610. });
  611. $( "#amount" ).val( "$" + $( ".uiSliderInc" ).slider( "value" ) );
  612. $( ".uiRangeSlider" ).slider({ /* Range slider */
  613. range: true,
  614. min: 0,
  615. max: 500,
  616. values: [ 75, 300 ],
  617. slide: function( event, ui ) {
  618. $( "#rangeAmount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
  619. }
  620. });
  621. $( "#rangeAmount" ).val( "$" + $( ".uiRangeSlider" ).slider( "values", 0 ) +" - $" + $( ".uiRangeSlider" ).slider( "values", 1 ));
  622. $( ".uiMinRange" ).slider({ /* Slider with minimum */
  623. range: "min",
  624. value: 37,
  625. min: 1,
  626. max: 700,
  627. slide: function( event, ui ) {
  628. $( "#minRangeAmount" ).val( "$" + ui.value );
  629. }
  630. });
  631. $( "#minRangeAmount" ).val( "$" + $( ".uiMinRange" ).slider( "value" ) );
  632. $( ".uiMaxRange" ).slider({ /* Slider with maximum */
  633. range: "max",
  634. min: 1,
  635. max: 100,
  636. value: 20,
  637. slide: function( event, ui ) {
  638. $( "#maxRangeAmount" ).val( ui.value );
  639. }
  640. });
  641. $( "#maxRangeAmount" ).val( $( ".uiMaxRange" ).slider( "value" ) );
  642. //===== Form elements styling =====//
  643. $("select, input:checkbox, input:radio, input:file").uniform();
  644. });