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.

844 lines
26 KiB

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