app.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. /*! AdminLTE app.js
  2. * ================
  3. * Main JS application file for AdminLTE v2. This file
  4. * should be included in all pages. It controls some layout
  5. * options and implements exclusive AdminLTE plugins.
  6. *
  7. * @Author Almsaeed Studio
  8. * @Support <http://www.almsaeedstudio.com>
  9. * @Email <support@almsaeedstudio.com>
  10. * @version 2.1.0
  11. * @license MIT <http://opensource.org/licenses/MIT>
  12. */
  13. 'use strict';
  14. //Make sure jQuery has been loaded before app.js
  15. if (typeof jQuery === "undefined") {
  16. throw new Error("AdminLTE requires jQuery");
  17. }
  18. /* AdminLTE
  19. *
  20. * @type Object
  21. * @description $.AdminLTE is the main object for the template's app.
  22. * It's used for implementing functions and options related
  23. * to the template. Keeping everything wrapped in an object
  24. * prevents conflict with other plugins and is a better
  25. * way to organize our code.
  26. */
  27. $.AdminLTE = {};
  28. /* --------------------
  29. * - AdminLTE Options -
  30. * --------------------
  31. * Modify these options to suit your implementation
  32. */
  33. $.AdminLTE.options = {
  34. //Add slimscroll to navbar menus
  35. //This requires you to load the slimscroll plugin
  36. //in every page before app.js
  37. navbarMenuSlimscroll: true,
  38. navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar
  39. navbarMenuHeight: "200px", //The height of the inner menu
  40. //Sidebar push menu toggle button selector
  41. sidebarToggleSelector: "[data-toggle='offcanvas']",
  42. //Activate sidebar push menu
  43. sidebarPushMenu: true,
  44. //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin)
  45. sidebarSlimScroll: true,
  46. //Enable sidebar expand on hover effect for sidebar mini
  47. //This option is forced to true if both the fixed layout and sidebar mini
  48. //are used together
  49. sidebarExpandOnHover: false,
  50. //BoxRefresh Plugin
  51. enableBoxRefresh: true,
  52. //Bootstrap.js tooltip
  53. enableBSToppltip: true,
  54. BSTooltipSelector: "[data-toggle='tooltip']",
  55. //Enable Fast Click. Fastclick.js creates a more
  56. //native touch experience with touch devices. If you
  57. //choose to enable the plugin, make sure you load the script
  58. //before AdminLTE's app.js
  59. enableFastclick: true,
  60. //Control Sidebar Options
  61. enableControlSidebar: true,
  62. controlSidebarOptions: {
  63. //Which button should trigger the open/close event
  64. toggleBtnSelector: "[data-toggle='control-sidebar']",
  65. //The sidebar selector
  66. selector: ".control-sidebar",
  67. //Enable slide over content
  68. slide: true
  69. },
  70. //Box Widget Plugin. Enable this plugin
  71. //to allow boxes to be collapsed and/or removed
  72. enableBoxWidget: true,
  73. //Box Widget plugin options
  74. boxWidgetOptions: {
  75. boxWidgetIcons: {
  76. //Collapse icon
  77. collapse: 'fa-minus',
  78. //Open icon
  79. open: 'fa-plus',
  80. //Remove icon
  81. remove: 'fa-times'
  82. },
  83. boxWidgetSelectors: {
  84. //Remove button selector
  85. remove: '[data-widget="remove"]',
  86. //Collapse button selector
  87. collapse: '[data-widget="collapse"]'
  88. }
  89. },
  90. //Direct Chat plugin options
  91. directChat: {
  92. //Enable direct chat by default
  93. enable: true,
  94. //The button to open and close the chat contacts pane
  95. contactToggleSelector: '[data-widget="chat-pane-toggle"]'
  96. },
  97. //Define the set of colors to use globally around the website
  98. colors: {
  99. lightBlue: "#3c8dbc",
  100. red: "#f56954",
  101. green: "#00a65a",
  102. aqua: "#00c0ef",
  103. yellow: "#f39c12",
  104. blue: "#0073b7",
  105. navy: "#001F3F",
  106. teal: "#39CCCC",
  107. olive: "#3D9970",
  108. lime: "#01FF70",
  109. orange: "#FF851B",
  110. fuchsia: "#F012BE",
  111. purple: "#8E24AA",
  112. maroon: "#D81B60",
  113. black: "#222222",
  114. gray: "#d2d6de"
  115. },
  116. //The standard screen sizes that bootstrap uses.
  117. //If you change these in the variables.less file, change
  118. //them here too.
  119. screenSizes: {
  120. xs: 480,
  121. sm: 768,
  122. md: 992,
  123. lg: 1200
  124. }
  125. };
  126. /* ------------------
  127. * - Implementation -
  128. * ------------------
  129. * The next block of code implements AdminLTE's
  130. * functions and plugins as specified by the
  131. * options above.
  132. */
  133. $(function () {
  134. //Extend options if external options exist
  135. if (typeof AdminLTEOptions !== "undefined") {
  136. $.AdminLTE.options = $.extend({},
  137. $.AdminLTE.options,
  138. AdminLTEOptions);
  139. }
  140. //Easy access to options
  141. var o = $.AdminLTE.options;
  142. //Set up the object
  143. _init();
  144. //Activate the layout maker
  145. $.AdminLTE.layout.activate();
  146. //Enable sidebar tree view controls
  147. $.AdminLTE.tree('.sidebar');
  148. //Enable control sidebar
  149. if (o.enableControlSidebar) {
  150. $.AdminLTE.controlSidebar.activate();
  151. }
  152. //Add slimscroll to navbar dropdown
  153. if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') {
  154. $(".navbar .menu").slimscroll({
  155. height: o.navbarMenuHeight,
  156. alwaysVisible: false,
  157. size: o.navbarMenuSlimscrollWidth
  158. }).css("width", "100%");
  159. }
  160. //Activate sidebar push menu
  161. if (o.sidebarPushMenu) {
  162. $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector);
  163. }
  164. //Activate Bootstrap tooltip
  165. if (o.enableBSToppltip) {
  166. $(o.BSTooltipSelector).tooltip();
  167. }
  168. //Activate box widget
  169. if (o.enableBoxWidget) {
  170. $.AdminLTE.boxWidget.activate();
  171. }
  172. //Activate fast click
  173. if (o.enableFastclick && typeof FastClick != 'undefined') {
  174. FastClick.attach(document.body);
  175. }
  176. //Activate direct chat widget
  177. if (o.directChat.enable) {
  178. $(o.directChat.contactToggleSelector).on('click', function () {
  179. var box = $(this).parents('.direct-chat').first();
  180. box.toggleClass('direct-chat-contacts-open');
  181. });
  182. }
  183. /*
  184. * INITIALIZE BUTTON TOGGLE
  185. * ------------------------
  186. */
  187. $('.btn-group[data-toggle="btn-toggle"]').each(function () {
  188. var group = $(this);
  189. $(this).find(".btn").on('click', function (e) {
  190. group.find(".btn.active").removeClass("active");
  191. $(this).addClass("active");
  192. e.preventDefault();
  193. });
  194. });
  195. });
  196. /* ----------------------------------
  197. * - Initialize the AdminLTE Object -
  198. * ----------------------------------
  199. * All AdminLTE functions are implemented below.
  200. */
  201. function _init() {
  202. /* Layout
  203. * ======
  204. * Fixes the layout height in case min-height fails.
  205. *
  206. * @type Object
  207. * @usage $.AdminLTE.layout.activate()
  208. * $.AdminLTE.layout.fix()
  209. * $.AdminLTE.layout.fixSidebar()
  210. */
  211. $.AdminLTE.layout = {
  212. activate: function () {
  213. var _this = this;
  214. _this.fix();
  215. _this.fixSidebar();
  216. $(window, ".wrapper").resize(function () {
  217. _this.fix();
  218. _this.fixSidebar();
  219. });
  220. },
  221. fix: function () {
  222. //Get window height and the wrapper height
  223. var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight();
  224. var window_height = $(window).height();
  225. var sidebar_height = $(".sidebar").height();
  226. //Set the min-height of the content and sidebar based on the
  227. //the height of the document.
  228. if ($("body").hasClass("fixed")) {
  229. $(".content-wrapper, .right-side").css('min-height', window_height - $('.main-footer').outerHeight());
  230. } else {
  231. var postSetWidth;
  232. if (window_height >= sidebar_height) {
  233. $(".content-wrapper, .right-side").css('min-height', window_height - neg);
  234. postSetWidth = window_height - neg;
  235. } else {
  236. $(".content-wrapper, .right-side").css('min-height', sidebar_height);
  237. postSetWidth = sidebar_height;
  238. }
  239. //Fix for the control sidebar height
  240. var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector);
  241. if (typeof controlSidebar !== "undefined") {
  242. if (controlSidebar.height() > postSetWidth)
  243. $(".content-wrapper, .right-side").css('min-height', controlSidebar.height());
  244. }
  245. }
  246. },
  247. fixSidebar: function () {
  248. //Make sure the body tag has the .fixed class
  249. if (!$("body").hasClass("fixed")) {
  250. if (typeof $.fn.slimScroll != 'undefined') {
  251. $(".sidebar").slimScroll({destroy: true}).height("auto");
  252. }
  253. return;
  254. } else if (typeof $.fn.slimScroll == 'undefined' && console) {
  255. console.error("Error: the fixed layout requires the slimscroll plugin!");
  256. }
  257. //Enable slimscroll for fixed layout
  258. if ($.AdminLTE.options.sidebarSlimScroll) {
  259. if (typeof $.fn.slimScroll != 'undefined') {
  260. //Destroy if it exists
  261. $(".sidebar").slimScroll({destroy: true}).height("auto");
  262. //Add slimscroll
  263. $(".sidebar").slimscroll({
  264. height: ($(window).height() - $(".main-header").height()) + "px",
  265. color: "rgba(0,0,0,0.2)",
  266. size: "3px"
  267. });
  268. }
  269. }
  270. }
  271. };
  272. /* PushMenu()
  273. * ==========
  274. * Adds the push menu functionality to the sidebar.
  275. *
  276. * @type Function
  277. * @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']")
  278. */
  279. $.AdminLTE.pushMenu = {
  280. activate: function (toggleBtn) {
  281. //Get the screen sizes
  282. var screenSizes = $.AdminLTE.options.screenSizes;
  283. //Enable sidebar toggle
  284. $(toggleBtn).on('click', function (e) {
  285. e.preventDefault();
  286. //Enable sidebar push menu
  287. if ($(window).width() > (screenSizes.sm - 1)) {
  288. $("body").toggleClass('sidebar-collapse');
  289. }
  290. //Handle sidebar push menu for small screens
  291. else {
  292. if ($("body").hasClass('sidebar-open')) {
  293. $("body").removeClass('sidebar-open');
  294. $("body").removeClass('sidebar-collapse')
  295. } else {
  296. $("body").addClass('sidebar-open');
  297. }
  298. }
  299. });
  300. $(".content-wrapper").click(function () {
  301. //Enable hide menu when clicking on the content-wrapper on small screens
  302. if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) {
  303. $("body").removeClass('sidebar-open');
  304. }
  305. });
  306. //Enable expand on hover for sidebar mini
  307. if ($.AdminLTE.options.sidebarExpandOnHover
  308. || ($('body').hasClass('fixed')
  309. && $('body').hasClass('sidebar-mini'))) {
  310. this.expandOnHover();
  311. }
  312. },
  313. expandOnHover: function () {
  314. var _this = this;
  315. var screenWidth = $.AdminLTE.options.screenSizes.sm - 1;
  316. //Expand sidebar on hover
  317. $('.main-sidebar').hover(function () {
  318. if ($('body').hasClass('sidebar-mini')
  319. && $("body").hasClass('sidebar-collapse')
  320. && $(window).width() > screenWidth) {
  321. _this.expand();
  322. }
  323. }, function () {
  324. if ($('body').hasClass('sidebar-mini')
  325. && $('body').hasClass('sidebar-expanded-on-hover')
  326. && $(window).width() > screenWidth) {
  327. _this.collapse();
  328. }
  329. });
  330. },
  331. expand: function () {
  332. $("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover');
  333. },
  334. collapse: function () {
  335. if ($('body').hasClass('sidebar-expanded-on-hover')) {
  336. $('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse');
  337. }
  338. }
  339. };
  340. /* Tree()
  341. * ======
  342. * Converts the sidebar into a multilevel
  343. * tree view menu.
  344. *
  345. * @type Function
  346. * @Usage: $.AdminLTE.tree('.sidebar')
  347. */
  348. $.AdminLTE.tree = function (menu) {
  349. var _this = this;
  350. $("li a", $(menu)).on('click', function (e) {
  351. //Get the clicked link and the next element
  352. var $this = $(this);
  353. var checkElement = $this.next();
  354. //Check if the next element is a menu and is visible
  355. if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible'))) {
  356. //Close the menu
  357. checkElement.slideUp('normal', function () {
  358. checkElement.removeClass('menu-open');
  359. //Fix the layout in case the sidebar stretches over the height of the window
  360. //_this.layout.fix();
  361. });
  362. checkElement.parent("li").removeClass("active");
  363. }
  364. //If the menu is not visible
  365. else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) {
  366. //Get the parent menu
  367. var parent = $this.parents('ul').first();
  368. //Close all open menus within the parent
  369. var ul = parent.find('ul:visible').slideUp('normal');
  370. //Remove the menu-open class from the parent
  371. ul.removeClass('menu-open');
  372. //Get the parent li
  373. var parent_li = $this.parent("li");
  374. //Open the target menu and add the menu-open class
  375. checkElement.slideDown('normal', function () {
  376. //Add the class active to the parent li
  377. checkElement.addClass('menu-open');
  378. parent.find('li.active').removeClass('active');
  379. parent_li.addClass('active');
  380. //Fix the layout in case the sidebar stretches over the height of the window
  381. _this.layout.fix();
  382. });
  383. }
  384. //if this isn't a link, prevent the page from being redirected
  385. if (checkElement.is('.treeview-menu')) {
  386. e.preventDefault();
  387. }
  388. });
  389. };
  390. /* ControlSidebar
  391. * ==============
  392. * Adds functionality to the right sidebar
  393. *
  394. * @type Object
  395. * @usage $.AdminLTE.controlSidebar.activate(options)
  396. */
  397. $.AdminLTE.controlSidebar = {
  398. //instantiate the object
  399. activate: function () {
  400. //Get the object
  401. var _this = this;
  402. //Update options
  403. var o = $.AdminLTE.options.controlSidebarOptions;
  404. //Get the sidebar
  405. var sidebar = $(o.selector);
  406. //The toggle button
  407. var btn = $(o.toggleBtnSelector);
  408. //Listen to the click event
  409. btn.on('click', function (e) {
  410. e.preventDefault();
  411. //If the sidebar is not open
  412. if (!sidebar.hasClass('control-sidebar-open')
  413. && !$('body').hasClass('control-sidebar-open')) {
  414. //Open the sidebar
  415. _this.open(sidebar, o.slide);
  416. } else {
  417. _this.close(sidebar, o.slide);
  418. }
  419. });
  420. //If the body has a boxed layout, fix the sidebar bg position
  421. var bg = $(".control-sidebar-bg");
  422. _this._fix(bg);
  423. //If the body has a fixed layout, make the control sidebar fixed
  424. if ($('body').hasClass('fixed')) {
  425. _this._fixForFixed(sidebar);
  426. } else {
  427. //If the content height is less than the sidebar's height, force max height
  428. if ($('.content-wrapper, .right-side').height() < sidebar.height()) {
  429. _this._fixForContent(sidebar);
  430. }
  431. }
  432. },
  433. //Open the control sidebar
  434. open: function (sidebar, slide) {
  435. var _this = this;
  436. //Slide over content
  437. if (slide) {
  438. sidebar.addClass('control-sidebar-open');
  439. $('.content-wrapper, .right-side').on('click', function () {
  440. _this.close(sidebar, slide);
  441. });
  442. } else {
  443. //Push the content by adding the open class to the body instead
  444. //of the sidebar itself
  445. $('body').addClass('control-sidebar-open');
  446. }
  447. },
  448. //Close the control sidebar
  449. close: function (sidebar, slide) {
  450. if (slide) {
  451. sidebar.removeClass('control-sidebar-open');
  452. } else {
  453. $('body').removeClass('control-sidebar-open');
  454. }
  455. },
  456. _fix: function (sidebar) {
  457. var _this = this;
  458. if ($("body").hasClass('layout-boxed')) {
  459. sidebar.css('position', 'absolute');
  460. sidebar.height($(".wrapper").height());
  461. $(window).resize(function () {
  462. _this._fix(sidebar);
  463. });
  464. } else {
  465. sidebar.css({
  466. 'position': 'fixed',
  467. 'height': 'auto'
  468. });
  469. }
  470. },
  471. _fixForFixed: function (sidebar) {
  472. sidebar.css({
  473. 'position': 'fixed',
  474. 'max-height': '100%',
  475. 'overflow': 'auto',
  476. 'padding-bottom': '50px'
  477. });
  478. },
  479. _fixForContent: function (sidebar) {
  480. $(".content-wrapper, .right-side").css('min-height', sidebar.height());
  481. }
  482. };
  483. /* BoxWidget
  484. * =========
  485. * BoxWidget is a plugin to handle collapsing and
  486. * removing boxes from the screen.
  487. *
  488. * @type Object
  489. * @usage $.AdminLTE.boxWidget.activate()
  490. * Set all your options in the main $.AdminLTE.options object
  491. */
  492. $.AdminLTE.boxWidget = {
  493. selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,
  494. icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,
  495. activate: function () {
  496. var _this = this;
  497. //Listen for collapse event triggers
  498. $(_this.selectors.collapse).on('click', function (e) {
  499. e.preventDefault();
  500. _this.collapse($(this));
  501. });
  502. //Listen for remove event triggers
  503. $(_this.selectors.remove).on('click', function (e) {
  504. e.preventDefault();
  505. _this.remove($(this));
  506. });
  507. },
  508. collapse: function (element) {
  509. var _this = this;
  510. //Find the box parent
  511. var box = element.parents(".box").first();
  512. //Find the body and the footer
  513. var box_content = box.find("> .box-body, > .box-footer");
  514. if (!box.hasClass("collapsed-box")) {
  515. //Convert minus into plus
  516. element.children(":first")
  517. .removeClass(_this.icons.collapse)
  518. .addClass(_this.icons.open);
  519. //Hide the content
  520. box_content.slideUp(300, function () {
  521. box.addClass("collapsed-box");
  522. });
  523. } else {
  524. //Convert plus into minus
  525. element.children(":first")
  526. .removeClass(_this.icons.open)
  527. .addClass(_this.icons.collapse);
  528. //Show the content
  529. box_content.slideDown(300, function () {
  530. box.removeClass("collapsed-box");
  531. });
  532. }
  533. },
  534. remove: function (element) {
  535. //Find the box parent
  536. var box = element.parents(".box").first();
  537. box.slideUp();
  538. }
  539. };
  540. }
  541. /* ------------------
  542. * - Custom Plugins -
  543. * ------------------
  544. * All custom plugins are defined below.
  545. */
  546. /*
  547. * BOX REFRESH BUTTON
  548. * ------------------
  549. * This is a custom plugin to use with the component BOX. It allows you to add
  550. * a refresh button to the box. It converts the box's state to a loading state.
  551. *
  552. * @type plugin
  553. * @usage $("#box-widget").boxRefresh( options );
  554. */
  555. (function ($) {
  556. $.fn.boxRefresh = function (options) {
  557. // Render options
  558. var settings = $.extend({
  559. //Refresh button selector
  560. trigger: ".refresh-btn",
  561. //File source to be loaded (e.g: ajax/src.php)
  562. source: "",
  563. //Callbacks
  564. onLoadStart: function (box) {
  565. }, //Right after the button has been clicked
  566. onLoadDone: function (box) {
  567. } //When the source has been loaded
  568. }, options);
  569. //The overlay
  570. var overlay = $('<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>');
  571. return this.each(function () {
  572. //if a source is specified
  573. if (settings.source === "") {
  574. if (console) {
  575. console.log("Please specify a source first - boxRefresh()");
  576. }
  577. return;
  578. }
  579. //the box
  580. var box = $(this);
  581. //the button
  582. var rBtn = box.find(settings.trigger).first();
  583. //On trigger click
  584. rBtn.on('click', function (e) {
  585. e.preventDefault();
  586. //Add loading overlay
  587. start(box);
  588. //Perform ajax call
  589. box.find(".box-body").load(settings.source, function () {
  590. done(box);
  591. });
  592. });
  593. });
  594. function start(box) {
  595. //Add overlay and loading img
  596. box.append(overlay);
  597. settings.onLoadStart.call(box);
  598. }
  599. function done(box) {
  600. //Remove overlay and loading img
  601. box.find(overlay).remove();
  602. settings.onLoadDone.call(box);
  603. }
  604. };
  605. })(jQuery);
  606. /*
  607. * TODO LIST CUSTOM PLUGIN
  608. * -----------------------
  609. * This plugin depends on iCheck plugin for checkbox and radio inputs
  610. *
  611. * @type plugin
  612. * @usage $("#todo-widget").todolist( options );
  613. */
  614. (function ($) {
  615. $.fn.todolist = function (options) {
  616. // Render options
  617. var settings = $.extend({
  618. //When the user checks the input
  619. onCheck: function (ele) {
  620. },
  621. //When the user unchecks the input
  622. onUncheck: function (ele) {
  623. }
  624. }, options);
  625. return this.each(function () {
  626. if (typeof $.fn.iCheck != 'undefined') {
  627. $('input', this).on('ifChecked', function (event) {
  628. var ele = $(this).parents("li").first();
  629. ele.toggleClass("done");
  630. settings.onCheck.call(ele);
  631. });
  632. $('input', this).on('ifUnchecked', function (event) {
  633. var ele = $(this).parents("li").first();
  634. ele.toggleClass("done");
  635. settings.onUncheck.call(ele);
  636. });
  637. } else {
  638. $('input', this).on('change', function (event) {
  639. var ele = $(this).parents("li").first();
  640. ele.toggleClass("done");
  641. settings.onCheck.call(ele);
  642. });
  643. }
  644. });
  645. };
  646. }(jQuery));