Closes https://github.com/nasa/openmct/pull/1287. Squashed commit of the following: commit af9ba3095859684cb2465f1d5222a14db231fdb7 Merge:c98286d31308b1Author: Pete Richards <peter.l.richards@nasa.gov> Date: Fri Nov 25 14:57:32 2016 -0800 Merge branch 'open1193' into open1287-integration Resolve conflicts in glyph files as documented in pull request: https://github.com/nasa/openmct/pull/1287#issuecomment-263030180 Closes https://github.com/nasa/openmct/pull/1287 commit31308b1076Author: Andrew Henry <andrew.k.henry@nasa.gov> Date: Tue Nov 22 17:08:10 2016 +0000 [Time Conductor] Addressed code review comments. Fixes #1287 commitdb6386e21cAuthor: Henry <akhenry@gmail.com> Date: Wed Nov 9 11:52:39 2016 -0800 Removed redundant ConductorService commita9ec8db8c6Merge:fc36674dfa4591Author: Henry <akhenry@gmail.com> Date: Wed Nov 9 08:23:07 2016 -0800 Merge branch 'master' into open1193 commitfc36674b5cAuthor: Henry <akhenry@gmail.com> Date: Wed Nov 9 08:23:01 2016 -0800 Updated wording of docs commitd0906baccfAuthor: Henry <akhenry@gmail.com> Date: Fri Nov 4 10:48:05 2016 -0700 Fixed TOI not showing commit099c56c407Author: Henry <akhenry@gmail.com> Date: Fri Oct 28 16:46:06 2016 -0700 Fixed failing tests commit7cc008ed01Author: Henry <akhenry@gmail.com> Date: Fri Oct 28 10:28:41 2016 -0700 Added tests for tables, TOI controller commitb0901e83cbAuthor: Henry <akhenry@gmail.com> Date: Thu Oct 27 10:42:31 2016 -0700 Added tests for ConductorAxisController and TimeConductor commitdfed0a0783Author: Henry <akhenry@gmail.com> Date: Wed Oct 26 18:07:50 2016 -0700 Added ConductorAxisController tests commitc3322e3847Author: Henry <akhenry@gmail.com> Date: Tue Oct 25 20:54:24 2016 -0700 Added tests for MctTableController commit8e76ebb5a8Author: Henry <akhenry@gmail.com> Date: Tue Oct 25 15:48:15 2016 -0700 Removed debugging code commit93735bc404Author: Henry <akhenry@gmail.com> Date: Mon Oct 24 15:13:45 2016 -0700 Removed bundle definition of MctAxisController Documenting code commita942541724Author: Henry <akhenry@gmail.com> Date: Sun Oct 23 19:54:01 2016 -0700 [Time Conductor] Fixed memory leak due to listeners not being deregistered commit49e600dcc9Author: Henry <akhenry@gmail.com> Date: Sat Oct 22 16:47:11 2016 -0700 [Time Conductor] Fixed zoom slider behavior commitf5806613b9Author: Henry <akhenry@gmail.com> Date: Sat Oct 22 14:46:14 2016 -0700 [Time Conductor] support TOI from real-time tables commit029d2b3058Author: Henry <akhenry@gmail.com> Date: Thu Oct 20 14:32:34 2016 -0700 [Examples] Simplified MSL example, fixed object tree not loading by default, renamed. Fixes #1256. Fixes #1255 commit482eb4a5e8Author: Henry <akhenry@gmail.com> Date: Sat Oct 22 13:09:05 2016 -0700 [Time Conductor] Using new API commit843c678b0bMerge:b56ab0a08ca765Author: Henry <akhenry@gmail.com> Date: Fri Oct 21 10:21:22 2016 -0700 In process of merging commitb56ab0aac2Author: Henry <akhenry@gmail.com> Date: Wed Oct 19 16:30:26 2016 -0700 [Time Conductor] Implement default sort, fix unpredictable positioning using % left, set TOI on conductor init. #1193 commitd12ae77d95Author: Henry <akhenry@gmail.com> Date: Wed Oct 19 11:29:42 2016 -0700 Further TOI improvements commit22564473b5Merge:9f3ec3b86b51f6Author: Henry <akhenry@gmail.com> Date: Tue Oct 18 16:32:12 2016 -0700 Merge branch 'open1193' of https://github.com/nasa/openmctweb into open1193 commit9f3ec3b18fAuthor: Henry <akhenry@gmail.com> Date: Tue Oct 18 16:31:59 2016 -0700 Fixed issue with scrolling to row after bounds change commit86b51f6cdeAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Oct 17 17:19:50 2016 -0700 [Frontend] Small refactor for mct-include Fixes #933 Fixes #1193 Markup and CSS tweaked to support using mct-include as the main container for the TOI element; TC, plots and tables all updated. commitdadca62955Author: Henry <akhenry@gmail.com> Date: Mon Oct 17 15:54:34 2016 -0700 Positioning of TOI in tables and plots commit7a09bc1339Author: Henry <akhenry@gmail.com> Date: Mon Oct 17 10:11:59 2016 -0700 Migrated TOI functionality to common controller commit6bea6b3bc2Merge:660757f8f67cbdAuthor: Henry <akhenry@gmail.com> Date: Fri Oct 14 14:38:57 2016 -0700 Merge branch 'open1193' of https://github.com/nasa/openmctweb into open1193 commit660757fc1cAuthor: Henry <akhenry@gmail.com> Date: Fri Oct 14 14:38:46 2016 -0700 Added TimeOfInterestController commit8f67cbd717Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Oct 14 11:33:35 2016 -0700 [Frontend] Fixed cursor: grab on Time Conductor Fixes #933 Fixes #1193 Moved cursor: grab into mixin; sass cleanups commit07a4e26317Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Oct 14 11:03:23 2016 -0700 [Frontend] TOI finalizing Fixes #933 Fixes #1193 HTML template cleaned up; checked in snow theme, theme colors tweaked; padding finalized; now uses val-to-left instead of -to-right; commit271c788f20Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Oct 14 10:22:26 2016 -0700 [Frontend] TOI in tables Fixes #933 Fixes #1193 WIP commitb7e8a1b378Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Oct 13 15:55:48 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 WIP: Table TOI element in progress commit6042e4ad58Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Oct 13 13:46:27 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 WIP: plots and TC done, moving on to tables; moved sass into conductor-v2; moved constants; commit1a534301c5Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Oct 13 11:42:10 2016 -0700 [Frontend] Refactor TOI element Fixes #933 Fixes #1193 WIP; TOI as mct-include; layout uses flex-box; preparing to move TOI sass into conductor-v2 directory; commit42acf9255eAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Oct 12 18:34:51 2016 -0700 [Frontend] Adding resync and dedicated unpin buttons Fixes #933 Fixes #1193 VERY WIP! commit3f0eb0b7cbAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Oct 12 18:33:53 2016 -0700 [Frontend] New glyphs for use by TOI Fixes #933 Fixes #1193 Symbols font updated commit086307ba3aAuthor: Henry <akhenry@gmail.com> Date: Tue Oct 11 17:16:51 2016 -0700 Fixed scrolling behavior with TOI commit938bf3c4dfMerge:39104378b2047cAuthor: Henry <akhenry@gmail.com> Date: Tue Oct 11 13:26:20 2016 -0700 Merge branch 'open1182' into open1193 commit8b2047ca32Author: Henry <akhenry@gmail.com> Date: Tue Oct 11 13:25:24 2016 -0700 Fixed issue with setting deltas commit3910437033Merge:70c4ce202c543fAuthor: Henry <akhenry@gmail.com> Date: Tue Oct 11 12:48:37 2016 -0700 Merged changes to zoom commit02c543fddcAuthor: Henry <akhenry@gmail.com> Date: Tue Oct 11 12:45:18 2016 -0700 Fixed zoom in real-time mode commit70c4ce24e4Author: Henry <akhenry@gmail.com> Date: Fri Oct 7 17:57:14 2016 -0700 Added support for clicking row to set TOI commitb995a8b87bMerge:51a9557b384e84Author: Henry <akhenry@gmail.com> Date: Fri Oct 7 16:11:59 2016 -0700 Merged from open1182 commitb384e84872Merge:5babf7207140b1Author: Henry <akhenry@gmail.com> Date: Fri Oct 7 15:02:41 2016 -0700 Merge branch 'open933' into open1182 commit07140b179fMerge:3e9c0ebcbd001eAuthor: Henry <akhenry@gmail.com> Date: Fri Oct 7 14:54:18 2016 -0700 Merge branch 'master' into open933 commit51a95575f7Author: Henry <akhenry@gmail.com> Date: Fri Oct 7 14:51:59 2016 -0700 [Time Conductor] Refactored time of interest as optional generic behavior of MctTable commitdfbbc3b0c5Merge:430645b47a0abaAuthor: Henry <akhenry@gmail.com> Date: Thu Oct 6 10:23:42 2016 -0700 alt-click to select TOI from table commit3e9c0eb7a5Merge:f1d20728a00181Author: Henry <akhenry@gmail.com> Date: Wed Oct 5 12:25:04 2016 -0700 Merged from master to resolve build issues commitf1d2072bb9Author: Henry <akhenry@gmail.com> Date: Wed Oct 5 11:17:22 2016 -0700 Added license information commit430645b1f2Author: Henry <akhenry@gmail.com> Date: Wed Oct 5 09:04:13 2016 -0700 TOI working in time conductor commit47a0aba601Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Tue Oct 4 18:12:01 2016 -0700 [Frontend] TOI sass and markup sanding Fixes #933 Fixes #1193 Color tweaks; Cleanups, commented code removal, etc.; tightened up tabular padding and font sizes; commit0ed0a48a8cAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Tue Oct 4 15:49:18 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 Tabular styling for TOI; commit1650aae518Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Oct 3 15:56:56 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 WIP: Tabular styling for TOI; TODO: make bottom border work commitd3bf6c5857Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Oct 3 15:15:56 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 WIP: Markup and CSS for plots and TC near complete; TODO: revised styling in tabular views; commit5cd0c8a4faAuthor: Henry <akhenry@gmail.com> Date: Fri Sep 30 12:41:14 2016 -0700 [Time Conductor] merged from open1182 commit5babf7274dAuthor: Henry <akhenry@gmail.com> Date: Thu Sep 29 11:21:11 2016 -0700 [Time Conductor] Tweaked the break points for zoom level indicator commit22da34870dAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 29 10:41:21 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 WIP: Markup and CSS revisions for updated UX approach; TODO: cosmetic CSS commit99253a5904Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Tue Sep 27 20:42:33 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 WIP: Markup and CSS revisions for updated UX approach commit2db4aa6235Author: Henry <akhenry@gmail.com> Date: Fri Sep 23 13:06:22 2016 -0700 [Time Conductor] Added zoom level label commitbb2ae2f8d1Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Fri Sep 23 11:07:06 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 Finalized TOI in plots, table and TC commit0cf4c92555Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 22 19:15:10 2016 -0700 [Frontend] Styling for TOI element in tables Fixes #933 Fixes #1193 WIP: styling in tabular mostly done, needs more unit testing TODO: fix hide/show for pinned TOI in plots - don't show pinned TOI on hover when not .active commit3c95c095f1Author: Henry <akhenry@gmail.com> Date: Thu Sep 22 17:22:25 2016 -0700 [Time Conductor] Refactored out use of angular event bus in favor of making TimeConductorViewService an event emitter. commitadbcc407efAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 22 16:06:45 2016 -0700 [Frontend] Styling for TOI element Fixes #933 Fixes #1193 WIP: TOI in tables commit1c3bd69b66Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 22 16:06:16 2016 -0700 [Frontend] Styling for TOI element, some refactoring Fixes #933 Fixes #1193 Moves some TOI styling into dedicated new scss file; Enhancements to TOI in plots to bring into parity with TOI in TC approach; commit49ee5cb74bAuthor: Henry <akhenry@gmail.com> Date: Thu Sep 22 15:18:48 2016 -0700 [Time Conductor] Destroy listeners in ConductorAxisController commit1a93ba2c3dAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 22 15:09:42 2016 -0700 [Frontend] Styling for TOI element in TC Fixes #933 Fixes #1193 Final for now; both types of TOI added to TC markup; Hover behavior; constant values in the right places; commit98122cc730Author: Henry <akhenry@gmail.com> Date: Tue Sep 20 11:40:58 2016 -0700 [Time Conductor] Added Zoom commit7fcafb6b58Author: Henry <akhenry@gmail.com> Date: Mon Sep 12 16:53:48 2016 -0700 [Time Conductor] Added pan to Time Conductor commitd77922d66cAuthor: Pete Richards <pete@pete-richards.com> Date: Thu Sep 15 09:37:11 2016 -0700 Revert "[proxyUrl] pass URL parameters to proxied URL" commit2e81550c86Author: Victor Woeltjen <victor.woeltjen@nasa.gov> Date: Wed Sep 14 10:16:33 2016 -0700 Revert "[Build] Check dependencies for vulnerabilities" commit8eb7585653Author: Victor Woeltjen <victor.woeltjen@nasa.gov> Date: Mon Aug 29 10:58:02 2016 -0700 [README] Warn about root installation issues Mitigates #1151. commit904d56a089Author: Henry <akhenry@gmail.com> Date: Thu Sep 22 13:32:43 2016 -0700 [Time Conductor] #933 Clean up time conductor listeners on scope destruction commitc0a96b3c5fAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 22 10:33:05 2016 -0700 [Frontend] Styling for TOI element in TC Fixes #933 Fixes #1193 WIP, tweaking TOI in TC commit27e6caf69bAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Sep 16 18:51:51 2016 -0700 [Frontend] Styling for TOI element in plots Fixes #933 Fixes #1193 Relates to #1182 WIP, adding TOI to plot view; Integrated Andrew's work from #1182; Significant changes to markup and additions to plot scss; commit2c7ae95106Merge:2c81b7241a160fAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Sep 16 15:11:25 2016 -0700 Merge branch 'open1182' into open1193 commit41a160fc4fMerge:92a80c3156ba83Author: Henry <akhenry@gmail.com> Date: Fri Sep 16 14:25:49 2016 -0700 Merge branch 'master' into open1182 commit92a80c39cbAuthor: Henry <akhenry@gmail.com> Date: Mon Sep 12 16:53:48 2016 -0700 [Time Conductor] Added pan to Time Conductor commit2c81b72d60Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 15 16:02:30 2016 -0700 [Frontend] Styling for TOI element in plots Fixes #933 Fixes #1193 WIP, adding TOI to plot view. commit9e2debf801Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 15 15:43:29 2016 -0700 [Frontend] Styling for TC's TOI element Fixes #933 Fixes #1193 I lied in my last commit - one more alignment tweak needed. Now I'm done. commit35872e284cAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 15 15:40:03 2016 -0700 [Frontend] Styling for TC's TOI element Fixes #933 Fixes #1193 TOI in TC done for now. commit98e67f8dfbAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Thu Sep 15 14:55:06 2016 -0700 [Frontend] Styling for TC's TOI element Fixes #933 Fixes #1193 WIP: adjust spacing; added pagination buttons commitf912b9e273Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Sep 14 18:40:55 2016 -0700 [Frontend] Styling for TC's TOI element Fixes #933 WIP, TC v2 changes commit2df1e2b508Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Sep 14 18:40:29 2016 -0700 [Frontend] Styling for TC's TOI element Fixes #933 WIP, global changes commit9e85341aaaAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Sep 14 15:16:16 2016 -0700 [Frontend] Fixed color for TC clock hands Fixes #933 commit11e06039ecMerge:a1331b7f732387Author: Henry <akhenry@gmail.com> Date: Tue Sep 13 13:25:37 2016 -0700 Merge branch 'master' into open933 commita1331b7bb3Merge:d1960b2e73bb4fAuthor: Henry <akhenry@gmail.com> Date: Mon Sep 12 15:07:05 2016 -0700 Merge branch 'master' into open933 commitd1960b2f46Author: Henry <akhenry@gmail.com> Date: Mon Sep 12 14:54:16 2016 -0700 [Time Conductor] Resolved merge conflicts commit9a06325533Merge:e639e054c6ca58Author: Henry <akhenry@gmail.com> Date: Mon Sep 12 14:39:24 2016 -0700 Merge branch 'master' into open933 commite639e056baAuthor: Henry <akhenry@gmail.com> Date: Fri Sep 9 16:39:21 2016 -0700 [Time Conductor] Fixing bugs found in smoke testing. Fixes #933 commitfbab890081Author: Henry <akhenry@gmail.com> Date: Wed Sep 7 14:29:21 2016 -0700 [Time Conductor] Switched conductor to mct-include rather than mct-representation to avoid warnings commitd37dd52ee1Merge:7af587558391deAuthor: Henry <akhenry@gmail.com> Date: Tue Sep 6 16:43:17 2016 -0700 Merge branch 'master' into open933 commit7af5875dd5Author: Henry <akhenry@gmail.com> Date: Tue Sep 6 10:04:29 2016 -0700 [Time Conductor] #933 Fixed code style errors commitc6eaa3d528Author: Andrew Henry <andrew.k.henry@nasa.gov> Date: Wed Aug 24 15:28:19 2016 +0100 [Time Conductor] Adding tests and fixing failing ones. #933 commit4cf6126d35Author: Henry <akhenry@gmail.com> Date: Wed Aug 10 18:22:30 2016 -0700 Refactoring based on feedback Refactoring controller Migrating functions off controller onto service class Simplified modes Adding comments Removed unnecessary validation Fixing testing issues commit4ae6da0334Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Tue Aug 9 17:47:31 2016 -0700 [Frontend] Data viz in Time Conductor smaller Fixes #933 Reduced height of data viz bar in Time Conductor v2; commitae39343b76Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Aug 8 12:14:20 2016 -0700 [Frontend] Fix for bad fix Fixes #1112 Put overflow: hidden back at outer wrapper level (now on .t-object.primary-pane ) which doens't clip the Inspector expand/collapse; did better unit testing; commit62ee7e569bAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Aug 8 11:21:01 2016 -0700 [Frontend] Fix for collapse Inspector button Fixes #1112 Moved min-width and overflow: hidden to TC-specific elements; removed overflow: hidden from .primary-pane commit7557a86208Merge:46e644ec8931f8Author: Henry <akhenry@gmail.com> Date: Fri Aug 5 16:37:36 2016 -0700 Merge branch 'master' into open933 commit46e644e6dcAuthor: Pete Richards <peter.l.richards@nasa.gov> Date: Fri Aug 5 14:44:18 2016 -0700 Use key to retrieve default commitaf7954c5a1Author: Pete Richards <peter.l.richards@nasa.gov> Date: Fri Aug 5 11:24:51 2016 -0700 Trigger digests when bounds are set commit0e0ad64830Author: Henry <akhenry@gmail.com> Date: Thu Aug 4 10:41:58 2016 -0700 Fixed issue with wrong deltas being applied commitf3fd386e3bAuthor: Henry <akhenry@gmail.com> Date: Wed Aug 3 21:03:09 2016 -0700 Retain time system on mode change commit25b9f371e2Author: Henry <akhenry@gmail.com> Date: Wed Aug 3 20:16:03 2016 -0700 Fixed loss of time system options on navigation commit6b482d487bMerge:f96f78f9a72c96Author: Henry <akhenry@gmail.com> Date: Wed Aug 3 19:57:03 2016 -0700 Merged mode-specific defaults, with some refactoring commitf96f78ff79Author: Henry <akhenry@gmail.com> Date: Wed Aug 3 19:34:31 2016 -0700 Select appropriate tick source based on mode commit579233ade9Author: Henry <akhenry@gmail.com> Date: Wed Aug 3 18:30:01 2016 -0700 Fixed delta format issue on navigation commit9a72c96ea4Author: Pete Richards <peter.l.richards@nasa.gov> Date: Wed Aug 3 18:06:39 2016 -0700 [TCv2] different defaults by mode commitf4e1879a2dAuthor: Henry <akhenry@gmail.com> Date: Wed Aug 3 17:43:07 2016 -0700 stop listening to tick source on time system change commitf844495cc1Author: Henry <akhenry@gmail.com> Date: Wed Aug 3 17:40:37 2016 -0700 Support deltaFormat on timeSystems commit900752208fAuthor: Pete Richards <peter.l.richards@nasa.gov> Date: Wed Aug 3 13:05:43 2016 -0700 [TCv2] get conductor without service commit6501e2eb5fAuthor: Henry <akhenry@gmail.com> Date: Wed Aug 3 12:22:13 2016 -0700 Added isUTCBased to TimeSystem interface commitb9c41107c1Author: Henry <akhenry@gmail.com> Date: Tue Aug 2 22:18:44 2016 -0700 Time Conductor state retained on navigation commit34c62ba405Author: Henry <akhenry@gmail.com> Date: Tue Aug 2 15:16:35 2016 -0700 Time Conductor in edit mode commit1eea5ce480Merge:4cd579d1173828Author: Henry <akhenry@gmail.com> Date: Mon Aug 1 20:29:50 2016 -0700 merged from master commit4cd579d274Author: Henry <akhenry@gmail.com> Date: Mon Aug 1 20:16:46 2016 -0700 Pass numerical value to format functions commit11738286dfAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 18:56:33 2016 -0700 [Frontend] Styling for unsynced elements Fixes #933 commitca5206d4a0Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 18:55:49 2016 -0700 [Frontend] Fixing issues with theme coloring Fixes #933 commit573f1f9f99Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 18:04:17 2016 -0700 [Frontend] Hide zoom slider control Fixes #933 Temporarily hiding per request from Andrew today; commitc5c45f0a0eAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 18:01:28 2016 -0700 [Frontend] Update TC2 markup and sass Fixes #933 Update markup and sass in TC2 to be in line with updates from master from #1047 glyphs to cssclass approach; commit121ab413ffAuthor: Henry <akhenry@gmail.com> Date: Mon Aug 1 17:51:15 2016 -0700 Apply formatting, filter modes by tick source availability commit753bd97c8aAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 17:12:44 2016 -0700 Merge remote-tracking branch 'origin/master' into open933-c # Conflicts: # platform/commonUI/edit/res/templates/create/create-menu.html # platform/commonUI/general/res/fonts/symbols/wtdsymbols.eot # platform/commonUI/general/res/fonts/symbols/wtdsymbols.svg # platform/commonUI/general/res/fonts/symbols/wtdsymbols.ttf # platform/commonUI/general/res/fonts/symbols/wtdsymbols.woff # platform/commonUI/general/res/sass/_archetypes.scss # platform/commonUI/general/res/sass/_constants.scss # platform/commonUI/general/res/sass/_icons.scss # platform/commonUI/general/res/sass/_main.scss # platform/commonUI/general/res/sass/_mixins.scss # platform/commonUI/general/res/sass/controls/_buttons.scss # platform/commonUI/general/res/templates/controls/time-controller.html # platform/commonUI/themes/snow/res/sass/_constants.scss commitfcd7ab93e5Merge:a75ea679b58aa0Author: Henry <akhenry@gmail.com> Date: Mon Aug 1 17:12:00 2016 -0700 Merge branch 'open933' of https://github.com/nasa/openmctweb into open933 commitc699cb8b4bMerge:579c6b6d1e1ba1Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 17:11:37 2016 -0700 Merge remote-tracking branch 'origin/master' into open933-c # Conflicts: # platform/commonUI/edit/res/templates/create/create-menu.html # platform/commonUI/general/res/fonts/symbols/wtdsymbols.eot # platform/commonUI/general/res/fonts/symbols/wtdsymbols.svg # platform/commonUI/general/res/fonts/symbols/wtdsymbols.ttf # platform/commonUI/general/res/fonts/symbols/wtdsymbols.woff # platform/commonUI/general/res/sass/_archetypes.scss # platform/commonUI/general/res/sass/_constants.scss # platform/commonUI/general/res/sass/_icons.scss # platform/commonUI/general/res/sass/_main.scss # platform/commonUI/general/res/sass/_mixins.scss # platform/commonUI/general/res/sass/controls/_buttons.scss # platform/commonUI/general/res/templates/controls/time-controller.html # platform/commonUI/themes/snow/res/sass/_constants.scss commita75ea67b8cAuthor: Henry <akhenry@gmail.com> Date: Mon Aug 1 17:11:01 2016 -0700 Format updates when time system selected commit9b58aa0052Author: Pete Richards <peter.l.richards@nasa.gov> Date: Mon Aug 1 17:03:00 2016 -0700 [TCv2] Add conductorService for compatibility Add conductor service for compatibility with old plugins that depend on the conductor service. commit579c6b6d24Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 16:30:51 2016 -0700 [Frontend] Styling TC unsynced elements Fixes #933 WIP: Styling for unsynced elements commit762f43fa61Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 16:26:47 2016 -0700 [Frontend] Styling TC unsynced elements Fixes #933 WIP: Styling for unsynced elements commitce5d0ef5bdAuthor: Henry <akhenry@gmail.com> Date: Mon Aug 1 16:03:27 2016 -0700 Merged stylesheet changes commit142ee2f336Merge:482fcbf523d674Author: Henry <akhenry@gmail.com> Date: Mon Aug 1 15:44:49 2016 -0700 Added LocalTimeSystem and merged latest styles commit482fcbf6eeAuthor: Henry <akhenry@gmail.com> Date: Mon Aug 1 15:14:23 2016 -0700 Refactored bundle commit523d6743fbAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Mon Aug 1 12:00:53 2016 -0700 [Frontend] Added support for thematic styling of Time Conductor v2 Fixes #933 Added theme sass files commit7af22126d4Author: Henry <akhenry@gmail.com> Date: Wed Jul 27 12:05:03 2016 -0400 Prevent tabbing into end bounds when not in fixed mode commit8e59072537Author: Henry <akhenry@gmail.com> Date: Wed Jul 27 11:55:12 2016 -0400 Removed LAD and Realtime modes commitc1bbc4f01dAuthor: Henry <akhenry@gmail.com> Date: Wed Jul 27 10:38:04 2016 -0400 Code cleanup commitaa4a5e56f9Author: Henry <akhenry@gmail.com> Date: Tue Jul 26 16:55:00 2016 -0400 Improved support from plot commit5b2eb72b16Author: Henry <akhenry@gmail.com> Date: Tue Jul 26 08:33:30 2016 -0400 [Time Conductor] Addressed documentation issues commit1b7fc57d21Author: Henry <akhenry@gmail.com> Date: Mon Jul 25 16:55:27 2016 -0400 Added status support to plots commita4f6f6f50bAuthor: Henry <akhenry@gmail.com> Date: Mon Jul 25 12:09:15 2016 -0400 Added license commit19fd63b850Merge:c2c8e16a10ded2Author: Henry <akhenry@gmail.com> Date: Thu Jul 21 20:06:50 2016 -0700 Merge branch 'open933-frontend-b' into open933 commitc2c8e16453Author: Henry <akhenry@gmail.com> Date: Thu Jul 21 20:03:40 2016 -0700 Added scale sensitive formatting to UTCTimeFormat commita10ded25b4Merge:da7c636e6d8944Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 20 18:33:58 2016 -0700 Merge remote-tracking branch 'origin/open933' into open933-frontend-b # Conflicts: # platform/features/conductor-v2/res/sass/time-conductor.scss # platform/features/conductor/res/sass/time-conductor.scss commitda7c636724Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 20 18:22:20 2016 -0700 [Frontend] Time Conductor v2 styling Fixes #933 Redo TC icon to use font symbol, added new symbol for brackets to font files; font anti-aliasing mod for .ui-symbol class; layout tweaks; mobile tweaks. commitb392633bc6Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 20 15:48:22 2016 -0700 [Frontend] Time Conductor v2 styling Fixes #933 WIP: Significant mobile and desktop style tweaks; moved constants into their own include file; commitff1678435eAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 20 11:43:40 2016 -0700 [Frontend] Time Conductor v2 styling Fixes #933 Changed desktop and mobile RT UI to display end datetime and hide start; WIP: mobile styling for main UI of TC; commit2124fe01e1Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 20 10:18:42 2016 -0700 [Frontend] Renew support for Time Conductor v1 Fixes #933 Minor fixes to TCv1 for mobile commite6d8944547Author: Henry <akhenry@gmail.com> Date: Tue Jul 19 20:17:06 2016 -0700 Modified main.js commitea1defac28Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Tue Jul 19 18:33:24 2016 -0700 [Frontend] Renew support for Time Conductor v1 Fixes #933 Time Conductors v1 and v2 now build and load their own isolated CSS files. All previous styling for TCv1 should be re-enabled. Note that Conductor v2 mobile is not complete yet. commit2a19394334Author: Henry <akhenry@gmail.com> Date: Tue Jul 19 19:54:52 2016 -0700 Added compatibility layer to support existing plots and historical tables commitf641edbce7Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Tue Jul 19 18:33:24 2016 -0700 [Frontend] Renew support for Time Conductor v1 Fixes #933 Time Conductors v1 and v2 now build and load their own isolated CSS files. All previous styling for TCv1 should be re-enabled. Note that Conductor v2 mobile is not complete yet. commit15a608a861Author: Henry <akhenry@gmail.com> Date: Mon Jul 18 18:44:29 2016 -0700 Populate format in input fields commit334ca64551Merge:0af49ef4087b9cAuthor: Henry <akhenry@gmail.com> Date: Mon Jul 18 14:25:02 2016 -0700 Merged open933-frontend commit0af49efe06Author: Henry <akhenry@gmail.com> Date: Mon Jul 18 08:23:27 2016 -0700 Refactored out modes, time systems, etc. commit4087b9cddeAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Fri Jul 15 14:39:29 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 WIP: Fixed look for Firefox commit43a804eef4Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Jul 15 07:54:32 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 WIP: Added zoom current range indicator; tweaks to style commitb3a4f52fe2Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Thu Jul 14 18:30:49 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 WIP: Adding zoom control with HTML5 input range type; Refactored sass slightly to move display: inline-block out of mixin containerBase and into .s-btn. commit671e3016d4Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Thu Jul 14 16:40:05 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 New _animations scss include, moved scss around. commit379828315fAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Thu Jul 14 16:39:27 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 New _animations scss include, moved scss around. commit8c5538ec4dAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Thu Jul 14 14:58:18 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 "Sticky" clock anim for LAD mode commit2f9fbfef7fAuthor: Henry <akhenry@gmail.com> Date: Wed Jul 13 20:33:47 2016 -0700 More refactoring commit2baca659caAuthor: Henry <akhenry@gmail.com> Date: Wed Jul 13 19:50:58 2016 -0700 Refactoring commit8b694ef337Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 13 19:42:51 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 In-progress: color/size tweaks, fixes for espresso theme commite193e3dfbaAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 13 19:16:27 2016 -0700 Merge open933 latest, resolve conflicts Fixes #933 Fair amount of manual fixing in time-conductor.html commit8214c8e895Merge:33b222514463d3Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 13 19:16:00 2016 -0700 Merge open933 latest, resolve conflicts Fixes #933 Fair amount of manual fixing in time-conductor.html commit33b2225d10Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 13 18:48:17 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 In-progress: restructured markup to move modeModel farther out; animated icon commit14463d39a8Author: Henry <akhenry@gmail.com> Date: Wed Jul 13 18:17:27 2016 -0700 Added end delta commitfcfda50e73Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 13 15:00:16 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 In-progress: color tweaks, bar sizing, field widths commit06af84c161Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 13 13:14:32 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 In-progress: fixed SVG text color, field styling for fixed vs. real-time, markup cleanup commit5238aa2731Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Wed Jul 13 08:07:59 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 In-progress; fixed SVG text color commitfd29473664Author: Henry <akhenry@gmail.com> Date: Tue Jul 12 15:02:39 2016 -0700 Support resize commit97f3fd516bAuthor: Henry <akhenry@gmail.com> Date: Tue Jul 12 10:14:26 2016 -0700 Changed default duration to fifteen minutes commit088416905dAuthor: Henry <akhenry@gmail.com> Date: Tue Jul 12 10:08:08 2016 -0700 Added duration commit2056d87453Merge:585da3864ce8a2Author: Henry <akhenry@gmail.com> Date: Mon Jul 11 14:27:30 2016 -0700 Merge branch 'open933-frontend' into open933 commit64ce8a2b2aAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Jul 11 14:03:41 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 Color adjusts, mini super-menu size and font tweaks, glyphs added to selector, SVG style fixes in progress commit585da38a16Author: Henry <akhenry@gmail.com> Date: Mon Jul 11 13:46:46 2016 -0700 Fixed some merge issues commitbf0e85a94cAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Jul 11 11:35:26 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #933 Renamed main class; removed unused <style> defs commit84b7a9dc2fMerge:7b7b21d11caa83Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Jul 11 11:29:35 2016 -0700 Merge remote-tracking branch 'origin/open933' into open933-frontend Fixes #933 Conflicts: platform/features/conductor-v2/src/TimeConductorController.js commit11caa8396aAuthor: Henry <akhenry@gmail.com> Date: Mon Jul 11 11:18:23 2016 -0700 Updated modes commit0017b77439Merge:5cc81ba788483eAuthor: Henry <akhenry@gmail.com> Date: Mon Jul 11 11:06:22 2016 -0700 Merged markup changes commit7b7b21d748Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Jul 11 11:05:47 2016 -0700 [Frontend] Styling of Time Conductor v2 Fixes #933 Tweaks to language; tweak to class name in markup commit788483ec13Author: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Jul 11 10:37:08 2016 -0700 [Frontend] Styling of Time Conductor v2 Fixes #933 Tweaks to language commit7b19f91ce6Merge:0a0bc554e7b69cAuthor: Charles Hacskaylo <charles.f.hacskaylo@nasa.gov> Date: Mon Jul 11 10:31:14 2016 -0700 [Frontend] Merge latest from open933 Fixes #933 Resolve conflicts in mode-menu.html, mode-selector.html, time-conductor.html; apply tweaks, language, etc. commit5cc81ba12aAuthor: Henry <akhenry@gmail.com> Date: Mon Jul 11 10:26:34 2016 -0700 [Time Conductor] Added mode class to time conductor commit0a0bc55f5fAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Jul 8 17:11:43 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #993 In-progress; mode menu names and descriptors modified, markup cleaned up commit4e7b69c4dfAuthor: Henry <akhenry@gmail.com> Date: Fri Jul 8 16:57:50 2016 -0700 Enabled fixed and real-time modes commitcf83040c4bAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Jul 8 16:54:49 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #993 In-progress; Create menu refactoring and new mini Create menu commit32f7bc86afAuthor: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Jul 8 16:54:13 2016 -0700 [Frontend] Styling for Time Conductor v2 Fixes #993 In-progress; class renaming continued, cleanups in markup file, in-page styles ported to scss commite230b92946Author: Henry <akhenry@gmail.com> Date: Fri Jul 8 15:15:12 2016 -0700 Fixed bug with date selector having to be clicked twice commit58ed500ecfAuthor: Henry <akhenry@gmail.com> Date: Thu Jul 7 16:57:03 2016 -0700 Time sync via conductor commitbca5eb0fdbAuthor: Henry <akhenry@gmail.com> Date: Thu Jul 7 09:47:46 2016 -0700 [Time Conductor] #933 Initial markup
685 lines
25 KiB
JavaScript
685 lines
25 KiB
JavaScript
|
|
define(
|
|
['zepto'],
|
|
function ($) {
|
|
|
|
/**
|
|
* A controller for the MCTTable directive. Populates scope with
|
|
* data used for populating, sorting, and filtering
|
|
* tables.
|
|
* @param $scope
|
|
* @param $timeout
|
|
* @param element
|
|
* @constructor
|
|
*/
|
|
function MCTTableController($scope, $timeout, element, exportService, formatService, openmct) {
|
|
var self = this;
|
|
|
|
this.$scope = $scope;
|
|
this.element = $(element[0]);
|
|
this.$timeout = $timeout;
|
|
this.maxDisplayRows = 50;
|
|
|
|
this.scrollable = this.element.find('.l-view-section.scrolling').first();
|
|
this.resultsHeader = this.element.find('.mct-table>thead').first();
|
|
this.sizingTableBody = this.element.find('.sizing-table>tbody').first();
|
|
this.$scope.sizingRow = {};
|
|
this.conductor = openmct.conductor;
|
|
this.toiFormatter = undefined;
|
|
this.formatService = formatService;
|
|
|
|
//Bind all class functions to 'this'
|
|
Object.keys(MCTTableController.prototype).filter(function (key) {
|
|
return typeof MCTTableController.prototype[key] === 'function';
|
|
}).forEach(function (key) {
|
|
this[key] = MCTTableController.prototype[key].bind(this);
|
|
}.bind(this));
|
|
|
|
this.scrollable.on('scroll', this.onScroll.bind(this));
|
|
|
|
$scope.visibleRows = [];
|
|
|
|
/**
|
|
* Set default values for optional parameters on a given scope
|
|
*/
|
|
function setDefaults(scope) {
|
|
if (typeof scope.enableFilter === 'undefined') {
|
|
scope.enableFilter = true;
|
|
scope.filters = {};
|
|
}
|
|
if (typeof scope.enableSort === 'undefined') {
|
|
scope.enableSort = true;
|
|
scope.sortColumn = undefined;
|
|
scope.sortDirection = undefined;
|
|
}
|
|
if (scope.sortColumn !== undefined) {
|
|
scope.sortDirection = "asc";
|
|
}
|
|
}
|
|
|
|
setDefaults($scope);
|
|
|
|
$scope.exportAsCSV = function () {
|
|
var headers = $scope.displayHeaders;
|
|
exportService.exportCSV($scope.displayRows.map(function (row) {
|
|
return headers.reduce(function (r, header) {
|
|
r[header] = row[header].text;
|
|
return r;
|
|
}, {});
|
|
}), { headers: headers });
|
|
};
|
|
|
|
$scope.toggleSort = function (key) {
|
|
if (!$scope.enableSort) {
|
|
return;
|
|
}
|
|
if ($scope.sortColumn !== key) {
|
|
$scope.sortColumn = key;
|
|
$scope.sortDirection = 'asc';
|
|
} else if ($scope.sortDirection === 'asc') {
|
|
$scope.sortDirection = 'desc';
|
|
} else if ($scope.sortDirection === 'desc') {
|
|
$scope.sortColumn = undefined;
|
|
$scope.sortDirection = undefined;
|
|
} else if ($scope.sortColumn !== undefined &&
|
|
$scope.sortDirection === undefined) {
|
|
$scope.sortDirection = 'asc';
|
|
}
|
|
self.setRows($scope.rows);
|
|
self.setTimeOfInterest(self.conductor.timeOfInterest());
|
|
};
|
|
|
|
/*
|
|
* Define watches to listen for changes to headers and rows.
|
|
*/
|
|
$scope.$watchCollection('filters', function () {
|
|
self.setRows($scope.rows);
|
|
});
|
|
$scope.$watch('headers', this.setHeaders);
|
|
$scope.$watch('rows', this.setRows);
|
|
|
|
/*
|
|
* Listen for rows added individually (eg. for real-time tables)
|
|
*/
|
|
$scope.$on('add:row', this.addRow);
|
|
$scope.$on('remove:row', this.removeRow);
|
|
|
|
/**
|
|
* Populated from the default-sort attribute on MctTable
|
|
* directive tag.
|
|
*/
|
|
$scope.$watch('sortColumn', $scope.toggleSort);
|
|
|
|
/*
|
|
* Listen for resize events to trigger recalculation of table width
|
|
*/
|
|
$scope.resize = this.setElementSizes;
|
|
|
|
/**
|
|
* Scope variable that is populated from the 'time-columns'
|
|
* attribute on the MctTable tag. Indicates which columns, while
|
|
* sorted, can be used for indicated time of interest.
|
|
*/
|
|
$scope.$watch("timeColumns", function (timeColumns) {
|
|
if (timeColumns) {
|
|
this.destroyConductorListeners();
|
|
|
|
this.conductor.on('timeSystem', this.changeTimeSystem);
|
|
this.conductor.on('timeOfInterest', this.setTimeOfInterest);
|
|
this.conductor.on('bounds', this.changeBounds);
|
|
|
|
// If time system defined, set initially
|
|
if (this.conductor.timeSystem()) {
|
|
this.changeTimeSystem(this.conductor.timeSystem());
|
|
}
|
|
}
|
|
}.bind(this));
|
|
|
|
$scope.$on('$destroy', this.destroyConductorListeners);
|
|
}
|
|
|
|
MCTTableController.prototype.destroyConductorListeners = function () {
|
|
this.conductor.off('timeSystem', this.changeTimeSystem);
|
|
this.conductor.off('timeOfInterest', this.setTimeOfInterest);
|
|
this.conductor.off('bounds', this.changeBounds);
|
|
};
|
|
|
|
MCTTableController.prototype.changeTimeSystem = function () {
|
|
var format = this.conductor.timeSystem().formats()[0];
|
|
this.toiFormatter = this.formatService.getFormat(format);
|
|
};
|
|
|
|
/**
|
|
* If auto-scroll is enabled, this function will scroll to the
|
|
* bottom of the page
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.scrollToBottom = function () {
|
|
var self = this;
|
|
|
|
//Use timeout to defer execution until next digest when any
|
|
// pending UI changes have completed, eg. a new row in the table.
|
|
if (this.$scope.autoScroll) {
|
|
this.$timeout(function () {
|
|
self.scrollable[0].scrollTop = self.scrollable[0].scrollHeight;
|
|
});
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Handles a row add event. Rows can be added as needed using the
|
|
* `add:row` broadcast event.
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.addRow = function (event, rowIndex) {
|
|
var row = this.$scope.rows[rowIndex];
|
|
|
|
//Does the row pass the current filter?
|
|
if (this.filterRows([row]).length === 1) {
|
|
//Insert the row into the correct position in the array
|
|
this.insertSorted(this.$scope.displayRows, row);
|
|
|
|
//Resize the columns , then update the rows visible in the table
|
|
this.resize([this.$scope.sizingRow, row])
|
|
.then(this.setVisibleRows.bind(this))
|
|
.then(this.scrollToBottom.bind(this));
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Handles a row remove event. Rows can be removed as needed using the
|
|
* `remove:row` broadcast event.
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.removeRow = function (event, rowIndex) {
|
|
var row = this.$scope.rows[rowIndex],
|
|
// Do a sequential search here. Only way of finding row is by
|
|
// object equality, so array is in effect unsorted.
|
|
indexInDisplayRows = this.$scope.displayRows.indexOf(row);
|
|
if (indexInDisplayRows !== -1) {
|
|
this.$scope.displayRows.splice(indexInDisplayRows, 1);
|
|
this.setVisibleRows();
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.onScroll = function (event) {
|
|
//If user scrolls away from bottom, disable auto-scroll.
|
|
// Auto-scroll will be re-enabled if user scrolls to bottom again.
|
|
if (this.scrollable[0].scrollTop <
|
|
(this.scrollable[0].scrollHeight - this.scrollable[0].offsetHeight)) {
|
|
this.$scope.autoScroll = false;
|
|
} else {
|
|
this.$scope.autoScroll = true;
|
|
}
|
|
this.setVisibleRows();
|
|
this.$scope.$digest();
|
|
};
|
|
|
|
/**
|
|
* Return first visible row, based on current scroll state.
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.firstVisible = function () {
|
|
var target = this.scrollable[0],
|
|
topScroll = target.scrollTop,
|
|
firstVisible;
|
|
|
|
if (topScroll < this.$scope.headerHeight) {
|
|
firstVisible = 0;
|
|
} else {
|
|
firstVisible = Math.floor(
|
|
(topScroll - this.$scope.headerHeight) /
|
|
this.$scope.rowHeight
|
|
);
|
|
}
|
|
|
|
return firstVisible;
|
|
};
|
|
|
|
/**
|
|
* Return last visible row, based on current scroll state.
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.lastVisible = function () {
|
|
var target = this.scrollable[0],
|
|
topScroll = target.scrollTop,
|
|
bottomScroll = topScroll + target.offsetHeight,
|
|
lastVisible;
|
|
|
|
lastVisible = Math.ceil(
|
|
(bottomScroll - this.$scope.headerHeight) /
|
|
this.$scope.rowHeight
|
|
);
|
|
return lastVisible;
|
|
};
|
|
|
|
/**
|
|
* Sets visible rows based on array
|
|
* content and current scroll state.
|
|
*/
|
|
MCTTableController.prototype.setVisibleRows = function () {
|
|
var self = this,
|
|
totalVisible,
|
|
numberOffscreen,
|
|
firstVisible,
|
|
lastVisible,
|
|
start,
|
|
end;
|
|
|
|
//No need to scroll
|
|
if (this.$scope.displayRows.length < this.maxDisplayRows) {
|
|
start = 0;
|
|
end = this.$scope.displayRows.length;
|
|
} else {
|
|
firstVisible = this.firstVisible();
|
|
lastVisible = this.lastVisible();
|
|
totalVisible = lastVisible - firstVisible;
|
|
numberOffscreen = this.maxDisplayRows - totalVisible;
|
|
start = firstVisible - Math.floor(numberOffscreen / 2);
|
|
end = lastVisible + Math.ceil(numberOffscreen / 2);
|
|
|
|
if (start < 0) {
|
|
start = 0;
|
|
end = Math.min(this.maxDisplayRows,
|
|
this.$scope.displayRows.length);
|
|
} else if (end >= this.$scope.displayRows.length) {
|
|
end = this.$scope.displayRows.length;
|
|
start = end - this.maxDisplayRows + 1;
|
|
}
|
|
if (this.$scope.visibleRows[0] &&
|
|
this.$scope.visibleRows[0].rowIndex === start &&
|
|
this.$scope.visibleRows[this.$scope.visibleRows.length - 1]
|
|
.rowIndex === end) {
|
|
|
|
return; // don't update if no changes are required.
|
|
}
|
|
}
|
|
//Set visible rows from display rows, based on calculated offset.
|
|
this.$scope.visibleRows = this.$scope.displayRows.slice(start, end)
|
|
.map(function (row, i) {
|
|
return {
|
|
rowIndex: start + i,
|
|
offsetY: ((start + i) * self.$scope.rowHeight) +
|
|
self.$scope.headerHeight,
|
|
contents: row
|
|
};
|
|
});
|
|
};
|
|
|
|
/**
|
|
* Update table headers with new headers. If filtering is
|
|
* enabled, reset filters. If sorting is enabled, reset
|
|
* sorting.
|
|
*/
|
|
MCTTableController.prototype.setHeaders = function (newHeaders) {
|
|
if (!newHeaders) {
|
|
return;
|
|
}
|
|
|
|
this.$scope.displayHeaders = newHeaders;
|
|
if (this.$scope.enableFilter) {
|
|
this.$scope.filters = {};
|
|
}
|
|
// Reset column sort information unless the new headers
|
|
// contain the column currently sorted on.
|
|
if (this.$scope.enableSort &&
|
|
newHeaders.indexOf(this.$scope.sortColumn) === -1) {
|
|
this.$scope.sortColumn = undefined;
|
|
this.$scope.sortDirection = undefined;
|
|
}
|
|
this.setRows(this.$scope.rows);
|
|
};
|
|
|
|
/**
|
|
* Read styles from the DOM and use them to calculate offsets
|
|
* for individual rows.
|
|
*/
|
|
MCTTableController.prototype.setElementSizes = function () {
|
|
var thead = this.resultsHeader,
|
|
tbody = this.sizingTableBody,
|
|
firstRow = tbody.find('tr'),
|
|
column = firstRow.find('td'),
|
|
headerHeight = thead.prop('offsetHeight'),
|
|
rowHeight = firstRow.prop('offsetHeight'),
|
|
columnWidth,
|
|
tableWidth = 0,
|
|
overallHeight = headerHeight + (rowHeight *
|
|
(this.$scope.displayRows ? this.$scope.displayRows.length - 1 : 0));
|
|
|
|
this.$scope.columnWidths = [];
|
|
|
|
while (column.length) {
|
|
columnWidth = column.prop('offsetWidth');
|
|
this.$scope.columnWidths.push(column.prop('offsetWidth'));
|
|
tableWidth += columnWidth;
|
|
column = column.next();
|
|
}
|
|
this.$scope.headerHeight = headerHeight;
|
|
this.$scope.rowHeight = rowHeight;
|
|
this.$scope.totalHeight = overallHeight;
|
|
|
|
if (tableWidth > 0) {
|
|
this.$scope.totalWidth = tableWidth + 'px';
|
|
} else {
|
|
this.$scope.totalWidth = 'none';
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.binarySearch = function (searchArray, searchElement, min, max) {
|
|
var sampleAt = Math.floor((max - min) / 2) + min;
|
|
|
|
if (max < min) {
|
|
return min; // Element is not in array, min gives direction
|
|
}
|
|
switch (this.sortComparator(searchElement,
|
|
searchArray[sampleAt][this.$scope.sortColumn].text)) {
|
|
case -1:
|
|
return this.binarySearch(searchArray, searchElement, min,
|
|
sampleAt - 1);
|
|
case 0 :
|
|
return sampleAt;
|
|
case 1 :
|
|
return this.binarySearch(searchArray, searchElement,
|
|
sampleAt + 1, max);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.insertSorted = function (array, element) {
|
|
var index = -1;
|
|
|
|
if (!this.$scope.sortColumn || !this.$scope.sortDirection) {
|
|
//No sorting applied, push it on the end.
|
|
index = array.length;
|
|
} else {
|
|
//Sort is enabled, perform binary search to find insertion point
|
|
index = this.binarySearch(array, element[this.$scope.sortColumn].text, 0, array.length - 1);
|
|
}
|
|
if (index === -1) {
|
|
array.unshift(element);
|
|
} else if (index === array.length) {
|
|
array.push(element);
|
|
} else {
|
|
array.splice(index, 0, element);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Compare two variables, returning a number that represents
|
|
* which is larger. Similar to the default array sort
|
|
* comparator, but does not coerce all values to string before
|
|
* conversion. Strings are lowercased before comparison.
|
|
*
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.sortComparator = function (a, b) {
|
|
var result = 0,
|
|
sortDirectionMultiplier,
|
|
numberA,
|
|
numberB;
|
|
/**
|
|
* Given a value, if it is a number, or a string representation of a
|
|
* number, then return a number representation. Otherwise, return
|
|
* the original value. It's a little more robust than using just
|
|
* Number() or parseFloat, or isNaN in isolation, all of which are
|
|
* fairly inconsistent in their results.
|
|
* @param value The value to return as a number.
|
|
* @returns {*} The value cast to a Number, or the original value if
|
|
* a Number representation is not possible.
|
|
*/
|
|
function toNumber(value) {
|
|
var val = !isNaN(Number(value)) && !isNaN(parseFloat(value)) ? Number(value) : value;
|
|
return val;
|
|
}
|
|
|
|
numberA = toNumber(a);
|
|
numberB = toNumber(b);
|
|
|
|
//If they're both numbers, then compare them as numbers
|
|
if (typeof numberA === "number" && typeof numberB === "number") {
|
|
a = numberA;
|
|
b = numberB;
|
|
}
|
|
|
|
//If they're both strings, then ignore case
|
|
if (typeof a === "string" && typeof b === "string") {
|
|
a = a.toLowerCase();
|
|
b = b.toLowerCase();
|
|
}
|
|
|
|
if (a < b) {
|
|
result = -1;
|
|
}
|
|
if (a > b) {
|
|
result = 1;
|
|
}
|
|
|
|
if (this.$scope.sortDirection === 'asc') {
|
|
sortDirectionMultiplier = 1;
|
|
} else if (this.$scope.sortDirection === 'desc') {
|
|
sortDirectionMultiplier = -1;
|
|
}
|
|
|
|
return result * sortDirectionMultiplier;
|
|
};
|
|
|
|
/**
|
|
* Returns a new array which is a result of applying the sort
|
|
* criteria defined in $scope.
|
|
*
|
|
* Does not modify the array that was passed in.
|
|
*/
|
|
MCTTableController.prototype.sortRows = function (rowsToSort) {
|
|
var self = this,
|
|
sortKey = this.$scope.sortColumn;
|
|
|
|
if (!this.$scope.sortColumn || !this.$scope.sortDirection) {
|
|
return rowsToSort;
|
|
}
|
|
|
|
return rowsToSort.sort(function (a, b) {
|
|
return self.sortComparator(a[sortKey].text, b[sortKey].text);
|
|
});
|
|
};
|
|
|
|
/**
|
|
* Returns an object which contains the largest values
|
|
* for each key in the given set of rows. This is used to
|
|
* pre-calculate optimal column sizes without having to render
|
|
* every row.
|
|
*/
|
|
MCTTableController.prototype.buildLargestRow = function (rows) {
|
|
var largestRow = rows.reduce(function (prevLargest, row) {
|
|
Object.keys(row).forEach(function (key) {
|
|
var currentColumn,
|
|
currentColumnLength,
|
|
largestColumn,
|
|
largestColumnLength;
|
|
if (row[key]) {
|
|
currentColumn = (row[key]).text;
|
|
currentColumnLength =
|
|
(currentColumn && currentColumn.length) ?
|
|
currentColumn.length :
|
|
currentColumn;
|
|
largestColumn = prevLargest[key] ? prevLargest[key].text : "";
|
|
largestColumnLength = largestColumn.length;
|
|
|
|
if (currentColumnLength > largestColumnLength) {
|
|
prevLargest[key] = JSON.parse(JSON.stringify(row[key]));
|
|
}
|
|
}
|
|
});
|
|
return prevLargest;
|
|
}, JSON.parse(JSON.stringify(rows[0] || {})));
|
|
return largestRow;
|
|
};
|
|
|
|
/**
|
|
* Calculates the widest row in the table, and if necessary, resizes
|
|
* the table accordingly
|
|
*
|
|
* @param rows the rows on which to resize
|
|
* @returns {Promise} a promise that will resolve when resizing has
|
|
* occurred.
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.resize = function (rows) {
|
|
this.$scope.sizingRow = this.buildLargestRow(rows);
|
|
return this.$timeout(this.setElementSizes.bind(this));
|
|
};
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.filterAndSort = function (rows) {
|
|
var displayRows = rows;
|
|
if (this.$scope.enableFilter) {
|
|
displayRows = this.filterRows(displayRows);
|
|
}
|
|
|
|
if (this.$scope.enableSort) {
|
|
displayRows = this.sortRows(displayRows.slice(0));
|
|
}
|
|
return displayRows;
|
|
};
|
|
|
|
/**
|
|
* Update rows with new data. If filtering is enabled, rows
|
|
* will be sorted before display.
|
|
*/
|
|
MCTTableController.prototype.setRows = function (newRows) {
|
|
//Nothing to show because no columns visible
|
|
if (!this.$scope.displayHeaders || !newRows) {
|
|
return;
|
|
}
|
|
|
|
this.$scope.displayRows = this.filterAndSort(newRows || []);
|
|
this.resize(newRows)
|
|
.then(this.setVisibleRows)
|
|
//Timeout following setVisibleRows to allow digest to
|
|
// perform DOM changes, otherwise scrollTo won't work.
|
|
.then(this.$timeout)
|
|
.then(function () {
|
|
//If TOI specified, scroll to it
|
|
var timeOfInterest = this.conductor.timeOfInterest();
|
|
if (timeOfInterest) {
|
|
this.setTimeOfInterest(timeOfInterest);
|
|
}
|
|
}.bind(this));
|
|
|
|
};
|
|
|
|
/**
|
|
* Applies user defined filters to rows. These filters are based on
|
|
* the text entered in the search areas in each column.
|
|
* @param rowsToFilter {Object[]} The rows to apply filters to
|
|
* @returns {Object[]} A filtered copy of the supplied rows
|
|
*/
|
|
MCTTableController.prototype.filterRows = function (rowsToFilter) {
|
|
var filters = {},
|
|
self = this;
|
|
|
|
/**
|
|
* Returns true if row matches all filters.
|
|
*/
|
|
function matchRow(filterMap, row) {
|
|
return Object.keys(filterMap).every(function (key) {
|
|
if (!row[key]) {
|
|
return false;
|
|
}
|
|
var testVal = String(row[key].text).toLowerCase();
|
|
return testVal.indexOf(filterMap[key]) !== -1;
|
|
});
|
|
}
|
|
|
|
if (!Object.keys(this.$scope.filters).length) {
|
|
return rowsToFilter;
|
|
}
|
|
|
|
Object.keys(this.$scope.filters).forEach(function (key) {
|
|
if (!self.$scope.filters[key]) {
|
|
return;
|
|
}
|
|
filters[key] = self.$scope.filters[key].toLowerCase();
|
|
});
|
|
|
|
return rowsToFilter.filter(matchRow.bind(null, filters));
|
|
};
|
|
|
|
/**
|
|
* @param displayRowIndex {number} The index in the displayed rows
|
|
* to scroll to.
|
|
*/
|
|
MCTTableController.prototype.scrollToRow = function (displayRowIndex) {
|
|
|
|
var visible = displayRowIndex > this.firstVisible() && displayRowIndex < this.lastVisible();
|
|
|
|
if (!visible) {
|
|
var scrollTop = displayRowIndex * this.$scope.rowHeight +
|
|
this.$scope.headerHeight -
|
|
(this.scrollable[0].offsetHeight / 2);
|
|
this.scrollable[0].scrollTop = scrollTop;
|
|
this.setVisibleRows();
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Update rows with new data. If filtering is enabled, rows
|
|
* will be sorted before display.
|
|
*/
|
|
MCTTableController.prototype.setTimeOfInterest = function (newTOI) {
|
|
var isSortedByTime =
|
|
this.$scope.timeColumns &&
|
|
this.$scope.timeColumns.indexOf(this.$scope.sortColumn) !== -1;
|
|
|
|
this.$scope.toiRowIndex = -1;
|
|
|
|
if (newTOI && isSortedByTime) {
|
|
var formattedTOI = this.toiFormatter.format(newTOI);
|
|
var rowIndex = this.binarySearch(
|
|
this.$scope.displayRows,
|
|
formattedTOI,
|
|
0,
|
|
this.$scope.displayRows.length - 1);
|
|
|
|
if (rowIndex > 0 && rowIndex < this.$scope.displayRows.length) {
|
|
this.$scope.toiRowIndex = rowIndex;
|
|
this.scrollToRow(this.$scope.toiRowIndex);
|
|
}
|
|
}
|
|
};
|
|
|
|
/**
|
|
* On zoom, pan, etc. reset TOI
|
|
* @param bounds
|
|
*/
|
|
MCTTableController.prototype.changeBounds = function (bounds) {
|
|
this.setTimeOfInterest(this.conductor.timeOfInterest());
|
|
};
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
MCTTableController.prototype.onRowClick = function (event, rowIndex) {
|
|
if (this.$scope.timeColumns.indexOf(this.$scope.sortColumn) !== -1) {
|
|
var selectedTime = this.$scope.displayRows[rowIndex][this.$scope.sortColumn].text;
|
|
if (selectedTime &&
|
|
this.toiFormatter.validate(selectedTime) &&
|
|
event.altKey) {
|
|
this.conductor.timeOfInterest(this.toiFormatter.parse(selectedTime));
|
|
}
|
|
}
|
|
};
|
|
|
|
return MCTTableController;
|
|
}
|
|
);
|