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.

942 lines
30 KiB

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
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
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
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
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
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
10 years ago
10 years ago
10 years ago
10 years ago
  1. /*
  2. * # Semantic - Transition
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributor
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. ;(function ( $, window, document, undefined ) {
  12. "use strict";
  13. $.fn.transition = function() {
  14. var
  15. $allModules = $(this),
  16. moduleSelector = $allModules.selector || '',
  17. time = new Date().getTime(),
  18. performance = [],
  19. moduleArguments = arguments,
  20. query = moduleArguments[0],
  21. queryArguments = [].slice.call(arguments, 1),
  22. methodInvoked = (typeof query === 'string'),
  23. requestAnimationFrame = window.requestAnimationFrame
  24. || window.mozRequestAnimationFrame
  25. || window.webkitRequestAnimationFrame
  26. || window.msRequestAnimationFrame
  27. || function(callback) { setTimeout(callback, 0); },
  28. returnedValue
  29. ;
  30. $allModules
  31. .each(function() {
  32. var
  33. $module = $(this),
  34. element = this,
  35. // set at run time
  36. settings,
  37. instance,
  38. error,
  39. className,
  40. metadata,
  41. animationStart,
  42. animationEnd,
  43. animationName,
  44. namespace,
  45. moduleNamespace,
  46. eventNamespace,
  47. module
  48. ;
  49. module = {
  50. initialize: function() {
  51. // get full settings
  52. settings = module.get.settings.apply(element, moduleArguments);
  53. // shorthand
  54. className = settings.className;
  55. error = settings.error;
  56. metadata = settings.metadata;
  57. // define namespace
  58. eventNamespace = '.' + settings.namespace;
  59. moduleNamespace = 'module-' + settings.namespace;
  60. instance = $module.data(moduleNamespace) || module;
  61. // get vendor specific events
  62. animationEnd = module.get.animationEndEvent();
  63. animationName = module.get.animationName();
  64. animationStart = module.get.animationStartEvent();
  65. if(methodInvoked) {
  66. methodInvoked = module.invoke(query);
  67. }
  68. // method not invoked, lets run an animation
  69. if(methodInvoked === false) {
  70. module.verbose('Converted arguments into settings object', settings);
  71. module.animate();
  72. module.instantiate();
  73. }
  74. },
  75. instantiate: function() {
  76. module.verbose('Storing instance of module', module);
  77. instance = module;
  78. $module
  79. .data(moduleNamespace, instance)
  80. ;
  81. },
  82. destroy: function() {
  83. module.verbose('Destroying previous module for', element);
  84. $module
  85. .removeData(moduleNamespace)
  86. ;
  87. },
  88. refresh: function() {
  89. module.verbose('Refreshing display type on next animation');
  90. delete module.displayType;
  91. },
  92. forceRepaint: function() {
  93. module.verbose('Forcing element repaint');
  94. var
  95. $parentElement = $module.parent(),
  96. $nextElement = $module.next()
  97. ;
  98. if($nextElement.length === 0) {
  99. $module.detach().appendTo($parentElement);
  100. }
  101. else {
  102. $module.detach().insertBefore($nextElement);
  103. }
  104. },
  105. repaint: function() {
  106. module.verbose('Repainting element');
  107. var
  108. fakeAssignment = element.offsetWidth
  109. ;
  110. },
  111. animate: function(overrideSettings) {
  112. settings = overrideSettings || settings;
  113. if(!module.is.supported()) {
  114. module.error(error.support);
  115. return false;
  116. }
  117. module.debug('Preparing animation', settings.animation);
  118. if(module.is.animating()) {
  119. if(settings.queue) {
  120. if(!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
  121. module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
  122. }
  123. else {
  124. module.queue(settings.animation);
  125. }
  126. return false;
  127. }
  128. else if(!settings.allowRepeats && module.is.occurring()) {
  129. module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
  130. return false;
  131. }
  132. }
  133. if( module.can.animate() ) {
  134. module.set.animating(settings.animation);
  135. }
  136. else {
  137. module.error(error.noAnimation, settings.animation, element);
  138. }
  139. },
  140. reset: function() {
  141. module.debug('Resetting animation to beginning conditions');
  142. module.remove.animationEndCallback();
  143. module.restore.conditions();
  144. module.remove.animating();
  145. },
  146. queue: function(animation) {
  147. module.debug('Queueing animation of', animation);
  148. module.queuing = true;
  149. $module
  150. .one(animationEnd + eventNamespace, function() {
  151. module.queuing = false;
  152. module.repaint();
  153. module.animate.apply(this, settings);
  154. })
  155. ;
  156. },
  157. complete: function () {
  158. module.verbose('CSS animation complete', settings.animation);
  159. module.remove.animationEndCallback();
  160. module.remove.failSafe();
  161. if(!module.is.looping()) {
  162. if( module.is.outward() ) {
  163. module.verbose('Animation is outward, hiding element');
  164. module.restore.conditions();
  165. module.hide();
  166. settings.onHide.call(this);
  167. }
  168. else if( module.is.inward() ) {
  169. module.verbose('Animation is outward, showing element');
  170. module.restore.conditions();
  171. module.show();
  172. module.set.display();
  173. settings.onShow.call(this);
  174. }
  175. else {
  176. module.restore.conditions();
  177. }
  178. module.remove.animation();
  179. module.remove.animating();
  180. }
  181. settings.onComplete.call(this);
  182. },
  183. has: {
  184. direction: function(animation) {
  185. var
  186. hasDirection = false
  187. ;
  188. animation = animation || settings.animation;
  189. if(typeof animation === 'string') {
  190. animation = animation.split(' ');
  191. $.each(animation, function(index, word){
  192. if(word === className.inward || word === className.outward) {
  193. hasDirection = true;
  194. }
  195. });
  196. }
  197. return hasDirection;
  198. },
  199. inlineDisplay: function() {
  200. var
  201. style = $module.attr('style') || ''
  202. ;
  203. return $.isArray(style.match(/display.*?;/, ''));
  204. }
  205. },
  206. set: {
  207. animating: function(animation) {
  208. animation = animation || settings.animation;
  209. if(!module.is.animating()) {
  210. module.save.conditions();
  211. }
  212. module.remove.direction();
  213. module.remove.animationEndCallback();
  214. if(module.can.transition() && !module.has.direction()) {
  215. module.set.direction();
  216. }
  217. module.remove.hidden();
  218. module.set.display();
  219. $module
  220. .addClass(className.animating + ' ' + className.transition + ' ' + animation)
  221. .addClass(animation)
  222. .one(animationEnd + '.complete' + eventNamespace, module.complete)
  223. ;
  224. if(settings.useFailSafe) {
  225. module.add.failSafe();
  226. }
  227. module.set.duration(settings.duration);
  228. settings.onStart.call(this);
  229. module.debug('Starting tween', animation, $module.attr('class'));
  230. },
  231. duration: function(animationName, duration) {
  232. duration = duration || settings.duration;
  233. duration = (typeof duration == 'number')
  234. ? duration + 'ms'
  235. : duration
  236. ;
  237. module.verbose('Setting animation duration', duration);
  238. if(duration || duration === 0) {
  239. $module
  240. .css({
  241. '-webkit-animation-duration': duration,
  242. '-moz-animation-duration': duration,
  243. '-ms-animation-duration': duration,
  244. '-o-animation-duration': duration,
  245. 'animation-duration': duration
  246. })
  247. ;
  248. }
  249. },
  250. display: function() {
  251. var
  252. style = module.get.style(),
  253. displayType = module.get.displayType(),
  254. overrideStyle = style + 'display: ' + displayType + ' !important;'
  255. ;
  256. $module.css('display', '');
  257. module.refresh();
  258. if( $module.css('display') !== displayType ) {
  259. module.verbose('Setting inline visibility to', displayType);
  260. $module
  261. .attr('style', overrideStyle)
  262. ;
  263. }
  264. },
  265. direction: function() {
  266. if($module.is(':visible') && !module.is.hidden()) {
  267. module.debug('Automatically determining the direction of animation', 'Outward');
  268. $module
  269. .removeClass(className.inward)
  270. .addClass(className.outward)
  271. ;
  272. }
  273. else {
  274. module.debug('Automatically determining the direction of animation', 'Inward');
  275. $module
  276. .removeClass(className.outward)
  277. .addClass(className.inward)
  278. ;
  279. }
  280. },
  281. looping: function() {
  282. module.debug('Transition set to loop');
  283. $module
  284. .addClass(className.looping)
  285. ;
  286. },
  287. hidden: function() {
  288. if(!module.is.hidden()) {
  289. $module
  290. .addClass(className.transition)
  291. .addClass(className.hidden)
  292. ;
  293. if($module.css('display') !== 'none') {
  294. module.verbose('Overriding default display to hide element');
  295. $module
  296. .css('display', 'none')
  297. ;
  298. }
  299. }
  300. },
  301. visible: function() {
  302. $module
  303. .addClass(className.transition)
  304. .addClass(className.visible)
  305. ;
  306. }
  307. },
  308. save: {
  309. displayType: function(displayType) {
  310. $module.data(metadata.displayType, displayType);
  311. },
  312. transitionExists: function(animation, exists) {
  313. $.fn.transition.exists[animation] = exists;
  314. module.verbose('Saving existence of transition', animation, exists);
  315. },
  316. conditions: function() {
  317. var
  318. clasName = $module.attr('class') || false,
  319. style = $module.attr('style') || ''
  320. ;
  321. $module.removeClass(settings.animation);
  322. module.remove.direction();
  323. module.cache = {
  324. className : $module.attr('class'),
  325. style : module.get.style()
  326. };
  327. module.verbose('Saving original attributes', module.cache);
  328. }
  329. },
  330. restore: {
  331. conditions: function() {
  332. if(module.cache === undefined) {
  333. return false;
  334. }
  335. if(module.cache.className) {
  336. $module.attr('class', module.cache.className);
  337. }
  338. else {
  339. $module.removeAttr('class');
  340. }
  341. if(module.cache.style) {
  342. module.verbose('Restoring original style attribute', module.cache.style);
  343. $module.attr('style', module.cache.style);
  344. }
  345. if(module.is.looping()) {
  346. module.remove.looping();
  347. }
  348. module.verbose('Restoring original attributes', module.cache);
  349. }
  350. },
  351. add: {
  352. failSafe: function() {
  353. var
  354. duration = module.get.duration()
  355. ;
  356. module.timer = setTimeout(module.complete, duration + 100);
  357. module.verbose('Adding fail safe timer', module.timer);
  358. }
  359. },
  360. remove: {
  361. animating: function() {
  362. $module.removeClass(className.animating);
  363. },
  364. animation: function() {
  365. $module
  366. .css({
  367. '-webkit-animation' : '',
  368. '-moz-animation' : '',
  369. '-ms-animation' : '',
  370. '-o-animation' : '',
  371. 'animation' : ''
  372. })
  373. ;
  374. },
  375. animationEndCallback: function() {
  376. $module.off('.complete');
  377. },
  378. display: function() {
  379. $module.css('display', '');
  380. },
  381. direction: function() {
  382. $module
  383. .removeClass(className.inward)
  384. .removeClass(className.outward)
  385. ;
  386. },
  387. failSafe: function() {
  388. module.verbose('Removing fail safe timer', module.timer);
  389. if(module.timer) {
  390. clearTimeout(module.timer);
  391. }
  392. },
  393. hidden: function() {
  394. $module.removeClass(className.hidden);
  395. },
  396. visible: function() {
  397. $module.removeClass(className.visible);
  398. },
  399. looping: function() {
  400. module.debug('Transitions are no longer looping');
  401. $module
  402. .removeClass(className.looping)
  403. ;
  404. module.forceRepaint();
  405. },
  406. transition: function() {
  407. $module
  408. .removeClass(className.visible)
  409. .removeClass(className.hidden)
  410. ;
  411. }
  412. },
  413. get: {
  414. settings: function(animation, duration, onComplete) {
  415. // single settings object
  416. if(typeof animation == 'object') {
  417. return $.extend(true, {}, $.fn.transition.settings, animation);
  418. }
  419. // all arguments provided
  420. else if(typeof onComplete == 'function') {
  421. return $.extend({}, $.fn.transition.settings, {
  422. animation : animation,
  423. onComplete : onComplete,
  424. duration : duration
  425. });
  426. }
  427. // only duration provided
  428. else if(typeof duration == 'string' || typeof duration == 'number') {
  429. return $.extend({}, $.fn.transition.settings, {
  430. animation : animation,
  431. duration : duration
  432. });
  433. }
  434. // duration is actually settings object
  435. else if(typeof duration == 'object') {
  436. return $.extend({}, $.fn.transition.settings, duration, {
  437. animation : animation
  438. });
  439. }
  440. // duration is actually callback
  441. else if(typeof duration == 'function') {
  442. return $.extend({}, $.fn.transition.settings, {
  443. animation : animation,
  444. onComplete : duration
  445. });
  446. }
  447. // only animation provided
  448. else {
  449. return $.extend({}, $.fn.transition.settings, {
  450. animation : animation
  451. });
  452. }
  453. return $.fn.transition.settings;
  454. },
  455. duration: function(duration) {
  456. duration = duration || settings.duration;
  457. if(duration === false) {
  458. duration = $module.css('animation-duration') || 0;
  459. }
  460. return (typeof duration === 'string')
  461. ? (duration.indexOf('ms') > -1)
  462. ? parseFloat(duration)
  463. : parseFloat(duration) * 1000
  464. : duration
  465. ;
  466. },
  467. displayType: function() {
  468. if(settings.displayType) {
  469. return settings.displayType;
  470. }
  471. if($module.data(metadata.displayType) === undefined) {
  472. // create fake element to determine display state
  473. module.can.transition(true);
  474. }
  475. return $module.data(metadata.displayType);
  476. },
  477. style: function() {
  478. var
  479. style = $module.attr('style') || ''
  480. ;
  481. return style.replace(/display.*?;/, '');
  482. },
  483. transitionExists: function(animation) {
  484. return $.fn.transition.exists[animation];
  485. },
  486. animationName: function() {
  487. var
  488. element = document.createElement('div'),
  489. animations = {
  490. 'animation' :'animationName',
  491. 'OAnimation' :'oAnimationName',
  492. 'MozAnimation' :'mozAnimationName',
  493. 'WebkitAnimation' :'webkitAnimationName'
  494. },
  495. animation
  496. ;
  497. for(animation in animations){
  498. if( element.style[animation] !== undefined ){
  499. return animations[animation];
  500. }
  501. }
  502. return false;
  503. },
  504. animationStartEvent: function() {
  505. var
  506. element = document.createElement('div'),
  507. animations = {
  508. 'animation' :'animationstart',
  509. 'OAnimation' :'oAnimationStart',
  510. 'MozAnimation' :'mozAnimationStart',
  511. 'WebkitAnimation' :'webkitAnimationStart'
  512. },
  513. animation
  514. ;
  515. for(animation in animations){
  516. if( element.style[animation] !== undefined ){
  517. return animations[animation];
  518. }
  519. }
  520. return false;
  521. },
  522. animationEndEvent: function() {
  523. var
  524. element = document.createElement('div'),
  525. animations = {
  526. 'animation' :'animationend',
  527. 'OAnimation' :'oAnimationEnd',
  528. 'MozAnimation' :'mozAnimationEnd',
  529. 'WebkitAnimation' :'webkitAnimationEnd'
  530. },
  531. animation
  532. ;
  533. for(animation in animations){
  534. if( element.style[animation] !== undefined ){
  535. return animations[animation];
  536. }
  537. }
  538. return false;
  539. }
  540. },
  541. can: {
  542. transition: function(forced) {
  543. var
  544. elementClass = $module.attr('class'),
  545. tagName = $module.prop('tagName'),
  546. animation = settings.animation,
  547. transitionExists = module.get.transitionExists(animation),
  548. $clone,
  549. currentAnimation,
  550. inAnimation,
  551. directionExists,
  552. displayType
  553. ;
  554. if( transitionExists === undefined || forced) {
  555. module.verbose('Determining whether animation exists');
  556. $clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
  557. currentAnimation = $clone
  558. .addClass(animation)
  559. .removeClass(className.inward)
  560. .removeClass(className.outward)
  561. .addClass(className.animating)
  562. .addClass(className.transition)
  563. .css(animationName)
  564. ;
  565. inAnimation = $clone
  566. .addClass(className.inward)
  567. .css(animationName)
  568. ;
  569. displayType = $clone
  570. .attr('class', elementClass)
  571. .removeAttr('style')
  572. .removeClass(className.hidden)
  573. .removeClass(className.visible)
  574. .show()
  575. .css('display')
  576. ;
  577. module.verbose('Determining final display state', displayType);
  578. $clone.remove();
  579. if(currentAnimation != inAnimation) {
  580. module.debug('Direction exists for animation', animation);
  581. directionExists = true;
  582. }
  583. else if(currentAnimation == 'none' || !currentAnimation) {
  584. module.debug('No animation defined in css', animation);
  585. return;
  586. }
  587. else {
  588. module.debug('Static animation found', animation, displayType);
  589. directionExists = false;
  590. }
  591. module.save.displayType(displayType);
  592. module.save.transitionExists(animation, directionExists);
  593. }
  594. return (transitionExists !== undefined)
  595. ? transitionExists
  596. : directionExists
  597. ;
  598. },
  599. animate: function() {
  600. // can transition does not return a value if animation does not exist
  601. return (module.can.transition() !== undefined);
  602. }
  603. },
  604. is: {
  605. animating: function() {
  606. return $module.hasClass(className.animating);
  607. },
  608. inward: function() {
  609. return $module.hasClass(className.inward);
  610. },
  611. outward: function() {
  612. return $module.hasClass(className.outward);
  613. },
  614. looping: function() {
  615. return $module.hasClass(className.looping);
  616. },
  617. occurring: function(animation) {
  618. animation = animation || settings.animation;
  619. animation = '.' + animation.replace(' ', '.');
  620. return ( $module.filter(animation).length > 0 );
  621. },
  622. visible: function() {
  623. return $module.is(':visible');
  624. },
  625. hidden: function() {
  626. return $module.css('visibility') === 'hidden';
  627. },
  628. supported: function() {
  629. return(animationName !== false && animationEnd !== false);
  630. }
  631. },
  632. hide: function() {
  633. module.verbose('Hiding element');
  634. if( module.is.animating() ) {
  635. module.reset();
  636. }
  637. module.remove.display();
  638. module.remove.visible();
  639. module.set.hidden();
  640. module.repaint();
  641. },
  642. show: function(display) {
  643. module.verbose('Showing element', display);
  644. module.remove.hidden();
  645. module.set.visible();
  646. module.repaint();
  647. },
  648. start: function() {
  649. module.verbose('Starting animation');
  650. $module.removeClass(className.disabled);
  651. },
  652. stop: function() {
  653. module.debug('Stopping animation');
  654. $module.addClass(className.disabled);
  655. },
  656. toggle: function() {
  657. module.debug('Toggling play status');
  658. $module.toggleClass(className.disabled);
  659. },
  660. setting: function(name, value) {
  661. module.debug('Changing setting', name, value);
  662. if( $.isPlainObject(name) ) {
  663. $.extend(true, settings, name);
  664. }
  665. else if(value !== undefined) {
  666. settings[name] = value;
  667. }
  668. else {
  669. return settings[name];
  670. }
  671. },
  672. internal: function(name, value) {
  673. if( $.isPlainObject(name) ) {
  674. $.extend(true, module, name);
  675. }
  676. else if(value !== undefined) {
  677. module[name] = value;
  678. }
  679. else {
  680. return module[name];
  681. }
  682. },
  683. debug: function() {
  684. if(settings.debug) {
  685. if(settings.performance) {
  686. module.performance.log(arguments);
  687. }
  688. else {
  689. module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
  690. module.debug.apply(console, arguments);
  691. }
  692. }
  693. },
  694. verbose: function() {
  695. if(settings.verbose && settings.debug) {
  696. if(settings.performance) {
  697. module.performance.log(arguments);
  698. }
  699. else {
  700. module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
  701. module.verbose.apply(console, arguments);
  702. }
  703. }
  704. },
  705. error: function() {
  706. module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
  707. module.error.apply(console, arguments);
  708. },
  709. performance: {
  710. log: function(message) {
  711. var
  712. currentTime,
  713. executionTime,
  714. previousTime
  715. ;
  716. if(settings.performance) {
  717. currentTime = new Date().getTime();
  718. previousTime = time || currentTime;
  719. executionTime = currentTime - previousTime;
  720. time = currentTime;
  721. performance.push({
  722. 'Name' : message[0],
  723. 'Arguments' : [].slice.call(message, 1) || '',
  724. 'Element' : element,
  725. 'Execution Time' : executionTime
  726. });
  727. }
  728. clearTimeout(module.performance.timer);
  729. module.performance.timer = setTimeout(module.performance.display, 600);
  730. },
  731. display: function() {
  732. var
  733. title = settings.name + ':',
  734. totalTime = 0
  735. ;
  736. time = false;
  737. clearTimeout(module.performance.timer);
  738. $.each(performance, function(index, data) {
  739. totalTime += data['Execution Time'];
  740. });
  741. title += ' ' + totalTime + 'ms';
  742. if(moduleSelector) {
  743. title += ' \'' + moduleSelector + '\'';
  744. }
  745. if($allModules.length > 1) {
  746. title += ' ' + '(' + $allModules.length + ')';
  747. }
  748. if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
  749. console.groupCollapsed(title);
  750. if(console.table) {
  751. console.table(performance);
  752. }
  753. else {
  754. $.each(performance, function(index, data) {
  755. console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
  756. });
  757. }
  758. console.groupEnd();
  759. }
  760. performance = [];
  761. }
  762. },
  763. // modified for transition to return invoke success
  764. invoke: function(query, passedArguments, context) {
  765. var
  766. object = instance,
  767. maxDepth,
  768. found,
  769. response
  770. ;
  771. passedArguments = passedArguments || queryArguments;
  772. context = element || context;
  773. if(typeof query == 'string' && object !== undefined) {
  774. query = query.split(/[\. ]/);
  775. maxDepth = query.length - 1;
  776. $.each(query, function(depth, value) {
  777. var camelCaseValue = (depth != maxDepth)
  778. ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
  779. : query
  780. ;
  781. if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
  782. object = object[camelCaseValue];
  783. }
  784. else if( object[camelCaseValue] !== undefined ) {
  785. found = object[camelCaseValue];
  786. return false;
  787. }
  788. else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
  789. object = object[value];
  790. }
  791. else if( object[value] !== undefined ) {
  792. found = object[value];
  793. return false;
  794. }
  795. else {
  796. return false;
  797. }
  798. });
  799. }
  800. if ( $.isFunction( found ) ) {
  801. response = found.apply(context, passedArguments);
  802. }
  803. else if(found !== undefined) {
  804. response = found;
  805. }
  806. if($.isArray(returnedValue)) {
  807. returnedValue.push(response);
  808. }
  809. else if(returnedValue !== undefined) {
  810. returnedValue = [returnedValue, response];
  811. }
  812. else if(response !== undefined) {
  813. returnedValue = response;
  814. }
  815. return (found !== undefined)
  816. ? found
  817. : false
  818. ;
  819. }
  820. };
  821. module.initialize();
  822. })
  823. ;
  824. return (returnedValue !== undefined)
  825. ? returnedValue
  826. : this
  827. ;
  828. };
  829. // Records if CSS transition is available
  830. $.fn.transition.exists = {};
  831. $.fn.transition.settings = {
  832. // module info
  833. name : 'Transition',
  834. // debug content outputted to console
  835. debug : false,
  836. // verbose debug output
  837. verbose : true,
  838. // performance data output
  839. performance : true,
  840. // event namespace
  841. namespace : 'transition',
  842. // animation complete event
  843. onStart : function() {},
  844. onComplete : function() {},
  845. onShow : function() {},
  846. onHide : function() {},
  847. // whether timeout should be used to ensure callback fires in cases animationend does not
  848. useFailSafe : true,
  849. // whether EXACT animation can occur twice in a row
  850. allowRepeats : false,
  851. // Override final display type on visible
  852. displayType : false,
  853. // animation duration
  854. animation : 'fade',
  855. duration : false,
  856. // new animations will occur after previous ones
  857. queue : true,
  858. metadata : {
  859. displayType: 'display'
  860. },
  861. className : {
  862. animating : 'animating',
  863. disabled : 'disabled',
  864. hidden : 'hidden',
  865. inward : 'in',
  866. loading : 'loading',
  867. looping : 'looping',
  868. outward : 'out',
  869. transition : 'transition',
  870. visible : 'visible'
  871. },
  872. // possible errors
  873. error: {
  874. noAnimation : 'There is no css animation matching the one you specified.',
  875. repeated : 'That animation is already occurring, cancelling repeated animation',
  876. method : 'The method you called is not defined',
  877. support : 'This browser does not support CSS animations'
  878. }
  879. };
  880. })( jQuery, window , document );