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.

801 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
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
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
10 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
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
  1. /*!
  2. * # Semantic UI 1.10.4 - Tab
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributorss
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. ;(function ($, window, document, undefined) {
  12. "use strict";
  13. $.fn.tab = function(parameters) {
  14. var
  15. // use window context if none specified
  16. $allModules = $.isFunction(this)
  17. ? $(window)
  18. : $(this),
  19. settings = ( $.isPlainObject(parameters) )
  20. ? $.extend(true, {}, $.fn.tab.settings, parameters)
  21. : $.extend({}, $.fn.tab.settings),
  22. moduleSelector = $allModules.selector || '',
  23. time = new Date().getTime(),
  24. performance = [],
  25. query = arguments[0],
  26. methodInvoked = (typeof query == 'string'),
  27. queryArguments = [].slice.call(arguments, 1),
  28. module,
  29. returnedValue
  30. ;
  31. $allModules
  32. .each(function() {
  33. var
  34. className = settings.className,
  35. metadata = settings.metadata,
  36. selector = settings.selector,
  37. error = settings.error,
  38. eventNamespace = '.' + settings.namespace,
  39. moduleNamespace = 'module-' + settings.namespace,
  40. $module = $(this),
  41. cache = {},
  42. firstLoad = true,
  43. recursionDepth = 0,
  44. $context,
  45. $tabs,
  46. activeTabPath,
  47. parameterArray,
  48. historyEvent,
  49. element = this,
  50. instance = $module.data(moduleNamespace)
  51. ;
  52. module = {
  53. initialize: function() {
  54. module.debug('Initializing tab menu item', $module);
  55. module.determineTabs();
  56. module.debug('Determining tabs', settings.context, $tabs);
  57. // set up automatic routing
  58. if(settings.auto) {
  59. module.set.auto();
  60. }
  61. // attach events if navigation wasn't set to window
  62. if( !$.isWindow( element ) ) {
  63. module.debug('Attaching tab activation events to element', $module);
  64. $module
  65. .on('click' + eventNamespace, module.event.click)
  66. ;
  67. }
  68. module.instantiate();
  69. },
  70. determineTabs: function() {
  71. var
  72. $reference
  73. ;
  74. // determine tab context
  75. if(settings.context === 'parent') {
  76. if($module.closest(selector.ui).length > 0) {
  77. $reference = $module.closest(selector.ui);
  78. module.verbose('Using closest UI element for determining parent', $reference);
  79. }
  80. else {
  81. $reference = $module;
  82. }
  83. $context = $reference.parent();
  84. module.verbose('Determined parent element for creating context', $context);
  85. }
  86. else if(settings.context) {
  87. $context = $(settings.context);
  88. module.verbose('Using selector for tab context', settings.context, $context);
  89. }
  90. else {
  91. $context = $('body');
  92. }
  93. // find tabs
  94. if(settings.childrenOnly) {
  95. $tabs = $context.children(selector.tabs);
  96. module.debug('Searching tab context children for tabs', $context, $tabs);
  97. }
  98. else {
  99. $tabs = $context.find(selector.tabs);
  100. module.debug('Searching tab context for tabs', $context, $tabs);
  101. }
  102. },
  103. initializeHistory: function() {
  104. if(settings.history) {
  105. module.debug('Initializing page state');
  106. if( $.address === undefined ) {
  107. module.error(error.state);
  108. return false;
  109. }
  110. else {
  111. if(settings.historyType == 'state') {
  112. module.debug('Using HTML5 to manage state');
  113. if(settings.path !== false) {
  114. $.address
  115. .history(true)
  116. .state(settings.path)
  117. ;
  118. }
  119. else {
  120. module.error(error.path);
  121. return false;
  122. }
  123. }
  124. $.address
  125. .bind('change', module.event.history.change)
  126. ;
  127. }
  128. }
  129. },
  130. instantiate: function () {
  131. module.verbose('Storing instance of module', module);
  132. instance = module;
  133. $module
  134. .data(moduleNamespace, module)
  135. ;
  136. },
  137. destroy: function() {
  138. module.debug('Destroying tabs', $module);
  139. $module
  140. .removeData(moduleNamespace)
  141. .off(eventNamespace)
  142. ;
  143. },
  144. event: {
  145. click: function(event) {
  146. var
  147. tabPath = $(this).data(metadata.tab)
  148. ;
  149. if(tabPath !== undefined) {
  150. if(settings.history) {
  151. module.verbose('Updating page state', event);
  152. $.address.value(tabPath);
  153. }
  154. else {
  155. module.verbose('Changing tab', event);
  156. module.changeTab(tabPath);
  157. }
  158. event.preventDefault();
  159. }
  160. else {
  161. module.debug('No tab specified');
  162. }
  163. },
  164. history: {
  165. change: function(event) {
  166. var
  167. tabPath = event.pathNames.join('/') || module.get.initialPath(),
  168. pageTitle = settings.templates.determineTitle(tabPath) || false
  169. ;
  170. module.performance.display();
  171. module.debug('History change event', tabPath, event);
  172. historyEvent = event;
  173. if(tabPath !== undefined) {
  174. module.changeTab(tabPath);
  175. }
  176. if(pageTitle) {
  177. $.address.title(pageTitle);
  178. }
  179. }
  180. }
  181. },
  182. refresh: function() {
  183. if(activeTabPath) {
  184. module.debug('Refreshing tab', activeTabPath);
  185. module.changeTab(activeTabPath);
  186. }
  187. },
  188. cache: {
  189. read: function(cacheKey) {
  190. return (cacheKey !== undefined)
  191. ? cache[cacheKey]
  192. : false
  193. ;
  194. },
  195. add: function(cacheKey, content) {
  196. cacheKey = cacheKey || activeTabPath;
  197. module.debug('Adding cached content for', cacheKey);
  198. cache[cacheKey] = content;
  199. },
  200. remove: function(cacheKey) {
  201. cacheKey = cacheKey || activeTabPath;
  202. module.debug('Removing cached content for', cacheKey);
  203. delete cache[cacheKey];
  204. }
  205. },
  206. set: {
  207. auto: function() {
  208. var
  209. url = (typeof settings.path == 'string')
  210. ? settings.path.replace(/\/$/, '') + '/{$tab}'
  211. : '/{$tab}'
  212. ;
  213. module.verbose('Setting up automatic tab retrieval from server', url);
  214. if($.isPlainObject(settings.apiSettings)) {
  215. settings.apiSettings.url = url;
  216. }
  217. else {
  218. settings.apiSettings = {
  219. url: url
  220. };
  221. }
  222. },
  223. state: function(state) {
  224. $.address.value(state);
  225. }
  226. },
  227. changeTab: function(tabPath) {
  228. var
  229. pushStateAvailable = (window.history && window.history.pushState),
  230. shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
  231. remoteContent = (settings.auto || $.isPlainObject(settings.apiSettings) ),
  232. // only get default path if not remote content
  233. pathArray = (remoteContent && !shouldIgnoreLoad)
  234. ? module.utilities.pathToArray(tabPath)
  235. : module.get.defaultPathArray(tabPath)
  236. ;
  237. tabPath = module.utilities.arrayToPath(pathArray);
  238. $.each(pathArray, function(index, tab) {
  239. var
  240. currentPathArray = pathArray.slice(0, index + 1),
  241. currentPath = module.utilities.arrayToPath(currentPathArray),
  242. isTab = module.is.tab(currentPath),
  243. isLastIndex = (index + 1 == pathArray.length),
  244. $tab = module.get.tabElement(currentPath),
  245. $anchor,
  246. nextPathArray,
  247. nextPath,
  248. isLastTab
  249. ;
  250. module.verbose('Looking for tab', tab);
  251. if(isTab) {
  252. module.verbose('Tab was found', tab);
  253. // scope up
  254. activeTabPath = currentPath;
  255. parameterArray = module.utilities.filterArray(pathArray, currentPathArray);
  256. if(isLastIndex) {
  257. isLastTab = true;
  258. }
  259. else {
  260. nextPathArray = pathArray.slice(0, index + 2);
  261. nextPath = module.utilities.arrayToPath(nextPathArray);
  262. isLastTab = ( !module.is.tab(nextPath) );
  263. if(isLastTab) {
  264. module.verbose('Tab parameters found', nextPathArray);
  265. }
  266. }
  267. if(isLastTab && remoteContent) {
  268. if(!shouldIgnoreLoad) {
  269. module.activate.navigation(currentPath);
  270. module.content.fetch(currentPath, tabPath);
  271. }
  272. else {
  273. module.debug('Ignoring remote content on first tab load', currentPath);
  274. firstLoad = false;
  275. module.cache.add(tabPath, $tab.html());
  276. module.activate.all(currentPath);
  277. settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
  278. settings.onTabLoad.call($tab, currentPath, parameterArray, historyEvent);
  279. }
  280. return false;
  281. }
  282. else {
  283. module.debug('Opened local tab', currentPath);
  284. module.activate.all(currentPath);
  285. if( !module.cache.read(currentPath) ) {
  286. module.cache.add(currentPath, true);
  287. module.debug('First time tab loaded calling tab init');
  288. settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
  289. }
  290. settings.onTabLoad.call($tab, currentPath, parameterArray, historyEvent);
  291. }
  292. }
  293. else if(tabPath.search('/') == -1 && tabPath !== '') {
  294. // look for in page anchor
  295. $anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]'),
  296. currentPath = $anchor.closest('[data-tab]').data('tab');
  297. $tab = module.get.tabElement(currentPath);
  298. // if anchor exists use parent tab
  299. if($anchor && $anchor.length > 0 && currentPath) {
  300. module.debug('No tab found, but deep anchor link present, opening parent tab');
  301. module.activate.all(currentPath);
  302. if( !module.cache.read(currentPath) ) {
  303. module.cache.add(currentPath, true);
  304. module.debug('First time tab loaded calling tab init');
  305. settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
  306. }
  307. return false;
  308. }
  309. }
  310. else {
  311. module.error(error.missingTab, $module, $context, currentPath);
  312. return false;
  313. }
  314. });
  315. },
  316. content: {
  317. fetch: function(tabPath, fullTabPath) {
  318. var
  319. $tab = module.get.tabElement(tabPath),
  320. apiSettings = {
  321. dataType : 'html',
  322. on : 'now',
  323. onSuccess : function(response) {
  324. module.cache.add(fullTabPath, response);
  325. module.content.update(tabPath, response);
  326. if(tabPath == activeTabPath) {
  327. module.debug('Content loaded', tabPath);
  328. module.activate.tab(tabPath);
  329. }
  330. else {
  331. module.debug('Content loaded in background', tabPath);
  332. }
  333. settings.onTabInit.call($tab, tabPath, parameterArray, historyEvent);
  334. settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
  335. },
  336. urlData: { tab: fullTabPath }
  337. },
  338. request = $tab.api('get request') || false,
  339. existingRequest = ( request && request.state() === 'pending' ),
  340. requestSettings,
  341. cachedContent
  342. ;
  343. fullTabPath = fullTabPath || tabPath;
  344. cachedContent = module.cache.read(fullTabPath);
  345. module.activate.tab(tabPath);
  346. if(settings.cache && cachedContent) {
  347. module.debug('Showing existing content', fullTabPath);
  348. module.content.update(tabPath, cachedContent);
  349. settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
  350. }
  351. else if(existingRequest) {
  352. module.debug('Content is already loading', fullTabPath);
  353. $tab.addClass(className.loading);
  354. }
  355. else if($.api !== undefined) {
  356. requestSettings = $.extend(true, {
  357. headers: { 'X-Remote': true }
  358. }, settings.apiSettings, apiSettings);
  359. module.debug('Retrieving remote content', fullTabPath, requestSettings);
  360. $tab.api( requestSettings );
  361. }
  362. else {
  363. module.error(error.api);
  364. }
  365. },
  366. update: function(tabPath, html) {
  367. module.debug('Updating html for', tabPath);
  368. var
  369. $tab = module.get.tabElement(tabPath)
  370. ;
  371. $tab
  372. .html(html)
  373. ;
  374. }
  375. },
  376. activate: {
  377. all: function(tabPath) {
  378. module.activate.tab(tabPath);
  379. module.activate.navigation(tabPath);
  380. },
  381. tab: function(tabPath) {
  382. var
  383. $tab = module.get.tabElement(tabPath)
  384. ;
  385. module.verbose('Showing tab content for', $tab);
  386. $tab
  387. .addClass(className.active)
  388. .siblings($tabs)
  389. .removeClass(className.active + ' ' + className.loading)
  390. ;
  391. },
  392. navigation: function(tabPath) {
  393. var
  394. $navigation = module.get.navElement(tabPath)
  395. ;
  396. module.verbose('Activating tab navigation for', $navigation, tabPath);
  397. $navigation
  398. .addClass(className.active)
  399. .siblings($allModules)
  400. .removeClass(className.active + ' ' + className.loading)
  401. ;
  402. }
  403. },
  404. deactivate: {
  405. all: function() {
  406. module.deactivate.navigation();
  407. module.deactivate.tabs();
  408. },
  409. navigation: function() {
  410. $allModules
  411. .removeClass(className.active)
  412. ;
  413. },
  414. tabs: function() {
  415. $tabs
  416. .removeClass(className.active + ' ' + className.loading)
  417. ;
  418. }
  419. },
  420. is: {
  421. tab: function(tabName) {
  422. return (tabName !== undefined)
  423. ? ( module.get.tabElement(tabName).length > 0 )
  424. : false
  425. ;
  426. }
  427. },
  428. get: {
  429. initialPath: function() {
  430. return $allModules.eq(0).data(metadata.tab) || $tabs.eq(0).data(metadata.tab);
  431. },
  432. path: function() {
  433. return $.address.value();
  434. },
  435. // adds default tabs to tab path
  436. defaultPathArray: function(tabPath) {
  437. return module.utilities.pathToArray( module.get.defaultPath(tabPath) );
  438. },
  439. defaultPath: function(tabPath) {
  440. var
  441. $defaultNav = $allModules.filter('[data-' + metadata.tab + '^="' + tabPath + '/"]').eq(0),
  442. defaultTab = $defaultNav.data(metadata.tab) || false
  443. ;
  444. if( defaultTab ) {
  445. module.debug('Found default tab', defaultTab);
  446. if(recursionDepth < settings.maxDepth) {
  447. recursionDepth++;
  448. return module.get.defaultPath(defaultTab);
  449. }
  450. module.error(error.recursion);
  451. }
  452. else {
  453. module.debug('No default tabs found for', tabPath, $tabs);
  454. }
  455. recursionDepth = 0;
  456. return tabPath;
  457. },
  458. navElement: function(tabPath) {
  459. tabPath = tabPath || activeTabPath;
  460. return $allModules.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
  461. },
  462. tabElement: function(tabPath) {
  463. var
  464. $fullPathTab,
  465. $simplePathTab,
  466. tabPathArray,
  467. lastTab
  468. ;
  469. tabPath = tabPath || activeTabPath;
  470. tabPathArray = module.utilities.pathToArray(tabPath);
  471. lastTab = module.utilities.last(tabPathArray);
  472. $fullPathTab = $tabs.filter('[data-' + metadata.tab + '="' + lastTab + '"]');
  473. $simplePathTab = $tabs.filter('[data-' + metadata.tab + '="' + tabPath + '"]');
  474. return ($fullPathTab.length > 0)
  475. ? $fullPathTab
  476. : $simplePathTab
  477. ;
  478. },
  479. tab: function() {
  480. return activeTabPath;
  481. }
  482. },
  483. utilities: {
  484. filterArray: function(keepArray, removeArray) {
  485. return $.grep(keepArray, function(keepValue) {
  486. return ( $.inArray(keepValue, removeArray) == -1);
  487. });
  488. },
  489. last: function(array) {
  490. return $.isArray(array)
  491. ? array[ array.length - 1]
  492. : false
  493. ;
  494. },
  495. pathToArray: function(pathName) {
  496. if(pathName === undefined) {
  497. pathName = activeTabPath;
  498. }
  499. return typeof pathName == 'string'
  500. ? pathName.split('/')
  501. : [pathName]
  502. ;
  503. },
  504. arrayToPath: function(pathArray) {
  505. return $.isArray(pathArray)
  506. ? pathArray.join('/')
  507. : false
  508. ;
  509. }
  510. },
  511. setting: function(name, value) {
  512. module.debug('Changing setting', name, value);
  513. if( $.isPlainObject(name) ) {
  514. $.extend(true, settings, name);
  515. }
  516. else if(value !== undefined) {
  517. settings[name] = value;
  518. }
  519. else {
  520. return settings[name];
  521. }
  522. },
  523. internal: function(name, value) {
  524. if( $.isPlainObject(name) ) {
  525. $.extend(true, module, name);
  526. }
  527. else if(value !== undefined) {
  528. module[name] = value;
  529. }
  530. else {
  531. return module[name];
  532. }
  533. },
  534. debug: function() {
  535. if(settings.debug) {
  536. if(settings.performance) {
  537. module.performance.log(arguments);
  538. }
  539. else {
  540. module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
  541. module.debug.apply(console, arguments);
  542. }
  543. }
  544. },
  545. verbose: function() {
  546. if(settings.verbose && settings.debug) {
  547. if(settings.performance) {
  548. module.performance.log(arguments);
  549. }
  550. else {
  551. module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
  552. module.verbose.apply(console, arguments);
  553. }
  554. }
  555. },
  556. error: function() {
  557. module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
  558. module.error.apply(console, arguments);
  559. },
  560. performance: {
  561. log: function(message) {
  562. var
  563. currentTime,
  564. executionTime,
  565. previousTime
  566. ;
  567. if(settings.performance) {
  568. currentTime = new Date().getTime();
  569. previousTime = time || currentTime;
  570. executionTime = currentTime - previousTime;
  571. time = currentTime;
  572. performance.push({
  573. 'Name' : message[0],
  574. 'Arguments' : [].slice.call(message, 1) || '',
  575. 'Element' : element,
  576. 'Execution Time' : executionTime
  577. });
  578. }
  579. clearTimeout(module.performance.timer);
  580. module.performance.timer = setTimeout(module.performance.display, 100);
  581. },
  582. display: function() {
  583. var
  584. title = settings.name + ':',
  585. totalTime = 0
  586. ;
  587. time = false;
  588. clearTimeout(module.performance.timer);
  589. $.each(performance, function(index, data) {
  590. totalTime += data['Execution Time'];
  591. });
  592. title += ' ' + totalTime + 'ms';
  593. if(moduleSelector) {
  594. title += ' \'' + moduleSelector + '\'';
  595. }
  596. if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
  597. console.groupCollapsed(title);
  598. if(console.table) {
  599. console.table(performance);
  600. }
  601. else {
  602. $.each(performance, function(index, data) {
  603. console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
  604. });
  605. }
  606. console.groupEnd();
  607. }
  608. performance = [];
  609. }
  610. },
  611. invoke: function(query, passedArguments, context) {
  612. var
  613. object = instance,
  614. maxDepth,
  615. found,
  616. response
  617. ;
  618. passedArguments = passedArguments || queryArguments;
  619. context = element || context;
  620. if(typeof query == 'string' && object !== undefined) {
  621. query = query.split(/[\. ]/);
  622. maxDepth = query.length - 1;
  623. $.each(query, function(depth, value) {
  624. var camelCaseValue = (depth != maxDepth)
  625. ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
  626. : query
  627. ;
  628. if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
  629. object = object[camelCaseValue];
  630. }
  631. else if( object[camelCaseValue] !== undefined ) {
  632. found = object[camelCaseValue];
  633. return false;
  634. }
  635. else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
  636. object = object[value];
  637. }
  638. else if( object[value] !== undefined ) {
  639. found = object[value];
  640. return false;
  641. }
  642. else {
  643. module.error(error.method, query);
  644. return false;
  645. }
  646. });
  647. }
  648. if ( $.isFunction( found ) ) {
  649. response = found.apply(context, passedArguments);
  650. }
  651. else if(found !== undefined) {
  652. response = found;
  653. }
  654. if($.isArray(returnedValue)) {
  655. returnedValue.push(response);
  656. }
  657. else if(returnedValue !== undefined) {
  658. returnedValue = [returnedValue, response];
  659. }
  660. else if(response !== undefined) {
  661. returnedValue = response;
  662. }
  663. return found;
  664. }
  665. };
  666. if(methodInvoked) {
  667. if(instance === undefined) {
  668. module.initialize();
  669. }
  670. module.invoke(query);
  671. }
  672. else {
  673. if(instance !== undefined) {
  674. instance.invoke('destroy');
  675. }
  676. module.initialize();
  677. }
  678. })
  679. ;
  680. if(module && !methodInvoked) {
  681. module.initializeHistory();
  682. }
  683. return (returnedValue !== undefined)
  684. ? returnedValue
  685. : this
  686. ;
  687. };
  688. // shortcut for tabbed content with no defined navigation
  689. $.tab = function() {
  690. $(window).tab.apply(this, arguments);
  691. };
  692. $.fn.tab.settings = {
  693. name : 'Tab',
  694. namespace : 'tab',
  695. debug : false,
  696. verbose : true,
  697. performance : true,
  698. auto : false, // uses pjax style endpoints fetching content from same url with remote-content headers
  699. history : false, // use browser history
  700. historyType : 'hash', // #/ or html5 state
  701. path : false, // base path of url
  702. context : false, // specify a context that tabs must appear inside
  703. childrenOnly : false, // use only tabs that are children of context
  704. maxDepth : 25, // max depth a tab can be nested
  705. alwaysRefresh : false, // load tab content new every tab click
  706. cache : true, // cache the content requests to pull locally
  707. ignoreFirstLoad : false, // don't load remote content on first load
  708. apiSettings : false, // settings for api call
  709. onTabInit : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
  710. onTabLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
  711. templates : {
  712. determineTitle: function(tabArray) {} // returns page title for path
  713. },
  714. error: {
  715. api : 'You attempted to load content without API module',
  716. method : 'The method you called is not defined',
  717. missingTab : 'Activated tab cannot be found for this context.',
  718. noContent : 'The tab you specified is missing a content url.',
  719. path : 'History enabled, but no path was specified',
  720. recursion : 'Max recursive depth reached',
  721. state : 'History requires Asual\'s Address library <https://github.com/asual/jquery-address>'
  722. },
  723. metadata : {
  724. tab : 'tab',
  725. loaded : 'loaded',
  726. promise: 'promise'
  727. },
  728. className : {
  729. loading : 'loading',
  730. active : 'active'
  731. },
  732. selector : {
  733. tabs : '.ui.tab',
  734. ui : '.ui'
  735. }
  736. };
  737. })( jQuery, window , document );