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.

901 lines
27 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
10 years ago
9 years ago
10 years ago
10 years ago
9 years ago
9 years ago
10 years ago
9 years ago
10 years ago
9 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
9 years ago
10 years ago
9 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
10 years ago
10 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
9 years ago
9 years ago
9 years ago
9 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
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
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
9 years ago
10 years ago
9 years ago
10 years ago
10 years ago
9 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
  1. /*!
  2. * # Semantic UI 2.0.0 - Modal
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2015 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.modal = function(parameters) {
  14. var
  15. $allModules = $(this),
  16. $window = $(window),
  17. $document = $(document),
  18. $body = $('body'),
  19. moduleSelector = $allModules.selector || '',
  20. time = new Date().getTime(),
  21. performance = [],
  22. query = arguments[0],
  23. methodInvoked = (typeof query == 'string'),
  24. queryArguments = [].slice.call(arguments, 1),
  25. requestAnimationFrame = window.requestAnimationFrame
  26. || window.mozRequestAnimationFrame
  27. || window.webkitRequestAnimationFrame
  28. || window.msRequestAnimationFrame
  29. || function(callback) { setTimeout(callback, 0); },
  30. returnedValue
  31. ;
  32. $allModules
  33. .each(function() {
  34. var
  35. settings = ( $.isPlainObject(parameters) )
  36. ? $.extend(true, {}, $.fn.modal.settings, parameters)
  37. : $.extend({}, $.fn.modal.settings),
  38. selector = settings.selector,
  39. className = settings.className,
  40. namespace = settings.namespace,
  41. error = settings.error,
  42. eventNamespace = '.' + namespace,
  43. moduleNamespace = 'module-' + namespace,
  44. $module = $(this),
  45. $context = $(settings.context),
  46. $close = $module.find(selector.close),
  47. $allModals,
  48. $otherModals,
  49. $focusedElement,
  50. $dimmable,
  51. $dimmer,
  52. element = this,
  53. instance = $module.data(moduleNamespace),
  54. elementNamespace,
  55. id,
  56. observer,
  57. module
  58. ;
  59. module = {
  60. initialize: function() {
  61. module.verbose('Initializing dimmer', $context);
  62. module.create.id();
  63. module.create.dimmer();
  64. module.refreshModals();
  65. module.bind.events();
  66. if(settings.observeChanges) {
  67. module.observeChanges();
  68. }
  69. module.instantiate();
  70. },
  71. instantiate: function() {
  72. module.verbose('Storing instance of modal');
  73. instance = module;
  74. $module
  75. .data(moduleNamespace, instance)
  76. ;
  77. },
  78. create: {
  79. dimmer: function() {
  80. var
  81. defaultSettings = {
  82. debug : settings.debug,
  83. dimmerName : 'modals',
  84. duration : {
  85. show : settings.duration,
  86. hide : settings.duration
  87. }
  88. },
  89. dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings)
  90. ;
  91. if(settings.inverted) {
  92. dimmerSettings.variation = (dimmerSettings.variation !== undefined)
  93. ? dimmerSettings.variation + ' inverted'
  94. : 'inverted'
  95. ;
  96. }
  97. if($.fn.dimmer === undefined) {
  98. module.error(error.dimmer);
  99. return;
  100. }
  101. module.debug('Creating dimmer with settings', dimmerSettings);
  102. $dimmable = $context.dimmer(dimmerSettings);
  103. if(settings.detachable) {
  104. module.verbose('Modal is detachable, moving content into dimmer');
  105. $dimmable.dimmer('add content', $module);
  106. }
  107. else {
  108. module.set.undetached();
  109. }
  110. if(settings.blurring) {
  111. $dimmable.addClass(className.blurring);
  112. }
  113. $dimmer = $dimmable.dimmer('get dimmer');
  114. },
  115. id: function() {
  116. id = (Math.random().toString(16) + '000000000').substr(2,8);
  117. elementNamespace = '.' + id;
  118. module.verbose('Creating unique id for element', id);
  119. }
  120. },
  121. destroy: function() {
  122. module.verbose('Destroying previous modal');
  123. $module
  124. .removeData(moduleNamespace)
  125. .off(eventNamespace)
  126. ;
  127. $window.off(elementNamespace);
  128. $close.off(eventNamespace);
  129. $context.dimmer('destroy');
  130. },
  131. observeChanges: function() {
  132. if('MutationObserver' in window) {
  133. observer = new MutationObserver(function(mutations) {
  134. module.debug('DOM tree modified, refreshing');
  135. module.refresh();
  136. });
  137. observer.observe(element, {
  138. childList : true,
  139. subtree : true
  140. });
  141. module.debug('Setting up mutation observer', observer);
  142. }
  143. },
  144. refresh: function() {
  145. module.remove.scrolling();
  146. module.cacheSizes();
  147. module.set.screenHeight();
  148. module.set.type();
  149. module.set.position();
  150. },
  151. refreshModals: function() {
  152. $otherModals = $module.siblings(selector.modal);
  153. $allModals = $otherModals.add($module);
  154. },
  155. attachEvents: function(selector, event) {
  156. var
  157. $toggle = $(selector)
  158. ;
  159. event = $.isFunction(module[event])
  160. ? module[event]
  161. : module.toggle
  162. ;
  163. if($toggle.length > 0) {
  164. module.debug('Attaching modal events to element', selector, event);
  165. $toggle
  166. .off(eventNamespace)
  167. .on('click' + eventNamespace, event)
  168. ;
  169. }
  170. else {
  171. module.error(error.notFound, selector);
  172. }
  173. },
  174. bind: {
  175. events: function() {
  176. module.verbose('Attaching events');
  177. $module
  178. .on('click' + eventNamespace, selector.close, module.event.close)
  179. .on('click' + eventNamespace, selector.approve, module.event.approve)
  180. .on('click' + eventNamespace, selector.deny, module.event.deny)
  181. ;
  182. $window
  183. .on('resize' + elementNamespace, module.event.resize)
  184. ;
  185. }
  186. },
  187. get: {
  188. id: function() {
  189. return (Math.random().toString(16) + '000000000').substr(2,8);
  190. }
  191. },
  192. event: {
  193. approve: function() {
  194. if(settings.onApprove.call(element, $(this)) === false) {
  195. module.verbose('Approve callback returned false cancelling hide');
  196. return;
  197. }
  198. module.hide();
  199. },
  200. deny: function() {
  201. if(settings.onDeny.call(element, $(this)) === false) {
  202. module.verbose('Deny callback returned false cancelling hide');
  203. return;
  204. }
  205. module.hide();
  206. },
  207. close: function() {
  208. module.hide();
  209. },
  210. click: function(event) {
  211. var
  212. $target = $(event.target),
  213. isInModal = ($target.closest(selector.modal).length > 0),
  214. isInDOM = $.contains(document.documentElement, event.target)
  215. ;
  216. if(!isInModal && isInDOM) {
  217. module.debug('Dimmer clicked, hiding all modals');
  218. if( module.is.active() ) {
  219. module.remove.clickaway();
  220. if(settings.allowMultiple) {
  221. module.hide();
  222. }
  223. else {
  224. module.hideAll();
  225. }
  226. }
  227. }
  228. },
  229. debounce: function(method, delay) {
  230. clearTimeout(module.timer);
  231. module.timer = setTimeout(method, delay);
  232. },
  233. keyboard: function(event) {
  234. var
  235. keyCode = event.which,
  236. escapeKey = 27
  237. ;
  238. if(keyCode == escapeKey) {
  239. if(settings.closable) {
  240. module.debug('Escape key pressed hiding modal');
  241. module.hide();
  242. }
  243. else {
  244. module.debug('Escape key pressed, but closable is set to false');
  245. }
  246. event.preventDefault();
  247. }
  248. },
  249. resize: function() {
  250. if( $dimmable.dimmer('is active') ) {
  251. requestAnimationFrame(module.refresh);
  252. }
  253. }
  254. },
  255. toggle: function() {
  256. if( module.is.active() || module.is.animating() ) {
  257. module.hide();
  258. }
  259. else {
  260. module.show();
  261. }
  262. },
  263. show: function(callback) {
  264. callback = $.isFunction(callback)
  265. ? callback
  266. : function(){}
  267. ;
  268. module.refreshModals();
  269. module.showModal(callback);
  270. },
  271. hide: function(callback) {
  272. callback = $.isFunction(callback)
  273. ? callback
  274. : function(){}
  275. ;
  276. module.refreshModals();
  277. module.hideModal(callback);
  278. },
  279. showModal: function(callback) {
  280. callback = $.isFunction(callback)
  281. ? callback
  282. : function(){}
  283. ;
  284. if( module.is.animating() || !module.is.active() ) {
  285. module.showDimmer();
  286. module.cacheSizes();
  287. module.set.position();
  288. module.set.screenHeight();
  289. module.set.type();
  290. module.set.clickaway();
  291. if( !settings.allowMultiple && $otherModals.filter('.' + className.active).length > 0) {
  292. module.debug('Other modals visible, queueing show animation');
  293. module.hideOthers(module.showModal);
  294. }
  295. else {
  296. settings.onShow.call(element);
  297. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  298. module.debug('Showing modal with css animations');
  299. $module
  300. .transition({
  301. debug : settings.debug,
  302. animation : settings.transition + ' in',
  303. queue : settings.queue,
  304. duration : settings.duration,
  305. useFailSafe : true,
  306. onComplete : function() {
  307. settings.onVisible.apply(element);
  308. module.add.keyboardShortcuts();
  309. module.save.focus();
  310. module.set.active();
  311. module.set.autofocus();
  312. callback();
  313. }
  314. })
  315. ;
  316. }
  317. else {
  318. module.debug('Showing modal with javascript');
  319. $module
  320. .fadeIn(settings.duration, settings.easing, function() {
  321. settings.onVisible.apply(element);
  322. module.add.keyboardShortcuts();
  323. module.save.focus();
  324. module.set.active();
  325. callback();
  326. })
  327. ;
  328. }
  329. }
  330. }
  331. else {
  332. module.debug('Modal is already visible');
  333. }
  334. },
  335. hideModal: function(callback, keepDimmed) {
  336. callback = $.isFunction(callback)
  337. ? callback
  338. : function(){}
  339. ;
  340. module.debug('Hiding modal');
  341. settings.onHide.call(element);
  342. if( module.is.animating() || module.is.active() ) {
  343. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  344. module.remove.active();
  345. $module
  346. .transition({
  347. debug : settings.debug,
  348. animation : settings.transition + ' out',
  349. queue : settings.queue,
  350. duration : settings.duration,
  351. useFailSafe : true,
  352. onStart : function() {
  353. if(!module.othersActive() && !keepDimmed) {
  354. module.hideDimmer();
  355. }
  356. module.remove.keyboardShortcuts();
  357. },
  358. onComplete : function() {
  359. settings.onHidden.call(element);
  360. module.restore.focus();
  361. callback();
  362. }
  363. })
  364. ;
  365. }
  366. else {
  367. module.remove.active();
  368. if( !module.othersActive() ) {
  369. module.hideDimmer();
  370. }
  371. module.remove.keyboardShortcuts();
  372. $module
  373. .fadeOut(settings.duration, settings.easing, function() {
  374. settings.onHidden.call(element);
  375. module.restore.focus();
  376. callback();
  377. })
  378. ;
  379. }
  380. }
  381. },
  382. showDimmer: function() {
  383. if($dimmable.dimmer('is animating') || !$dimmable.dimmer('is active') ) {
  384. module.debug('Showing dimmer');
  385. $dimmable.dimmer('show');
  386. }
  387. else {
  388. module.debug('Dimmer already visible');
  389. }
  390. },
  391. hideDimmer: function() {
  392. if( $dimmable.dimmer('is animating') || ($dimmable.dimmer('is active')) ) {
  393. $dimmable.dimmer('hide', function() {
  394. if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
  395. module.remove.clickaway();
  396. module.remove.screenHeight();
  397. }
  398. });
  399. }
  400. else {
  401. module.debug('Dimmer is not visible cannot hide');
  402. return;
  403. }
  404. },
  405. hideAll: function(callback) {
  406. var
  407. $visibleModals = $allModals.filter(':visible')
  408. ;
  409. callback = $.isFunction(callback)
  410. ? callback
  411. : function(){}
  412. ;
  413. if( $visibleModals.length > 0 ) {
  414. module.debug('Hiding all visible modals');
  415. module.hideDimmer();
  416. $visibleModals
  417. .modal('hide modal', callback)
  418. ;
  419. }
  420. },
  421. hideOthers: function(callback) {
  422. var
  423. $visibleModals = $otherModals.filter(':visible')
  424. ;
  425. callback = $.isFunction(callback)
  426. ? callback
  427. : function(){}
  428. ;
  429. if( $visibleModals.length > 0 ) {
  430. module.debug('Hiding other modals', $otherModals);
  431. $visibleModals
  432. .modal('hide modal', callback, true)
  433. ;
  434. }
  435. },
  436. othersActive: function() {
  437. return ($otherModals.filter('.' + className.active + ', .' + className.animating).length > 0);
  438. },
  439. add: {
  440. keyboardShortcuts: function() {
  441. module.verbose('Adding keyboard shortcuts');
  442. $document
  443. .on('keyup' + eventNamespace, module.event.keyboard)
  444. ;
  445. }
  446. },
  447. save: {
  448. focus: function() {
  449. $focusedElement = $(document.activeElement).blur();
  450. }
  451. },
  452. restore: {
  453. focus: function() {
  454. if($focusedElement && $focusedElement.length > 0) {
  455. $focusedElement.focus();
  456. }
  457. }
  458. },
  459. remove: {
  460. active: function() {
  461. $module.removeClass(className.active);
  462. },
  463. clickaway: function() {
  464. if(settings.closable) {
  465. $dimmer
  466. .off('click' + elementNamespace)
  467. ;
  468. }
  469. },
  470. screenHeight: function() {
  471. if(module.cache.height > module.cache.pageHeight) {
  472. module.debug('Removing page height');
  473. $body
  474. .css('height', '')
  475. ;
  476. }
  477. },
  478. keyboardShortcuts: function() {
  479. module.verbose('Removing keyboard shortcuts');
  480. $document
  481. .off('keyup' + eventNamespace)
  482. ;
  483. },
  484. scrolling: function() {
  485. $dimmable.removeClass(className.scrolling);
  486. $module.removeClass(className.scrolling);
  487. }
  488. },
  489. cacheSizes: function() {
  490. var
  491. modalHeight = $module.outerHeight()
  492. ;
  493. if(module.cache === undefined || modalHeight !== 0) {
  494. module.cache = {
  495. pageHeight : $(document).outerHeight(),
  496. height : modalHeight + settings.offset,
  497. contextHeight : (settings.context == 'body')
  498. ? $(window).height()
  499. : $dimmable.height()
  500. };
  501. }
  502. module.debug('Caching modal and container sizes', module.cache);
  503. },
  504. can: {
  505. fit: function() {
  506. return ( ( module.cache.height + (settings.padding * 2) ) < module.cache.contextHeight);
  507. }
  508. },
  509. is: {
  510. active: function() {
  511. return $module.hasClass(className.active);
  512. },
  513. animating: function() {
  514. return $module.transition('is supported')
  515. ? $module.transition('is animating')
  516. : $module.is(':visible')
  517. ;
  518. },
  519. scrolling: function() {
  520. return $dimmable.hasClass(className.scrolling);
  521. },
  522. modernBrowser: function() {
  523. // appName for IE11 reports 'Netscape' can no longer use
  524. return !(window.ActiveXObject || "ActiveXObject" in window);
  525. }
  526. },
  527. set: {
  528. autofocus: function() {
  529. if(settings.autofocus) {
  530. var
  531. $inputs = $module.find(':input:visible'),
  532. $autofocus = $inputs.filter('[autofocus]'),
  533. $input = ($autofocus.length > 0)
  534. ? $autofocus
  535. : $inputs
  536. ;
  537. $input.first().focus();
  538. }
  539. },
  540. clickaway: function() {
  541. if(settings.closable) {
  542. $dimmer
  543. .on('click' + elementNamespace, module.event.click)
  544. ;
  545. }
  546. },
  547. screenHeight: function() {
  548. if( module.can.fit() ) {
  549. $body.css('height', '');
  550. }
  551. else {
  552. module.debug('Modal is taller than page content, resizing page height');
  553. $body
  554. .css('height', module.cache.height + (settings.padding * 2) )
  555. ;
  556. }
  557. },
  558. active: function() {
  559. $module.addClass(className.active);
  560. },
  561. scrolling: function() {
  562. $dimmable.addClass(className.scrolling);
  563. $module.addClass(className.scrolling);
  564. },
  565. type: function() {
  566. if(module.can.fit()) {
  567. module.verbose('Modal fits on screen');
  568. if(!module.othersActive()) {
  569. module.remove.scrolling();
  570. }
  571. }
  572. else {
  573. module.verbose('Modal cannot fit on screen setting to scrolling');
  574. module.set.scrolling();
  575. }
  576. },
  577. position: function() {
  578. module.verbose('Centering modal on page', module.cache);
  579. if(module.can.fit()) {
  580. $module
  581. .css({
  582. top: '',
  583. marginTop: -(module.cache.height / 2)
  584. })
  585. ;
  586. }
  587. else {
  588. $module
  589. .css({
  590. marginTop : '',
  591. top : $document.scrollTop()
  592. })
  593. ;
  594. }
  595. },
  596. undetached: function() {
  597. $dimmable.addClass(className.undetached);
  598. }
  599. },
  600. setting: function(name, value) {
  601. module.debug('Changing setting', name, value);
  602. if( $.isPlainObject(name) ) {
  603. $.extend(true, settings, name);
  604. }
  605. else if(value !== undefined) {
  606. settings[name] = value;
  607. }
  608. else {
  609. return settings[name];
  610. }
  611. },
  612. internal: function(name, value) {
  613. if( $.isPlainObject(name) ) {
  614. $.extend(true, module, name);
  615. }
  616. else if(value !== undefined) {
  617. module[name] = value;
  618. }
  619. else {
  620. return module[name];
  621. }
  622. },
  623. debug: function() {
  624. if(settings.debug) {
  625. if(settings.performance) {
  626. module.performance.log(arguments);
  627. }
  628. else {
  629. module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
  630. module.debug.apply(console, arguments);
  631. }
  632. }
  633. },
  634. verbose: function() {
  635. if(settings.verbose && settings.debug) {
  636. if(settings.performance) {
  637. module.performance.log(arguments);
  638. }
  639. else {
  640. module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
  641. module.verbose.apply(console, arguments);
  642. }
  643. }
  644. },
  645. error: function() {
  646. module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
  647. module.error.apply(console, arguments);
  648. },
  649. performance: {
  650. log: function(message) {
  651. var
  652. currentTime,
  653. executionTime,
  654. previousTime
  655. ;
  656. if(settings.performance) {
  657. currentTime = new Date().getTime();
  658. previousTime = time || currentTime;
  659. executionTime = currentTime - previousTime;
  660. time = currentTime;
  661. performance.push({
  662. 'Name' : message[0],
  663. 'Arguments' : [].slice.call(message, 1) || '',
  664. 'Element' : element,
  665. 'Execution Time' : executionTime
  666. });
  667. }
  668. clearTimeout(module.performance.timer);
  669. module.performance.timer = setTimeout(module.performance.display, 500);
  670. },
  671. display: function() {
  672. var
  673. title = settings.name + ':',
  674. totalTime = 0
  675. ;
  676. time = false;
  677. clearTimeout(module.performance.timer);
  678. $.each(performance, function(index, data) {
  679. totalTime += data['Execution Time'];
  680. });
  681. title += ' ' + totalTime + 'ms';
  682. if(moduleSelector) {
  683. title += ' \'' + moduleSelector + '\'';
  684. }
  685. if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
  686. console.groupCollapsed(title);
  687. if(console.table) {
  688. console.table(performance);
  689. }
  690. else {
  691. $.each(performance, function(index, data) {
  692. console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
  693. });
  694. }
  695. console.groupEnd();
  696. }
  697. performance = [];
  698. }
  699. },
  700. invoke: function(query, passedArguments, context) {
  701. var
  702. object = instance,
  703. maxDepth,
  704. found,
  705. response
  706. ;
  707. passedArguments = passedArguments || queryArguments;
  708. context = element || context;
  709. if(typeof query == 'string' && object !== undefined) {
  710. query = query.split(/[\. ]/);
  711. maxDepth = query.length - 1;
  712. $.each(query, function(depth, value) {
  713. var camelCaseValue = (depth != maxDepth)
  714. ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
  715. : query
  716. ;
  717. if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
  718. object = object[camelCaseValue];
  719. }
  720. else if( object[camelCaseValue] !== undefined ) {
  721. found = object[camelCaseValue];
  722. return false;
  723. }
  724. else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
  725. object = object[value];
  726. }
  727. else if( object[value] !== undefined ) {
  728. found = object[value];
  729. return false;
  730. }
  731. else {
  732. return false;
  733. }
  734. });
  735. }
  736. if ( $.isFunction( found ) ) {
  737. response = found.apply(context, passedArguments);
  738. }
  739. else if(found !== undefined) {
  740. response = found;
  741. }
  742. if($.isArray(returnedValue)) {
  743. returnedValue.push(response);
  744. }
  745. else if(returnedValue !== undefined) {
  746. returnedValue = [returnedValue, response];
  747. }
  748. else if(response !== undefined) {
  749. returnedValue = response;
  750. }
  751. return found;
  752. }
  753. };
  754. if(methodInvoked) {
  755. if(instance === undefined) {
  756. module.initialize();
  757. }
  758. module.invoke(query);
  759. }
  760. else {
  761. if(instance !== undefined) {
  762. instance.invoke('destroy');
  763. }
  764. module.initialize();
  765. }
  766. })
  767. ;
  768. return (returnedValue !== undefined)
  769. ? returnedValue
  770. : this
  771. ;
  772. };
  773. $.fn.modal.settings = {
  774. name : 'Modal',
  775. namespace : 'modal',
  776. debug : false,
  777. verbose : false,
  778. performance : true,
  779. observeChanges : false,
  780. allowMultiple : false,
  781. detachable : true,
  782. closable : true,
  783. autofocus : true,
  784. inverted : false,
  785. blurring : false,
  786. dimmerSettings : {
  787. closable : false,
  788. useCSS : true
  789. },
  790. context : 'body',
  791. queue : false,
  792. duration : 500,
  793. easing : 'easeOutExpo',
  794. offset : 0,
  795. transition : 'scale',
  796. // padding with edge of page
  797. padding : 50,
  798. // called before show animation
  799. onShow : function(){},
  800. // called after show animation
  801. onVisible : function(){},
  802. // called before hide animation
  803. onHide : function(){},
  804. // called after hide animation
  805. onHidden : function(){},
  806. // called after approve selector match
  807. onApprove : function(){ return true; },
  808. // called after deny selector match
  809. onDeny : function(){ return true; },
  810. selector : {
  811. close : '.close',
  812. approve : '.actions .positive, .actions .approve, .actions .ok',
  813. deny : '.actions .negative, .actions .deny, .actions .cancel',
  814. modal : '.ui.modal'
  815. },
  816. error : {
  817. dimmer : 'UI Dimmer, a required component is not included in this page',
  818. method : 'The method you called is not defined.',
  819. notFound : 'The element you specified could not be found'
  820. },
  821. className : {
  822. active : 'active',
  823. animating : 'animating',
  824. blurring : 'blurring',
  825. scrolling : 'scrolling',
  826. undetached : 'undetached'
  827. }
  828. };
  829. })( jQuery, window , document );