You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

846 lines
26 KiB

9 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. /*!
  2. * # Semantic UI 2.0.0 - Shape
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. ;(function ( $, window, document, undefined ) {
  12. "use strict";
  13. $.fn.shape = function(parameters) {
  14. var
  15. $allModules = $(this),
  16. $body = $('body'),
  17. time = new Date().getTime(),
  18. performance = [],
  19. query = arguments[0],
  20. methodInvoked = (typeof query == 'string'),
  21. queryArguments = [].slice.call(arguments, 1),
  22. requestAnimationFrame = window.requestAnimationFrame
  23. || window.mozRequestAnimationFrame
  24. || window.webkitRequestAnimationFrame
  25. || window.msRequestAnimationFrame
  26. || function(callback) { setTimeout(callback, 0); },
  27. returnedValue
  28. ;
  29. $allModules
  30. .each(function() {
  31. var
  32. moduleSelector = $allModules.selector || '',
  33. settings = ( $.isPlainObject(parameters) )
  34. ? $.extend(true, {}, $.fn.shape.settings, parameters)
  35. : $.extend({}, $.fn.shape.settings),
  36. // internal aliases
  37. namespace = settings.namespace,
  38. selector = settings.selector,
  39. error = settings.error,
  40. className = settings.className,
  41. // define namespaces for modules
  42. eventNamespace = '.' + namespace,
  43. moduleNamespace = 'module-' + namespace,
  44. // selector cache
  45. $module = $(this),
  46. $sides = $module.find(selector.sides),
  47. $side = $module.find(selector.side),
  48. // private variables
  49. nextIndex = false,
  50. $activeSide,
  51. $nextSide,
  52. // standard module
  53. element = this,
  54. instance = $module.data(moduleNamespace),
  55. module
  56. ;
  57. module = {
  58. initialize: function() {
  59. module.verbose('Initializing module for', element);
  60. module.set.defaultSide();
  61. module.instantiate();
  62. },
  63. instantiate: function() {
  64. module.verbose('Storing instance of module', module);
  65. instance = module;
  66. $module
  67. .data(moduleNamespace, instance)
  68. ;
  69. },
  70. destroy: function() {
  71. module.verbose('Destroying previous module for', element);
  72. $module
  73. .removeData(moduleNamespace)
  74. .off(eventNamespace)
  75. ;
  76. },
  77. refresh: function() {
  78. module.verbose('Refreshing selector cache for', element);
  79. $module = $(element);
  80. $sides = $(this).find(selector.shape);
  81. $side = $(this).find(selector.side);
  82. },
  83. repaint: function() {
  84. module.verbose('Forcing repaint event');
  85. var
  86. shape = $sides.get(0) || document.createElement('div'),
  87. fakeAssignment = shape.offsetWidth
  88. ;
  89. },
  90. animate: function(propertyObject, callback) {
  91. module.verbose('Animating box with properties', propertyObject);
  92. callback = callback || function(event) {
  93. module.verbose('Executing animation callback');
  94. if(event !== undefined) {
  95. event.stopPropagation();
  96. }
  97. module.reset();
  98. module.set.active();
  99. };
  100. settings.beforeChange.call($nextSide.get());
  101. if(module.get.transitionEvent()) {
  102. module.verbose('Starting CSS animation');
  103. $module
  104. .addClass(className.animating)
  105. ;
  106. $sides
  107. .css(propertyObject)
  108. .one(module.get.transitionEvent(), callback)
  109. ;
  110. module.set.duration(settings.duration);
  111. requestAnimationFrame(function() {
  112. $module
  113. .addClass(className.animating)
  114. ;
  115. $activeSide
  116. .addClass(className.hidden)
  117. ;
  118. });
  119. }
  120. else {
  121. callback();
  122. }
  123. },
  124. queue: function(method) {
  125. module.debug('Queueing animation of', method);
  126. $sides
  127. .one(module.get.transitionEvent(), function() {
  128. module.debug('Executing queued animation');
  129. setTimeout(function(){
  130. $module.shape(method);
  131. }, 0);
  132. })
  133. ;
  134. },
  135. reset: function() {
  136. module.verbose('Animating states reset');
  137. $module
  138. .removeClass(className.animating)
  139. .attr('style', '')
  140. .removeAttr('style')
  141. ;
  142. // removeAttr style does not consistently work in safari
  143. $sides
  144. .attr('style', '')
  145. .removeAttr('style')
  146. ;
  147. $side
  148. .attr('style', '')
  149. .removeAttr('style')
  150. .removeClass(className.hidden)
  151. ;
  152. $nextSide
  153. .removeClass(className.animating)
  154. .attr('style', '')
  155. .removeAttr('style')
  156. ;
  157. },
  158. is: {
  159. complete: function() {
  160. return ($side.filter('.' + className.active)[0] == $nextSide[0]);
  161. },
  162. animating: function() {
  163. return $module.hasClass(className.animating);
  164. }
  165. },
  166. set: {
  167. defaultSide: function() {
  168. $activeSide = $module.find('.' + settings.className.active);
  169. $nextSide = ( $activeSide.next(selector.side).length > 0 )
  170. ? $activeSide.next(selector.side)
  171. : $module.find(selector.side).first()
  172. ;
  173. nextIndex = false;
  174. module.verbose('Active side set to', $activeSide);
  175. module.verbose('Next side set to', $nextSide);
  176. },
  177. duration: function(duration) {
  178. duration = duration || settings.duration;
  179. duration = (typeof duration == 'number')
  180. ? duration + 'ms'
  181. : duration
  182. ;
  183. module.verbose('Setting animation duration', duration);
  184. $sides.add($side)
  185. .css({
  186. '-webkit-transition-duration': duration,
  187. '-moz-transition-duration': duration,
  188. '-ms-transition-duration': duration,
  189. '-o-transition-duration': duration,
  190. 'transition-duration': duration
  191. })
  192. ;
  193. },
  194. currentStageSize: function() {
  195. var
  196. $activeSide = $module.find('.' + settings.className.active),
  197. width = $activeSide.outerWidth(true),
  198. height = $activeSide.outerHeight(true)
  199. ;
  200. $module
  201. .css({
  202. width: width,
  203. height: height
  204. })
  205. ;
  206. },
  207. stageSize: function() {
  208. var
  209. $clone = $module.clone().addClass(className.loading),
  210. $activeSide = $clone.find('.' + settings.className.active),
  211. $nextSide = (nextIndex)
  212. ? $clone.find(selector.side).eq(nextIndex)
  213. : ( $activeSide.next(selector.side).length > 0 )
  214. ? $activeSide.next(selector.side)
  215. : $clone.find(selector.side).first(),
  216. newSize = {}
  217. ;
  218. module.set.currentStageSize();
  219. $activeSide.removeClass(className.active);
  220. $nextSide.addClass(className.active);
  221. $clone.insertAfter($module);
  222. newSize = {
  223. width : $nextSide.outerWidth(true),
  224. height : $nextSide.outerHeight(true)
  225. };
  226. $clone.remove();
  227. $module
  228. .css(newSize)
  229. ;
  230. module.verbose('Resizing stage to fit new content', newSize);
  231. },
  232. nextSide: function(selector) {
  233. nextIndex = selector;
  234. $nextSide = $side.filter(selector);
  235. nextIndex = $side.index($nextSide);
  236. if($nextSide.length === 0) {
  237. module.set.defaultSide();
  238. module.error(error.side);
  239. }
  240. module.verbose('Next side manually set to', $nextSide);
  241. },
  242. active: function() {
  243. module.verbose('Setting new side to active', $nextSide);
  244. $side
  245. .removeClass(className.active)
  246. ;
  247. $nextSide
  248. .addClass(className.active)
  249. ;
  250. settings.onChange.call($nextSide.get());
  251. module.set.defaultSide();
  252. }
  253. },
  254. flip: {
  255. up: function() {
  256. if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
  257. module.debug('Side already visible', $nextSide);
  258. return;
  259. }
  260. if( !module.is.animating()) {
  261. module.debug('Flipping up', $nextSide);
  262. module.set.stageSize();
  263. module.stage.above();
  264. module.animate( module.get.transform.up() );
  265. }
  266. else {
  267. module.queue('flip up');
  268. }
  269. },
  270. down: function() {
  271. if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
  272. module.debug('Side already visible', $nextSide);
  273. return;
  274. }
  275. if( !module.is.animating()) {
  276. module.debug('Flipping down', $nextSide);
  277. module.set.stageSize();
  278. module.stage.below();
  279. module.animate( module.get.transform.down() );
  280. }
  281. else {
  282. module.queue('flip down');
  283. }
  284. },
  285. left: function() {
  286. if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
  287. module.debug('Side already visible', $nextSide);
  288. return;
  289. }
  290. if( !module.is.animating()) {
  291. module.debug('Flipping left', $nextSide);
  292. module.set.stageSize();
  293. module.stage.left();
  294. module.animate(module.get.transform.left() );
  295. }
  296. else {
  297. module.queue('flip left');
  298. }
  299. },
  300. right: function() {
  301. if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
  302. module.debug('Side already visible', $nextSide);
  303. return;
  304. }
  305. if( !module.is.animating()) {
  306. module.debug('Flipping right', $nextSide);
  307. module.set.stageSize();
  308. module.stage.right();
  309. module.animate(module.get.transform.right() );
  310. }
  311. else {
  312. module.queue('flip right');
  313. }
  314. },
  315. over: function() {
  316. if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
  317. module.debug('Side already visible', $nextSide);
  318. return;
  319. }
  320. if( !module.is.animating()) {
  321. module.debug('Flipping over', $nextSide);
  322. module.set.stageSize();
  323. module.stage.behind();
  324. module.animate(module.get.transform.over() );
  325. }
  326. else {
  327. module.queue('flip over');
  328. }
  329. },
  330. back: function() {
  331. if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
  332. module.debug('Side already visible', $nextSide);
  333. return;
  334. }
  335. if( !module.is.animating()) {
  336. module.debug('Flipping back', $nextSide);
  337. module.set.stageSize();
  338. module.stage.behind();
  339. module.animate(module.get.transform.back() );
  340. }
  341. else {
  342. module.queue('flip back');
  343. }
  344. }
  345. },
  346. get: {
  347. transform: {
  348. up: function() {
  349. var
  350. translate = {
  351. y: -(($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
  352. z: -($activeSide.outerHeight(true) / 2)
  353. }
  354. ;
  355. return {
  356. transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(-90deg)'
  357. };
  358. },
  359. down: function() {
  360. var
  361. translate = {
  362. y: -(($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
  363. z: -($activeSide.outerHeight(true) / 2)
  364. }
  365. ;
  366. return {
  367. transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(90deg)'
  368. };
  369. },
  370. left: function() {
  371. var
  372. translate = {
  373. x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
  374. z : -($activeSide.outerWidth(true) / 2)
  375. }
  376. ;
  377. return {
  378. transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(90deg)'
  379. };
  380. },
  381. right: function() {
  382. var
  383. translate = {
  384. x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2),
  385. z : -($activeSide.outerWidth(true) / 2)
  386. }
  387. ;
  388. return {
  389. transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(-90deg)'
  390. };
  391. },
  392. over: function() {
  393. var
  394. translate = {
  395. x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
  396. }
  397. ;
  398. return {
  399. transform: 'translateX(' + translate.x + 'px) rotateY(180deg)'
  400. };
  401. },
  402. back: function() {
  403. var
  404. translate = {
  405. x : -(($activeSide.outerWidth(true) - $nextSide.outerWidth(true)) / 2)
  406. }
  407. ;
  408. return {
  409. transform: 'translateX(' + translate.x + 'px) rotateY(-180deg)'
  410. };
  411. }
  412. },
  413. transitionEvent: function() {
  414. var
  415. element = document.createElement('element'),
  416. transitions = {
  417. 'transition' :'transitionend',
  418. 'OTransition' :'oTransitionEnd',
  419. 'MozTransition' :'transitionend',
  420. 'WebkitTransition' :'webkitTransitionEnd'
  421. },
  422. transition
  423. ;
  424. for(transition in transitions){
  425. if( element.style[transition] !== undefined ){
  426. return transitions[transition];
  427. }
  428. }
  429. },
  430. nextSide: function() {
  431. return ( $activeSide.next(selector.side).length > 0 )
  432. ? $activeSide.next(selector.side)
  433. : $module.find(selector.side).first()
  434. ;
  435. }
  436. },
  437. stage: {
  438. above: function() {
  439. var
  440. box = {
  441. origin : (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
  442. depth : {
  443. active : ($nextSide.outerHeight(true) / 2),
  444. next : ($activeSide.outerHeight(true) / 2)
  445. }
  446. }
  447. ;
  448. module.verbose('Setting the initial animation position as above', $nextSide, box);
  449. $activeSide
  450. .css({
  451. 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
  452. })
  453. ;
  454. $nextSide
  455. .addClass(className.animating)
  456. .css({
  457. 'display' : 'block',
  458. 'top' : box.origin + 'px',
  459. 'transform' : 'rotateX(90deg) translateZ(' + box.depth.next + 'px)'
  460. })
  461. ;
  462. },
  463. below: function() {
  464. var
  465. box = {
  466. origin : (($activeSide.outerHeight(true) - $nextSide.outerHeight(true)) / 2),
  467. depth : {
  468. active : ($nextSide.outerHeight(true) / 2),
  469. next : ($activeSide.outerHeight(true) / 2)
  470. }
  471. }
  472. ;
  473. module.verbose('Setting the initial animation position as below', $nextSide, box);
  474. $activeSide
  475. .css({
  476. 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
  477. })
  478. ;
  479. $nextSide
  480. .addClass(className.animating)
  481. .css({
  482. 'display' : 'block',
  483. 'top' : box.origin + 'px',
  484. 'transform' : 'rotateX(-90deg) translateZ(' + box.depth.next + 'px)'
  485. })
  486. ;
  487. },
  488. left: function() {
  489. var
  490. box = {
  491. origin : ( ( $activeSide.outerWidth(true) - $nextSide.outerWidth(true) ) / 2),
  492. depth : {
  493. active : ($nextSide.outerWidth(true) / 2),
  494. next : ($activeSide.outerWidth(true) / 2)
  495. }
  496. }
  497. ;
  498. module.verbose('Setting the initial animation position as left', $nextSide, box);
  499. $activeSide
  500. .css({
  501. 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
  502. })
  503. ;
  504. $nextSide
  505. .addClass(className.animating)
  506. .css({
  507. 'display' : 'block',
  508. 'left' : box.origin + 'px',
  509. 'transform' : 'rotateY(-90deg) translateZ(' + box.depth.next + 'px)'
  510. })
  511. ;
  512. },
  513. right: function() {
  514. var
  515. box = {
  516. origin : ( ( $activeSide.outerWidth(true) - $nextSide.outerWidth(true) ) / 2),
  517. depth : {
  518. active : ($nextSide.outerWidth(true) / 2),
  519. next : ($activeSide.outerWidth(true) / 2)
  520. }
  521. }
  522. ;
  523. module.verbose('Setting the initial animation position as left', $nextSide, box);
  524. $activeSide
  525. .css({
  526. 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
  527. })
  528. ;
  529. $nextSide
  530. .addClass(className.animating)
  531. .css({
  532. 'display' : 'block',
  533. 'left' : box.origin + 'px',
  534. 'transform' : 'rotateY(90deg) translateZ(' + box.depth.next + 'px)'
  535. })
  536. ;
  537. },
  538. behind: function() {
  539. var
  540. box = {
  541. origin : ( ( $activeSide.outerWidth(true) - $nextSide.outerWidth(true) ) / 2),
  542. depth : {
  543. active : ($nextSide.outerWidth(true) / 2),
  544. next : ($activeSide.outerWidth(true) / 2)
  545. }
  546. }
  547. ;
  548. module.verbose('Setting the initial animation position as behind', $nextSide, box);
  549. $activeSide
  550. .css({
  551. 'transform' : 'rotateY(0deg)'
  552. })
  553. ;
  554. $nextSide
  555. .addClass(className.animating)
  556. .css({
  557. 'display' : 'block',
  558. 'left' : box.origin + 'px',
  559. 'transform' : 'rotateY(-180deg)'
  560. })
  561. ;
  562. }
  563. },
  564. setting: function(name, value) {
  565. module.debug('Changing setting', name, value);
  566. if( $.isPlainObject(name) ) {
  567. $.extend(true, settings, name);
  568. }
  569. else if(value !== undefined) {
  570. settings[name] = value;
  571. }
  572. else {
  573. return settings[name];
  574. }
  575. },
  576. internal: function(name, value) {
  577. if( $.isPlainObject(name) ) {
  578. $.extend(true, module, name);
  579. }
  580. else if(value !== undefined) {
  581. module[name] = value;
  582. }
  583. else {
  584. return module[name];
  585. }
  586. },
  587. debug: function() {
  588. if(settings.debug) {
  589. if(settings.performance) {
  590. module.performance.log(arguments);
  591. }
  592. else {
  593. module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
  594. module.debug.apply(console, arguments);
  595. }
  596. }
  597. },
  598. verbose: function() {
  599. if(settings.verbose && settings.debug) {
  600. if(settings.performance) {
  601. module.performance.log(arguments);
  602. }
  603. else {
  604. module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
  605. module.verbose.apply(console, arguments);
  606. }
  607. }
  608. },
  609. error: function() {
  610. module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
  611. module.error.apply(console, arguments);
  612. },
  613. performance: {
  614. log: function(message) {
  615. var
  616. currentTime,
  617. executionTime,
  618. previousTime
  619. ;
  620. if(settings.performance) {
  621. currentTime = new Date().getTime();
  622. previousTime = time || currentTime;
  623. executionTime = currentTime - previousTime;
  624. time = currentTime;
  625. performance.push({
  626. 'Name' : message[0],
  627. 'Arguments' : [].slice.call(message, 1) || '',
  628. 'Element' : element,
  629. 'Execution Time' : executionTime
  630. });
  631. }
  632. clearTimeout(module.performance.timer);
  633. module.performance.timer = setTimeout(module.performance.display, 500);
  634. },
  635. display: function() {
  636. var
  637. title = settings.name + ':',
  638. totalTime = 0
  639. ;
  640. time = false;
  641. clearTimeout(module.performance.timer);
  642. $.each(performance, function(index, data) {
  643. totalTime += data['Execution Time'];
  644. });
  645. title += ' ' + totalTime + 'ms';
  646. if(moduleSelector) {
  647. title += ' \'' + moduleSelector + '\'';
  648. }
  649. if($allModules.length > 1) {
  650. title += ' ' + '(' + $allModules.length + ')';
  651. }
  652. if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
  653. console.groupCollapsed(title);
  654. if(console.table) {
  655. console.table(performance);
  656. }
  657. else {
  658. $.each(performance, function(index, data) {
  659. console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
  660. });
  661. }
  662. console.groupEnd();
  663. }
  664. performance = [];
  665. }
  666. },
  667. invoke: function(query, passedArguments, context) {
  668. var
  669. object = instance,
  670. maxDepth,
  671. found,
  672. response
  673. ;
  674. passedArguments = passedArguments || queryArguments;
  675. context = element || context;
  676. if(typeof query == 'string' && object !== undefined) {
  677. query = query.split(/[\. ]/);
  678. maxDepth = query.length - 1;
  679. $.each(query, function(depth, value) {
  680. var camelCaseValue = (depth != maxDepth)
  681. ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
  682. : query
  683. ;
  684. if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
  685. object = object[camelCaseValue];
  686. }
  687. else if( object[camelCaseValue] !== undefined ) {
  688. found = object[camelCaseValue];
  689. return false;
  690. }
  691. else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
  692. object = object[value];
  693. }
  694. else if( object[value] !== undefined ) {
  695. found = object[value];
  696. return false;
  697. }
  698. else {
  699. return false;
  700. }
  701. });
  702. }
  703. if ( $.isFunction( found ) ) {
  704. response = found.apply(context, passedArguments);
  705. }
  706. else if(found !== undefined) {
  707. response = found;
  708. }
  709. if($.isArray(returnedValue)) {
  710. returnedValue.push(response);
  711. }
  712. else if(returnedValue !== undefined) {
  713. returnedValue = [returnedValue, response];
  714. }
  715. else if(response !== undefined) {
  716. returnedValue = response;
  717. }
  718. return found;
  719. }
  720. };
  721. if(methodInvoked) {
  722. if(instance === undefined) {
  723. module.initialize();
  724. }
  725. module.invoke(query);
  726. }
  727. else {
  728. if(instance !== undefined) {
  729. instance.invoke('destroy');
  730. }
  731. module.initialize();
  732. }
  733. })
  734. ;
  735. return (returnedValue !== undefined)
  736. ? returnedValue
  737. : this
  738. ;
  739. };
  740. $.fn.shape.settings = {
  741. // module info
  742. name : 'Shape',
  743. // debug content outputted to console
  744. debug : false,
  745. // verbose debug output
  746. verbose : false,
  747. // performance data output
  748. performance: true,
  749. // event namespace
  750. namespace : 'shape',
  751. // callback occurs on side change
  752. beforeChange : function() {},
  753. onChange : function() {},
  754. // allow animation to same side
  755. allowRepeats: false,
  756. // animation duration
  757. duration : 700,
  758. // possible errors
  759. error: {
  760. side : 'You tried to switch to a side that does not exist.',
  761. method : 'The method you called is not defined'
  762. },
  763. // classnames used
  764. className : {
  765. animating : 'animating',
  766. hidden : 'hidden',
  767. loading : 'loading',
  768. active : 'active'
  769. },
  770. // selectors used
  771. selector : {
  772. sides : '.sides',
  773. side : '.side'
  774. }
  775. };
  776. })( jQuery, window , document );