modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 4 modules/enterprise/gui/coregui/src/main/webapp/CoreGUI-4.9.0.css | 405 ++ modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css | 405 -- modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html | 4 modules/enterprise/gui/coregui/src/main/webapp/css/charts-4.9.0.css | 252 + modules/enterprise/gui/coregui/src/main/webapp/css/charts.css | 252 - modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.js | 1400 ++++++++++ modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.min.js | 6 modules/enterprise/gui/coregui/src/main/webapp/js/moment.js | 1400 ---------- modules/enterprise/gui/coregui/src/main/webapp/js/moment.min.js | 6 modules/enterprise/gui/coregui/src/main/webapp/js/rhq-4.9.0.js | 183 + modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js | 183 - 12 files changed, 2250 insertions(+), 2250 deletions(-)
New commits: commit a7747a6389c5bade4ad7aa6cac9966544b1e93a1 Author: Mike Thompson mithomps@redhat.com Date: Tue Sep 17 07:34:31 2013 -0700
[BZ 1007538] - Add versioning to *.js and *.css files to prevent browser caching. Fixed current versioning issues with upgrading from RHQ 4.8.0 with manual versioning of css and js assets.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index a71b26e..e6be67e 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -50,8 +50,8 @@ <when-type-assignable class="com.google.gwt.user.client.rpc.RemoteService"/> </generate-with>
- <script src="/coregui/js/moment.min.js"/> - <script src="/coregui/js/rhq.js"/> + <script src="/coregui/js/moment-2.0.0.min.js"/> + <script src="/coregui/js/rhq-4.9.0.js"/> <!-- External javascript libraries --> <!-- jquery.sparkline requires jquery. --> diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI-4.9.0.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI-4.9.0.css new file mode 100644 index 0000000..dac51cc --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI-4.9.0.css @@ -0,0 +1,405 @@ +body { + color: #010101; +} + +body, p, td, th, option, input, textarea, select { + font-family: tahoma, verdana, sans-serif !important; + font-size: 11px !important; +} + +img { + border-style: none; +} + +hr { + background-color: #AAAAAA; + border: 0 none; + color: #AAAAAA; + height: 1px; + margin-left: 0; + margin-right: 0; + text-align: center; + width: 100%; +} + +a, a:link, a:visited, a:hover { + color: #4A5D75 !important; + font-weight: bold !important; +} + +a, a:link, a:visited { + text-decoration: none !important; +} + +a:hover { + text-decoration: underline !important; +} + +a.menuBar, a.menuBar:link, a.menuBar:visited, a.menuBar:hover { + color: inherit !important; +} + + +.backLink { + color: #4A5D75; + font-weight: bold; + text-decoration: none; +} + + +.HeaderLabel { + height: 35px; + font-size: 11pt; + font-weight: bold; + color: #444444; +} + + +.OddRow { + background-color: #ffffff; + border-right: 1px solid rgb(217, 224, 227); + border-bottom: 1px solid rgb(230, 234, 239); +} + +.OddRowDisabled { + background-color: #ffffff; + border-right: 1px solid rgb(217, 224, 227); + border-bottom: 1px solid rgb(230, 234, 239); +} + +.EvenRow { + background-color: rgb(246, 246, 246); + border-right: 1px solid rgb(217, 224, 227); + border-bottom: 1px solid rgb(230, 234, 239); +} + +.EvenRowDisabled { + background-color: rgb(246, 246, 246); + border-right: 1px solid rgb(217, 224, 227); + border-bottom: 1px solid rgb(230, 234, 239); +} + +.inheritColor { + color: inherit !important; +} + +.TopSectionLink, .TopSectionLinkSelected { + font-size: 12px !important; +} + +.TopSectionLink { + color: #4A5D75 !important; +} + +.TopSectionLinkSelected { + color: white !important; +} + +.TopSectionLinkDiv { +} + +.TopSectionLinkDivSelected { + background-image: url('images/header/header_bg_selected.png'); +} + +.BreadCrumb { + font-size: 10pt; + font-weight: bold; + text-decoration: none; + color: #363636; + height: 28px; +} + +.SectionHeader { + font-size: 16pt; + font-weight: bold; +} + +.textItemDisabled { + background: rgb(214, 213, 217); +} + +.formTitle, .formTitleFocused { + font-weight: bold; +} + +.subtitle { + color: #D6D6D6; + font-variant: small-caps; + font-weight: bold; + font-size: 12pt; +} + + +/* Availability Bar */ +.availBarLeftCap { + background-image: url("images/availBar/leftCap.png"); + width: 8px; + height: 28px; +} +.availBarRightCap { + background-image: url("images/availBar/rightCap.png"); + width: 8px; + height: 28px; +} + +.availBarUp { + background-image: url("images/availBar/up.png"); + background-repeat: repeat-x; + height: 28px; +} + +.availBarDown { + background: url("images/availBar/down.png") repeat-x; + height: 28px; +} + + + +.GraphTooltip { + background-color:#B5D5FF; + font-weight:bold; + padding:5px; +} + + +/* About Modal Window */ +.DisplayContent,.DisplayLabel { + font-size: 11px; +} + +.DisplayLabel { + font-weight: bold; +} + +.DisplaySubhead { + font-weight: bolder; + font-size: 16px; + color: #DE652D; +} + + +.SubTabButton, +.SubTabButtonOver, +.SubTabButtonFocused, +.SubTabButtonFocusedOver, +.SubTabButtonDown, +.SubTabButtonFocusedDown, +.SubTabButtonSelected, +.SubTabButtonSelectedFocused, +.SubTabButtonSelectedDown, +.SubTabButtonSelectedFocusedDown, +.SubTabButtonSelectedOver, +.SubTabButtonSelectedFocusedOver, +.SubTabButtonDisabled, +.SubTabButtonSelectedDisabled { + font-family: tahoma, verdona, sans-serif; + font-size: 11px; + padding: 2px; + } + +.SubTabButtonDisabled { + +} + +.SubTabButtonDisabled, +.SubTabButtonSelectedDisabled { + font-weight: normal; + color: #AAAAAA; +} + +.SubTabButtonFocused, +.SubTabButtonFocusedOver, +.SubTabButtonSelectedFocused, +.SubTabButtonSelectedFocusedOver, +.SubTabButtonSelectedFocusedDown { + +} + +.SubTabButtonOver, +.SubTabButtonFocusedOver, +.SubTabButtonSelectedFocused, +.SubTabButtonSelectedFocusedOver { + font-weight: bold; +} + +.SubTabButtonDown, +.SubTabButtonFocusedDown, +.SubTabButtonSelectedDown, +.SubTabButtonSelectedFocusedDown { + font-weight: bold; + font-size: 12px; +} + +.SubTabButtonSelected, +.SubTabButtonSelectedFocused, +.SubTabButtonSelectedOver, +.SubTabButtonSelectedFocusedOver, +.SubTabButtonSelectedDisabled { + font-weight: bold; +} + + + +.SimpleButton, +.SimpleButtonOver, +.SimpleButtonFocused, +.SimpleButtonFocusedOver, +.SimpleButtonDown, +.SimpleButtonFocusedDown, +.SimpleButtonSelected, +.SimpleButtonSelectedFocused, +.SimpleButtonSelectedDown, +.SimpleButtonSelectedFocusedDown, +.SimpleButtonSelectedOver, +.SimpleButtonSelectedFocusedOver, +.SimpleButtonDisabled, +.SimpleButtonSelectedDisabled, +.SimpleButtonDisabled, +.SimpleButtonDisabled, +.SimpleButtonSelectedDisabled, +.SimpleButtonFocused, +.SimpleButtonFocusedOver, +.SimpleButtonSelectedFocused, +.SimpleButtonSelectedFocusedOver, +.SimpleButtonSelectedFocusedDown , +.SimpleButtonOver, +.SimpleButtonFocusedOver, +.SimpleButtonSelectedFocused, +.SimpleButtonSelectedFocusedOver , +.SimpleButtonDown, +.SimpleButtonFocusedDown, +.SimpleButtonSelectedDown, +.SimpleButtonSelectedFocusedDown , +.SimpleButtonSelected, +.SimpleButtonSelectedFocused, +.SimpleButtonSelectedOver, +.SimpleButtonSelectedFocusedOver, +.SimpleButtonSelectedDisabled{ + font-family: tahoma, verdana, sans-serif; + font-size: 11px; + padding: 2px; + font-weight: bold; +} + + +.topMenuBar { + background: url('/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skins/Enterprise/images/cssButton/button_stretch.png') repeat-x scroll 0 0 #DDDDDD; +} + +.menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled { + border: none !important; + font-weight: bold !important; +} + + + +/** Not used right now **/ +.gwtMenuBar { + background: url('images/header/header_bg.png') repeat-x; + /*background-image: url("http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skin... + padding: 0px; + -moz-box-sizing: border-box; + overflow: hidden; + cursor: auto; +} + +.gwtMenu, .gwt-MenuBarPopup, .gwt-MenuPopup { + background-color: white; +} + +.gwt-MenuItem { + padding: 0 10px; + font-weight: bold; + color: #666666; + font-size: 9pt; +} + +.gwt-MenuItemSeparator { + background-color: #666666; +} + +.gwt-MenuItem-Selected { + background-color: #999999; +} + +.selectedTag { + background-color: lightblue; + padding: 5px; + border: 1px solid darkblue; +} + + +/* This sets table mouse-over highlights to have an alpha component on browsers that support it. + It particularly helps with tables that have bar charts as a background component. + (e.g. problem metrics or call time) +*/ +.tallCellOver, .tallCellOverDark { + background-color: rgb(230,230,230) !important; /* for browsers that don't like alpha */ + background-color: rgba(230,230,230,0.6) !important; +} + +.editableText { + color: #070; +} + +.InfoBlock,.ConfirmationBlock,.WarnBlock,.ErrorBlock,.FatalBlock { + border: 1px solid; + color: #000000; +} + +.InfoBlock,.ConfirmationBlock { + background-color: #BFF1B5; /* light green */ + border-color: #00AC3D; /* medium green */ +} + +.WarnBlock { + background-color: #FFFD99; /* light yellow */ + border-color: #FF9C15; /* medium orange */ +} + +.ErrorBlock { + background-color: #FF9999; /* light red */ + border-color: #EE4444; /* medium red */ +} + +.FatalBlock { + background-color: #FF6666; /* slightly darker light red */ + border-color: #EE1111; /* slightly darker medium red */ +} + +.InlineNote { + color: #C22; +} + +.InlineInfo { + color: #00AC3D; /* medium green */ +} + +.InlineError { + color: #EE4444; /* medium red */ +} + +.log-panel { + z-index: 9999999 !important; +} + +.requiredFieldMarker { + font-weight: bolder; + color: #B77 /* medium red */ +} + +.configurationEditorHeaderCell { + border: 1px solid; + background-color: #EEE; /* light gray */ + font-weight: bolder; +} + +.menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled { + border: none; + font-weight: bold; +} + +.noOutline { + outline:0; +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css deleted file mode 100644 index dac51cc..0000000 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ /dev/null @@ -1,405 +0,0 @@ -body { - color: #010101; -} - -body, p, td, th, option, input, textarea, select { - font-family: tahoma, verdana, sans-serif !important; - font-size: 11px !important; -} - -img { - border-style: none; -} - -hr { - background-color: #AAAAAA; - border: 0 none; - color: #AAAAAA; - height: 1px; - margin-left: 0; - margin-right: 0; - text-align: center; - width: 100%; -} - -a, a:link, a:visited, a:hover { - color: #4A5D75 !important; - font-weight: bold !important; -} - -a, a:link, a:visited { - text-decoration: none !important; -} - -a:hover { - text-decoration: underline !important; -} - -a.menuBar, a.menuBar:link, a.menuBar:visited, a.menuBar:hover { - color: inherit !important; -} - - -.backLink { - color: #4A5D75; - font-weight: bold; - text-decoration: none; -} - - -.HeaderLabel { - height: 35px; - font-size: 11pt; - font-weight: bold; - color: #444444; -} - - -.OddRow { - background-color: #ffffff; - border-right: 1px solid rgb(217, 224, 227); - border-bottom: 1px solid rgb(230, 234, 239); -} - -.OddRowDisabled { - background-color: #ffffff; - border-right: 1px solid rgb(217, 224, 227); - border-bottom: 1px solid rgb(230, 234, 239); -} - -.EvenRow { - background-color: rgb(246, 246, 246); - border-right: 1px solid rgb(217, 224, 227); - border-bottom: 1px solid rgb(230, 234, 239); -} - -.EvenRowDisabled { - background-color: rgb(246, 246, 246); - border-right: 1px solid rgb(217, 224, 227); - border-bottom: 1px solid rgb(230, 234, 239); -} - -.inheritColor { - color: inherit !important; -} - -.TopSectionLink, .TopSectionLinkSelected { - font-size: 12px !important; -} - -.TopSectionLink { - color: #4A5D75 !important; -} - -.TopSectionLinkSelected { - color: white !important; -} - -.TopSectionLinkDiv { -} - -.TopSectionLinkDivSelected { - background-image: url('images/header/header_bg_selected.png'); -} - -.BreadCrumb { - font-size: 10pt; - font-weight: bold; - text-decoration: none; - color: #363636; - height: 28px; -} - -.SectionHeader { - font-size: 16pt; - font-weight: bold; -} - -.textItemDisabled { - background: rgb(214, 213, 217); -} - -.formTitle, .formTitleFocused { - font-weight: bold; -} - -.subtitle { - color: #D6D6D6; - font-variant: small-caps; - font-weight: bold; - font-size: 12pt; -} - - -/* Availability Bar */ -.availBarLeftCap { - background-image: url("images/availBar/leftCap.png"); - width: 8px; - height: 28px; -} -.availBarRightCap { - background-image: url("images/availBar/rightCap.png"); - width: 8px; - height: 28px; -} - -.availBarUp { - background-image: url("images/availBar/up.png"); - background-repeat: repeat-x; - height: 28px; -} - -.availBarDown { - background: url("images/availBar/down.png") repeat-x; - height: 28px; -} - - - -.GraphTooltip { - background-color:#B5D5FF; - font-weight:bold; - padding:5px; -} - - -/* About Modal Window */ -.DisplayContent,.DisplayLabel { - font-size: 11px; -} - -.DisplayLabel { - font-weight: bold; -} - -.DisplaySubhead { - font-weight: bolder; - font-size: 16px; - color: #DE652D; -} - - -.SubTabButton, -.SubTabButtonOver, -.SubTabButtonFocused, -.SubTabButtonFocusedOver, -.SubTabButtonDown, -.SubTabButtonFocusedDown, -.SubTabButtonSelected, -.SubTabButtonSelectedFocused, -.SubTabButtonSelectedDown, -.SubTabButtonSelectedFocusedDown, -.SubTabButtonSelectedOver, -.SubTabButtonSelectedFocusedOver, -.SubTabButtonDisabled, -.SubTabButtonSelectedDisabled { - font-family: tahoma, verdona, sans-serif; - font-size: 11px; - padding: 2px; - } - -.SubTabButtonDisabled { - -} - -.SubTabButtonDisabled, -.SubTabButtonSelectedDisabled { - font-weight: normal; - color: #AAAAAA; -} - -.SubTabButtonFocused, -.SubTabButtonFocusedOver, -.SubTabButtonSelectedFocused, -.SubTabButtonSelectedFocusedOver, -.SubTabButtonSelectedFocusedDown { - -} - -.SubTabButtonOver, -.SubTabButtonFocusedOver, -.SubTabButtonSelectedFocused, -.SubTabButtonSelectedFocusedOver { - font-weight: bold; -} - -.SubTabButtonDown, -.SubTabButtonFocusedDown, -.SubTabButtonSelectedDown, -.SubTabButtonSelectedFocusedDown { - font-weight: bold; - font-size: 12px; -} - -.SubTabButtonSelected, -.SubTabButtonSelectedFocused, -.SubTabButtonSelectedOver, -.SubTabButtonSelectedFocusedOver, -.SubTabButtonSelectedDisabled { - font-weight: bold; -} - - - -.SimpleButton, -.SimpleButtonOver, -.SimpleButtonFocused, -.SimpleButtonFocusedOver, -.SimpleButtonDown, -.SimpleButtonFocusedDown, -.SimpleButtonSelected, -.SimpleButtonSelectedFocused, -.SimpleButtonSelectedDown, -.SimpleButtonSelectedFocusedDown, -.SimpleButtonSelectedOver, -.SimpleButtonSelectedFocusedOver, -.SimpleButtonDisabled, -.SimpleButtonSelectedDisabled, -.SimpleButtonDisabled, -.SimpleButtonDisabled, -.SimpleButtonSelectedDisabled, -.SimpleButtonFocused, -.SimpleButtonFocusedOver, -.SimpleButtonSelectedFocused, -.SimpleButtonSelectedFocusedOver, -.SimpleButtonSelectedFocusedDown , -.SimpleButtonOver, -.SimpleButtonFocusedOver, -.SimpleButtonSelectedFocused, -.SimpleButtonSelectedFocusedOver , -.SimpleButtonDown, -.SimpleButtonFocusedDown, -.SimpleButtonSelectedDown, -.SimpleButtonSelectedFocusedDown , -.SimpleButtonSelected, -.SimpleButtonSelectedFocused, -.SimpleButtonSelectedOver, -.SimpleButtonSelectedFocusedOver, -.SimpleButtonSelectedDisabled{ - font-family: tahoma, verdana, sans-serif; - font-size: 11px; - padding: 2px; - font-weight: bold; -} - - -.topMenuBar { - background: url('/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skins/Enterprise/images/cssButton/button_stretch.png') repeat-x scroll 0 0 #DDDDDD; -} - -.menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled { - border: none !important; - font-weight: bold !important; -} - - - -/** Not used right now **/ -.gwtMenuBar { - background: url('images/header/header_bg.png') repeat-x; - /*background-image: url("http://localhost:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skin... - padding: 0px; - -moz-box-sizing: border-box; - overflow: hidden; - cursor: auto; -} - -.gwtMenu, .gwt-MenuBarPopup, .gwt-MenuPopup { - background-color: white; -} - -.gwt-MenuItem { - padding: 0 10px; - font-weight: bold; - color: #666666; - font-size: 9pt; -} - -.gwt-MenuItemSeparator { - background-color: #666666; -} - -.gwt-MenuItem-Selected { - background-color: #999999; -} - -.selectedTag { - background-color: lightblue; - padding: 5px; - border: 1px solid darkblue; -} - - -/* This sets table mouse-over highlights to have an alpha component on browsers that support it. - It particularly helps with tables that have bar charts as a background component. - (e.g. problem metrics or call time) -*/ -.tallCellOver, .tallCellOverDark { - background-color: rgb(230,230,230) !important; /* for browsers that don't like alpha */ - background-color: rgba(230,230,230,0.6) !important; -} - -.editableText { - color: #070; -} - -.InfoBlock,.ConfirmationBlock,.WarnBlock,.ErrorBlock,.FatalBlock { - border: 1px solid; - color: #000000; -} - -.InfoBlock,.ConfirmationBlock { - background-color: #BFF1B5; /* light green */ - border-color: #00AC3D; /* medium green */ -} - -.WarnBlock { - background-color: #FFFD99; /* light yellow */ - border-color: #FF9C15; /* medium orange */ -} - -.ErrorBlock { - background-color: #FF9999; /* light red */ - border-color: #EE4444; /* medium red */ -} - -.FatalBlock { - background-color: #FF6666; /* slightly darker light red */ - border-color: #EE1111; /* slightly darker medium red */ -} - -.InlineNote { - color: #C22; -} - -.InlineInfo { - color: #00AC3D; /* medium green */ -} - -.InlineError { - color: #EE4444; /* medium red */ -} - -.log-panel { - z-index: 9999999 !important; -} - -.requiredFieldMarker { - font-weight: bolder; - color: #B77 /* medium red */ -} - -.configurationEditorHeaderCell { - border: 1px solid; - background-color: #EEE; /* light gray */ - font-weight: bolder; -} - -.menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled { - border: none; - font-weight: bold; -} - -.noOutline { - outline:0; -} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html index 2567253..6499483 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html @@ -10,9 +10,9 @@ <!-- support internationalized characters --> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
- <link rel="stylesheet" href="CoreGUI.css"> + <link rel="stylesheet" href="CoreGUI-4.9.0.css"> <!-- for d3 charting --> - <link rel="stylesheet" href="css/charts.css"> + <link rel="stylesheet" href="css/charts-4.9.0.css">
<script type="text/javascript"> var search = location.search; diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/charts-4.9.0.css b/modules/enterprise/gui/coregui/src/main/webapp/css/charts-4.9.0.css new file mode 100644 index 0000000..0d123b2 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/webapp/css/charts-4.9.0.css @@ -0,0 +1,252 @@ +/*** + * CSS for the d3 SVG charts. This is SVG css not HTML css so some elements + * may look different from standard CSS. + * NOTE: the SVG <defs> section that contains gradients etc. is in the + * java class : /org/rhq/enterprise/gui/coregui/client/inventory/common/ResourceMetricD3Graph.java + * + */ + +svg { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* Trying to get SVG to act like a greedy block in all browsers */ + display: block; + width:100%; + height:100%; +} + + + +.axis path, .axis line { + fill: none; + stroke: #000; + shape-rendering: crispEdges; +} + +/* Horizontal gridlines */ + +.grid .tick { + stroke: #f7f7f7; +} + +.y.axis .tick.minor { + stroke: #a7a7ac; +} + +.x.axis .tick.minor { + stroke: #a7a7ac; +} + +.y.axis text, .x.axis text { + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-weight: normal; + font-style: normal; + fill: #50505a; + text-rendering: optimize-legibility; + +} + +.x.axis path { + stroke: #50505a; +} + +.y.axis path { + stroke: #50505a; +} + /* Brush related css rules */ +.brush rect.extent { + fill: #0757ff; + fill-opacity: .15; + shape-rendering: crispEdges; +} + +.brush .resize path { + fill: #666; + fill-opacity: .8; + stroke: #000; + stroke-width: 1.5px; +} + +.minLabel, .avgLabel, .highLabel { + font-family: Arial, Verdana, sans-serif; + font-size: 12px; + font-weight: bold; + text-anchor: start; + fill: #003168; + text-rendering: optimize-legibility; +} + +.minText, .avgText, .highText { + font-family: Arial, Verdana, sans-serif; + font-size: 12px; + text-anchor: start; + fill: #003168; + text-rendering: optimize-legibility; +} + +.chartTitleName { + font-family: Arial, Verdana, sans-serif; + font-size: 12px; + font-weight: bold; + fill: #003168; +} +.chartTitleBox { + fill:none; + +} + +rect.high { + fill: #1794bc; +} + +rect.low { + fill: #70c4e2; +} + + + +/* CSS for new Chart Hovers*/ + +#availTooltip { + z-index: 990000; + position: absolute; + width: 150px; + height: auto; + padding: 5px; + background-color: #000; + opacity: 0.8; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + pointer-events: none; +} + +#availTooltip.hidden { + display: none; +} + +#availTooltip div { + margin: 0; + font-family: Arial, Verdana, sans-serif; + font-size: 9px; + color: #d3d3d6; +} + +.availTooltipLabel { + width: 40px; + font-weight: bold; + color: #d3d3d6; +} + +/* CSS for metric graph tooltips */ +#metricGraphTooltip { + z-index: 990000; + position: absolute; + width: 100px; + height: auto; + padding: 5px; + background-color: #000; + opacity: 0.80; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + pointer-events: none; +} + +#metricGraphTooltip.hidden { + display: none; +} + +#metricGraphTooltip div { + margin: 0; + font-family: Arial, Verdana, sans-serif; + font-size: 10px; + color: #d3d3d6; +} + +#metricGraphTooltipLabel { + width: 40px; + font-weight: bold; + color: #d3d3d6; +} + +#metricGraphTooltipMaxLabel { + color: #1794BC; +} + +#metricGraphTooltipAvgLabel { + color: #2e376a; +} + +#metricGraphTooltipMinLabel { + color: #70c4e2; +} + +#noDataTooltip { + z-index: 990000; + position: absolute; + width: 100px; + height: auto; + padding: 5px; + background-color: #000; + opacity: 0.80; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + pointer-events: none; +} + +#noDataTooltip.hidden { + display: none; +} + +#noDataTooltip div { + margin: 0; + font-family: Arial, Verdana, sans-serif; + font-size: 10px; + color: #d3d3d6; +} + + +#singleValueTooltip { + z-index: 990000; + position: absolute; + width: 100px; + height: auto; + padding: 5px; + background-color: #000; + opacity: 0.80; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); + pointer-events: none; +} + +#singleValueTooltip.hidden { + display: none; +} + +#singleValueTooltip div { + margin: 0; + font-family: Arial, Verdana, sans-serif; + font-size: 10px; + color: #d3d3d6; +} + diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css deleted file mode 100644 index 0d123b2..0000000 --- a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css +++ /dev/null @@ -1,252 +0,0 @@ -/*** - * CSS for the d3 SVG charts. This is SVG css not HTML css so some elements - * may look different from standard CSS. - * NOTE: the SVG <defs> section that contains gradients etc. is in the - * java class : /org/rhq/enterprise/gui/coregui/client/inventory/common/ResourceMetricD3Graph.java - * - */ - -svg { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - /* Trying to get SVG to act like a greedy block in all browsers */ - display: block; - width:100%; - height:100%; -} - - - -.axis path, .axis line { - fill: none; - stroke: #000; - shape-rendering: crispEdges; -} - -/* Horizontal gridlines */ - -.grid .tick { - stroke: #f7f7f7; -} - -.y.axis .tick.minor { - stroke: #a7a7ac; -} - -.x.axis .tick.minor { - stroke: #a7a7ac; -} - -.y.axis text, .x.axis text { - font-family: Arial, Helvetica, sans-serif; - font-size: 10px; - font-weight: normal; - font-style: normal; - fill: #50505a; - text-rendering: optimize-legibility; - -} - -.x.axis path { - stroke: #50505a; -} - -.y.axis path { - stroke: #50505a; -} - /* Brush related css rules */ -.brush rect.extent { - fill: #0757ff; - fill-opacity: .15; - shape-rendering: crispEdges; -} - -.brush .resize path { - fill: #666; - fill-opacity: .8; - stroke: #000; - stroke-width: 1.5px; -} - -.minLabel, .avgLabel, .highLabel { - font-family: Arial, Verdana, sans-serif; - font-size: 12px; - font-weight: bold; - text-anchor: start; - fill: #003168; - text-rendering: optimize-legibility; -} - -.minText, .avgText, .highText { - font-family: Arial, Verdana, sans-serif; - font-size: 12px; - text-anchor: start; - fill: #003168; - text-rendering: optimize-legibility; -} - -.chartTitleName { - font-family: Arial, Verdana, sans-serif; - font-size: 12px; - font-weight: bold; - fill: #003168; -} -.chartTitleBox { - fill:none; - -} - -rect.high { - fill: #1794bc; -} - -rect.low { - fill: #70c4e2; -} - - - -/* CSS for new Chart Hovers*/ - -#availTooltip { - z-index: 990000; - position: absolute; - width: 150px; - height: auto; - padding: 5px; - background-color: #000; - opacity: 0.8; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - pointer-events: none; -} - -#availTooltip.hidden { - display: none; -} - -#availTooltip div { - margin: 0; - font-family: Arial, Verdana, sans-serif; - font-size: 9px; - color: #d3d3d6; -} - -.availTooltipLabel { - width: 40px; - font-weight: bold; - color: #d3d3d6; -} - -/* CSS for metric graph tooltips */ -#metricGraphTooltip { - z-index: 990000; - position: absolute; - width: 100px; - height: auto; - padding: 5px; - background-color: #000; - opacity: 0.80; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - pointer-events: none; -} - -#metricGraphTooltip.hidden { - display: none; -} - -#metricGraphTooltip div { - margin: 0; - font-family: Arial, Verdana, sans-serif; - font-size: 10px; - color: #d3d3d6; -} - -#metricGraphTooltipLabel { - width: 40px; - font-weight: bold; - color: #d3d3d6; -} - -#metricGraphTooltipMaxLabel { - color: #1794BC; -} - -#metricGraphTooltipAvgLabel { - color: #2e376a; -} - -#metricGraphTooltipMinLabel { - color: #70c4e2; -} - -#noDataTooltip { - z-index: 990000; - position: absolute; - width: 100px; - height: auto; - padding: 5px; - background-color: #000; - opacity: 0.80; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - pointer-events: none; -} - -#noDataTooltip.hidden { - display: none; -} - -#noDataTooltip div { - margin: 0; - font-family: Arial, Verdana, sans-serif; - font-size: 10px; - color: #d3d3d6; -} - - -#singleValueTooltip { - z-index: 990000; - position: absolute; - width: 100px; - height: auto; - padding: 5px; - background-color: #000; - opacity: 0.80; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - pointer-events: none; -} - -#singleValueTooltip.hidden { - display: none; -} - -#singleValueTooltip div { - margin: 0; - font-family: Arial, Verdana, sans-serif; - font-size: 10px; - color: #d3d3d6; -} - diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.js b/modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.js new file mode 100644 index 0000000..30a0a6c --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.js @@ -0,0 +1,1400 @@ +// moment.js +// version : 2.0.0 +// author : Tim Wood +// license : MIT +// momentjs.com + +(function (undefined) { + + /************************************ + Constants + ************************************/ + + var moment, + VERSION = "2.0.0", + round = Math.round, i, + // internal storage for language config files + languages = {}, + + // check for nodeJS + hasModule = (typeof module !== 'undefined' && module.exports), + + // ASP.NET json date format regex + aspNetJsonRegex = /^/?Date((-?\d+)/i, + + // format tokens + formattingTokens = /([[^[]*])|(\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g, + localFormattingTokens = /([[^[]*])|(\)?(LT|LL?L?L?|l{1,4})/g, + + // parsing tokens + parseMultipleFormatChunker = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi, + + // parsing token regexes + parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 + parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 + parseTokenThreeDigits = /\d{3}/, // 000 - 999 + parseTokenFourDigits = /\d{1,4}/, // 0 - 9999 + parseTokenSixDigits = /[+-]?\d{1,6}/, // -999,999 - 999,999 + parseTokenWord = /[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i, // any word (or two) characters or numbers including two word month in arabic. + parseTokenTimezone = /Z|[+-]\d\d:?\d\d/i, // +00:00 -00:00 +0000 -0000 or Z + parseTokenT = /T/i, // T (ISO seperator) + parseTokenTimestampMs = /[+-]?\d+(.\d{1,3})?/, // 123456789 123456789.123 + + // preliminary iso regex + // 0000-00-00 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 + isoRegex = /^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(.\d\d?\d?)?)?)?)?([+-]\d\d:?\d\d)?)?/, + isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', + + // iso time formats and regexes + isoTimes = [ + ['HH:mm:ss.S', /(T| )\d\d:\d\d:\d\d.\d{1,3}/], + ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], + ['HH:mm', /(T| )\d\d:\d\d/], + ['HH', /(T| )\d\d/] + ], + + // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] + parseTimezoneChunker = /([+-]|\d\d)/gi, + + // getter and setter names + proxyGettersAndSetters = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), + unitMillisecondFactors = { + 'Milliseconds' : 1, + 'Seconds' : 1e3, + 'Minutes' : 6e4, + 'Hours' : 36e5, + 'Days' : 864e5, + 'Months' : 2592e6, + 'Years' : 31536e6 + }, + + // format function strings + formatFunctions = {}, + + // tokens to ordinalize and pad + ordinalizeTokens = 'DDD w W M D d'.split(' '), + paddedTokens = 'M D H h m s w W'.split(' '), + + formatTokenFunctions = { + M : function () { + return this.month() + 1; + }, + MMM : function (format) { + return this.lang().monthsShort(this, format); + }, + MMMM : function (format) { + return this.lang().months(this, format); + }, + D : function () { + return this.date(); + }, + DDD : function () { + return this.dayOfYear(); + }, + d : function () { + return this.day(); + }, + dd : function (format) { + return this.lang().weekdaysMin(this, format); + }, + ddd : function (format) { + return this.lang().weekdaysShort(this, format); + }, + dddd : function (format) { + return this.lang().weekdays(this, format); + }, + w : function () { + return this.week(); + }, + W : function () { + return this.isoWeek(); + }, + YY : function () { + return leftZeroFill(this.year() % 100, 2); + }, + YYYY : function () { + return leftZeroFill(this.year(), 4); + }, + YYYYY : function () { + return leftZeroFill(this.year(), 5); + }, + a : function () { + return this.lang().meridiem(this.hours(), this.minutes(), true); + }, + A : function () { + return this.lang().meridiem(this.hours(), this.minutes(), false); + }, + H : function () { + return this.hours(); + }, + h : function () { + return this.hours() % 12 || 12; + }, + m : function () { + return this.minutes(); + }, + s : function () { + return this.seconds(); + }, + S : function () { + return ~~(this.milliseconds() / 100); + }, + SS : function () { + return leftZeroFill(~~(this.milliseconds() / 10), 2); + }, + SSS : function () { + return leftZeroFill(this.milliseconds(), 3); + }, + Z : function () { + var a = -this.zone(), + b = "+"; + if (a < 0) { + a = -a; + b = "-"; + } + return b + leftZeroFill(~~(a / 60), 2) + ":" + leftZeroFill(~~a % 60, 2); + }, + ZZ : function () { + var a = -this.zone(), + b = "+"; + if (a < 0) { + a = -a; + b = "-"; + } + return b + leftZeroFill(~~(10 * a / 6), 4); + }, + X : function () { + return this.unix(); + } + }; + + function padToken(func, count) { + return function (a) { + return leftZeroFill(func.call(this, a), count); + }; + } + function ordinalizeToken(func) { + return function (a) { + return this.lang().ordinal(func.call(this, a)); + }; + } + + while (ordinalizeTokens.length) { + i = ordinalizeTokens.pop(); + formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i]); + } + while (paddedTokens.length) { + i = paddedTokens.pop(); + formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); + } + formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); + + + /************************************ + Constructors + ************************************/ + + function Language() { + + } + + // Moment prototype object + function Moment(config) { + extend(this, config); + } + + // Duration Constructor + function Duration(duration) { + var data = this._data = {}, + years = duration.years || duration.year || duration.y || 0, + months = duration.months || duration.month || duration.M || 0, + weeks = duration.weeks || duration.week || duration.w || 0, + days = duration.days || duration.day || duration.d || 0, + hours = duration.hours || duration.hour || duration.h || 0, + minutes = duration.minutes || duration.minute || duration.m || 0, + seconds = duration.seconds || duration.second || duration.s || 0, + milliseconds = duration.milliseconds || duration.millisecond || duration.ms || 0; + + // representation for dateAddRemove + this._milliseconds = milliseconds + + seconds * 1e3 + // 1000 + minutes * 6e4 + // 1000 * 60 + hours * 36e5; // 1000 * 60 * 60 + // Because of dateAddRemove treats 24 hours as different from a + // day when working around DST, we need to store them separately + this._days = days + + weeks * 7; + // It is impossible translate months into days without knowing + // which months you are are talking about, so we have to store + // it separately. + this._months = months + + years * 12; + + // The following code bubbles up values, see the tests for + // examples of what that means. + data.milliseconds = milliseconds % 1000; + seconds += absRound(milliseconds / 1000); + + data.seconds = seconds % 60; + minutes += absRound(seconds / 60); + + data.minutes = minutes % 60; + hours += absRound(minutes / 60); + + data.hours = hours % 24; + days += absRound(hours / 24); + + days += weeks * 7; + data.days = days % 30; + + months += absRound(days / 30); + + data.months = months % 12; + years += absRound(months / 12); + + data.years = years; + } + + + /************************************ + Helpers + ************************************/ + + + function extend(a, b) { + for (var i in b) { + if (b.hasOwnProperty(i)) { + a[i] = b[i]; + } + } + return a; + } + + function absRound(number) { + if (number < 0) { + return Math.ceil(number); + } else { + return Math.floor(number); + } + } + + // left zero fill a number + // see http://jsperf.com/left-zero-filling for performance comparison + function leftZeroFill(number, targetLength) { + var output = number + ''; + while (output.length < targetLength) { + output = '0' + output; + } + return output; + } + + // helper function for _.addTime and _.subtractTime + function addOrSubtractDurationFromMoment(mom, duration, isAdding) { + var ms = duration._milliseconds, + d = duration._days, + M = duration._months, + currentDate; + + if (ms) { + mom._d.setTime(+mom + ms * isAdding); + } + if (d) { + mom.date(mom.date() + d * isAdding); + } + if (M) { + currentDate = mom.date(); + mom.date(1) + .month(mom.month() + M * isAdding) + .date(Math.min(currentDate, mom.daysInMonth())); + } + } + + // check if is an array + function isArray(input) { + return Object.prototype.toString.call(input) === '[object Array]'; + } + + // compare two arrays, return the number of differences + function compareArrays(array1, array2) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + for (i = 0; i < len; i++) { + if (~~array1[i] !== ~~array2[i]) { + diffs++; + } + } + return diffs + lengthDiff; + } + + + /************************************ + Languages + ************************************/ + + + Language.prototype = { + set : function (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (typeof prop === 'function') { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + }, + + _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), + months : function (m) { + return this._months[m.month()]; + }, + + _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), + monthsShort : function (m) { + return this._monthsShort[m.month()]; + }, + + monthsParse : function (monthName) { + var i, mom, regex, output; + + if (!this._monthsParse) { + this._monthsParse = []; + } + + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + if (!this._monthsParse[i]) { + mom = moment([2000, i]); + regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); + this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (this._monthsParse[i].test(monthName)) { + return i; + } + } + }, + + _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), + weekdays : function (m) { + return this._weekdays[m.day()]; + }, + + _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), + weekdaysShort : function (m) { + return this._weekdaysShort[m.day()]; + }, + + _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), + weekdaysMin : function (m) { + return this._weekdaysMin[m.day()]; + }, + + _longDateFormat : { + LT : "h:mm A", + L : "MM/DD/YYYY", + LL : "MMMM D YYYY", + LLL : "MMMM D YYYY LT", + LLLL : "dddd, MMMM D YYYY LT" + }, + longDateFormat : function (key) { + var output = this._longDateFormat[key]; + if (!output && this._longDateFormat[key.toUpperCase()]) { + output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { + return val.slice(1); + }); + this._longDateFormat[key] = output; + } + return output; + }, + + meridiem : function (hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; + } + }, + + _calendar : { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[last] dddd [at] LT', + sameElse : 'L' + }, + calendar : function (key, mom) { + var output = this._calendar[key]; + return typeof output === 'function' ? output.apply(mom) : output; + }, + + _relativeTime : { + future : "in %s", + past : "%s ago", + s : "a few seconds", + m : "a minute", + mm : "%d minutes", + h : "an hour", + hh : "%d hours", + d : "a day", + dd : "%d days", + M : "a month", + MM : "%d months", + y : "a year", + yy : "%d years" + }, + relativeTime : function (number, withoutSuffix, string, isFuture) { + var output = this._relativeTime[string]; + return (typeof output === 'function') ? + output(number, withoutSuffix, string, isFuture) : + output.replace(/%d/i, number); + }, + pastFuture : function (diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); + }, + + ordinal : function (number) { + return this._ordinal.replace("%d", number); + }, + _ordinal : "%d", + + preparse : function (string) { + return string; + }, + + postformat : function (string) { + return string; + }, + + week : function (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy); + }, + _week : { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + } + }; + + // Loads a language definition into the `languages` cache. The function + // takes a key and optionally values. If not in the browser and no values + // are provided, it will load the language file module. As a convenience, + // this function also returns the language values. + function loadLang(key, values) { + values.abbr = key; + if (!languages[key]) { + languages[key] = new Language(); + } + languages[key].set(values); + return languages[key]; + } + + // Determines which language definition to use and returns it. + // + // With no parameters, it will return the global language. If you + // pass in a language key, such as 'en', it will return the + // definition for 'en', so long as 'en' has already been loaded using + // moment.lang. + function getLangDefinition(key) { + if (!key) { + return moment.fn._lang; + } + if (!languages[key] && hasModule) { + require('./lang/' + key); + } + return languages[key]; + } + + + /************************************ + Formatting + ************************************/ + + + function removeFormattingTokens(input) { + if (input.match(/[.*]/)) { + return input.replace(/^[|]$/g, ""); + } + return input.replace(/\/g, ""); + } + + function makeFormatFunction(format) { + var array = format.match(formattingTokens), i, length; + + for (i = 0, length = array.length; i < length; i++) { + if (formatTokenFunctions[array[i]]) { + array[i] = formatTokenFunctions[array[i]]; + } else { + array[i] = removeFormattingTokens(array[i]); + } + } + + return function (mom) { + var output = ""; + for (i = 0; i < length; i++) { + output += typeof array[i].call === 'function' ? array[i].call(mom, format) : array[i]; + } + return output; + }; + } + + // format date using native date object + function formatMoment(m, format) { + var i = 5; + + function replaceLongDateFormatTokens(input) { + return m.lang().longDateFormat(input) || input; + } + + while (i-- && localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + } + + if (!formatFunctions[format]) { + formatFunctions[format] = makeFormatFunction(format); + } + + return formatFunctions[format](m); + } + + + /************************************ + Parsing + ************************************/ + + + // get the regex to find the next token + function getParseRegexForToken(token) { + switch (token) { + case 'DDDD': + return parseTokenThreeDigits; + case 'YYYY': + return parseTokenFourDigits; + case 'YYYYY': + return parseTokenSixDigits; + case 'S': + case 'SS': + case 'SSS': + case 'DDD': + return parseTokenOneToThreeDigits; + case 'MMM': + case 'MMMM': + case 'dd': + case 'ddd': + case 'dddd': + case 'a': + case 'A': + return parseTokenWord; + case 'X': + return parseTokenTimestampMs; + case 'Z': + case 'ZZ': + return parseTokenTimezone; + case 'T': + return parseTokenT; + case 'MM': + case 'DD': + case 'YY': + case 'HH': + case 'hh': + case 'mm': + case 'ss': + case 'M': + case 'D': + case 'd': + case 'H': + case 'h': + case 'm': + case 's': + return parseTokenOneOrTwoDigits; + default : + return new RegExp(token.replace('\', '')); + } + } + + // function to convert string input to date + function addTimeToArrayFromToken(token, input, config) { + var a, b, + datePartArray = config._a; + + switch (token) { + // MONTH + case 'M' : // fall through to MM + case 'MM' : + datePartArray[1] = (input == null) ? 0 : ~~input - 1; + break; + case 'MMM' : // fall through to MMMM + case 'MMMM' : + a = getLangDefinition(config._l).monthsParse(input); + // if we didn't find a month name, mark the date as invalid. + if (a != null) { + datePartArray[1] = a; + } else { + config._isValid = false; + } + break; + // DAY OF MONTH + case 'D' : // fall through to DDDD + case 'DD' : // fall through to DDDD + case 'DDD' : // fall through to DDDD + case 'DDDD' : + if (input != null) { + datePartArray[2] = ~~input; + } + break; + // YEAR + case 'YY' : + datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000); + break; + case 'YYYY' : + case 'YYYYY' : + datePartArray[0] = ~~input; + break; + // AM / PM + case 'a' : // fall through to A + case 'A' : + config._isPm = ((input + '').toLowerCase() === 'pm'); + break; + // 24 HOUR + case 'H' : // fall through to hh + case 'HH' : // fall through to hh + case 'h' : // fall through to hh + case 'hh' : + datePartArray[3] = ~~input; + break; + // MINUTE + case 'm' : // fall through to mm + case 'mm' : + datePartArray[4] = ~~input; + break; + // SECOND + case 's' : // fall through to ss + case 'ss' : + datePartArray[5] = ~~input; + break; + // MILLISECOND + case 'S' : + case 'SS' : + case 'SSS' : + datePartArray[6] = ~~ (('0.' + input) * 1000); + break; + // UNIX TIMESTAMP WITH MS + case 'X': + config._d = new Date(parseFloat(input) * 1000); + break; + // TIMEZONE + case 'Z' : // fall through to ZZ + case 'ZZ' : + config._useUTC = true; + a = (input + '').match(parseTimezoneChunker); + if (a && a[1]) { + config._tzh = ~~a[1]; + } + if (a && a[2]) { + config._tzm = ~~a[2]; + } + // reverse offsets + if (a && a[0] === '+') { + config._tzh = -config._tzh; + config._tzm = -config._tzm; + } + break; + } + + // if the input is null, the date is not valid + if (input == null) { + config._isValid = false; + } + } + + // convert an array to a date. + // the array should mirror the parameters below + // note: all values past the year are optional and will default to the lowest possible value. + // [year, month, day , hour, minute, second, millisecond] + function dateFromArray(config) { + var i, date, input = []; + + if (config._d) { + return; + } + + for (i = 0; i < 7; i++) { + config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; + } + + // add the offsets to the time to be parsed so that we can have a clean array for checking isValid + input[3] += config._tzh || 0; + input[4] += config._tzm || 0; + + date = new Date(0); + + if (config._useUTC) { + date.setUTCFullYear(input[0], input[1], input[2]); + date.setUTCHours(input[3], input[4], input[5], input[6]); + } else { + date.setFullYear(input[0], input[1], input[2]); + date.setHours(input[3], input[4], input[5], input[6]); + } + + config._d = date; + } + + // date from string and format string + function makeDateFromStringAndFormat(config) { + // This array is used to make a Date, either with `new Date` or `Date.UTC` + var tokens = config._f.match(formattingTokens), + string = config._i, + i, parsedInput; + + config._a = []; + + for (i = 0; i < tokens.length; i++) { + parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0]; + if (parsedInput) { + string = string.slice(string.indexOf(parsedInput) + parsedInput.length); + } + // don't parse if its not a known token + if (formatTokenFunctions[tokens[i]]) { + addTimeToArrayFromToken(tokens[i], parsedInput, config); + } + } + // handle am pm + if (config._isPm && config._a[3] < 12) { + config._a[3] += 12; + } + // if is 12 am, change hours to 0 + if (config._isPm === false && config._a[3] === 12) { + config._a[3] = 0; + } + // return + dateFromArray(config); + } + + // date from string and array of format strings + function makeDateFromStringAndArray(config) { + var tempConfig, + tempMoment, + bestMoment, + + scoreToBeat = 99, + i, + currentDate, + currentScore; + + while (config._f.length) { + tempConfig = extend({}, config); + tempConfig._f = config._f.pop(); + makeDateFromStringAndFormat(tempConfig); + tempMoment = new Moment(tempConfig); + + if (tempMoment.isValid()) { + bestMoment = tempMoment; + break; + } + + currentScore = compareArrays(tempConfig._a, tempMoment.toArray()); + + if (currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempMoment; + } + } + + extend(config, bestMoment); + } + + // date from iso format + function makeDateFromString(config) { + var i, + string = config._i; + if (isoRegex.exec(string)) { + config._f = 'YYYY-MM-DDT'; + for (i = 0; i < 4; i++) { + if (isoTimes[i][1].exec(string)) { + config._f += isoTimes[i][0]; + break; + } + } + if (parseTokenTimezone.exec(string)) { + config._f += " Z"; + } + makeDateFromStringAndFormat(config); + } else { + config._d = new Date(string); + } + } + + function makeDateFromInput(config) { + var input = config._i, + matched = aspNetJsonRegex.exec(input); + + if (input === undefined) { + config._d = new Date(); + } else if (matched) { + config._d = new Date(+matched[1]); + } else if (typeof input === 'string') { + makeDateFromString(config); + } else if (isArray(input)) { + config._a = input.slice(0); + dateFromArray(config); + } else { + config._d = input instanceof Date ? new Date(+input) : new Date(input); + } + } + + + /************************************ + Relative Time + ************************************/ + + + // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize + function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) { + return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture); + } + + function relativeTime(milliseconds, withoutSuffix, lang) { + var seconds = round(Math.abs(milliseconds) / 1000), + minutes = round(seconds / 60), + hours = round(minutes / 60), + days = round(hours / 24), + years = round(days / 365), + args = seconds < 45 && ['s', seconds] || + minutes === 1 && ['m'] || + minutes < 45 && ['mm', minutes] || + hours === 1 && ['h'] || + hours < 22 && ['hh', hours] || + days === 1 && ['d'] || + days <= 25 && ['dd', days] || + days <= 45 && ['M'] || + days < 345 && ['MM', round(days / 30)] || + years === 1 && ['y'] || ['yy', years]; + args[2] = withoutSuffix; + args[3] = milliseconds > 0; + args[4] = lang; + return substituteTimeAgo.apply({}, args); + } + + + /************************************ + Week of Year + ************************************/ + + + // firstDayOfWeek 0 = sun, 6 = sat + // the day of the week that starts the week + // (usually sunday or monday) + // firstDayOfWeekOfYear 0 = sun, 6 = sat + // the first week is the week that contains the first + // of this day of the week + // (eg. ISO weeks use thursday (4)) + function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { + var end = firstDayOfWeekOfYear - firstDayOfWeek, + daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(); + + + if (daysToDayOfWeek > end) { + daysToDayOfWeek -= 7; + } + + if (daysToDayOfWeek < end - 7) { + daysToDayOfWeek += 7; + } + + return Math.ceil(moment(mom).add('d', daysToDayOfWeek).dayOfYear() / 7); + } + + + /************************************ + Top Level Functions + ************************************/ + + function makeMoment(config) { + var input = config._i, + format = config._f; + + if (input === null || input === '') { + return null; + } + + if (typeof input === 'string') { + config._i = input = getLangDefinition().preparse(input); + } + + if (moment.isMoment(input)) { + config = extend({}, input); + config._d = new Date(+input._d); + } else if (format) { + if (isArray(format)) { + makeDateFromStringAndArray(config); + } else { + makeDateFromStringAndFormat(config); + } + } else { + makeDateFromInput(config); + } + + return new Moment(config); + } + + moment = function (input, format, lang) { + return makeMoment({ + _i : input, + _f : format, + _l : lang, + _isUTC : false + }); + }; + + // creating with utc + moment.utc = function (input, format, lang) { + return makeMoment({ + _useUTC : true, + _isUTC : true, + _l : lang, + _i : input, + _f : format + }); + }; + + // creating with unix timestamp (in seconds) + moment.unix = function (input) { + return moment(input * 1000); + }; + + // duration + moment.duration = function (input, key) { + var isDuration = moment.isDuration(input), + isNumber = (typeof input === 'number'), + duration = (isDuration ? input._data : (isNumber ? {} : input)), + ret; + + if (isNumber) { + if (key) { + duration[key] = input; + } else { + duration.milliseconds = input; + } + } + + ret = new Duration(duration); + + if (isDuration && input.hasOwnProperty('_lang')) { + ret._lang = input._lang; + } + + return ret; + }; + + // version number + moment.version = VERSION; + + // default format + moment.defaultFormat = isoFormat; + + // This function will load languages and then set the global language. If + // no arguments are passed in, it will simply return the current global + // language key. + moment.lang = function (key, values) { + var i; + + if (!key) { + return moment.fn._lang._abbr; + } + if (values) { + loadLang(key, values); + } else if (!languages[key]) { + getLangDefinition(key); + } + moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key); + }; + + // returns language data + moment.langData = function (key) { + if (key && key._lang && key._lang._abbr) { + key = key._lang._abbr; + } + return getLangDefinition(key); + }; + + // compare moment object + moment.isMoment = function (obj) { + return obj instanceof Moment; + }; + + // for typechecking Duration objects + moment.isDuration = function (obj) { + return obj instanceof Duration; + }; + + + /************************************ + Moment Prototype + ************************************/ + + + moment.fn = Moment.prototype = { + + clone : function () { + return moment(this); + }, + + valueOf : function () { + return +this._d; + }, + + unix : function () { + return Math.floor(+this._d / 1000); + }, + + toString : function () { + return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); + }, + + toDate : function () { + return this._d; + }, + + toJSON : function () { + return moment.utc(this).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + }, + + toArray : function () { + var m = this; + return [ + m.year(), + m.month(), + m.date(), + m.hours(), + m.minutes(), + m.seconds(), + m.milliseconds() + ]; + }, + + isValid : function () { + if (this._isValid == null) { + if (this._a) { + this._isValid = !compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()); + } else { + this._isValid = !isNaN(this._d.getTime()); + } + } + return !!this._isValid; + }, + + utc : function () { + this._isUTC = true; + return this; + }, + + local : function () { + this._isUTC = false; + return this; + }, + + format : function (inputString) { + var output = formatMoment(this, inputString || moment.defaultFormat); + return this.lang().postformat(output); + }, + + add : function (input, val) { + var dur; + // switch args to support add('s', 1) and add(1, 's') + if (typeof input === 'string') { + dur = moment.duration(+val, input); + } else { + dur = moment.duration(input, val); + } + addOrSubtractDurationFromMoment(this, dur, 1); + return this; + }, + + subtract : function (input, val) { + var dur; + // switch args to support subtract('s', 1) and subtract(1, 's') + if (typeof input === 'string') { + dur = moment.duration(+val, input); + } else { + dur = moment.duration(input, val); + } + addOrSubtractDurationFromMoment(this, dur, -1); + return this; + }, + + diff : function (input, units, asFloat) { + var that = this._isUTC ? moment(input).utc() : moment(input).local(), + zoneDiff = (this.zone() - that.zone()) * 6e4, + diff, output; + + if (units) { + // standardize on singular form + units = units.replace(/s$/, ''); + } + + if (units === 'year' || units === 'month') { + diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 + output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); + output += ((this - moment(this).startOf('month')) - (that - moment(that).startOf('month'))) / diff; + if (units === 'year') { + output = output / 12; + } + } else { + diff = (this - that) - zoneDiff; + output = units === 'second' ? diff / 1e3 : // 1000 + units === 'minute' ? diff / 6e4 : // 1000 * 60 + units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 + units === 'day' ? diff / 864e5 : // 1000 * 60 * 60 * 24 + units === 'week' ? diff / 6048e5 : // 1000 * 60 * 60 * 24 * 7 + diff; + } + return asFloat ? output : absRound(output); + }, + + from : function (time, withoutSuffix) { + return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix); + }, + + fromNow : function (withoutSuffix) { + return this.from(moment(), withoutSuffix); + }, + + calendar : function () { + var diff = this.diff(moment().startOf('day'), 'days', true), + format = diff < -6 ? 'sameElse' : + diff < -1 ? 'lastWeek' : + diff < 0 ? 'lastDay' : + diff < 1 ? 'sameDay' : + diff < 2 ? 'nextDay' : + diff < 7 ? 'nextWeek' : 'sameElse'; + return this.format(this.lang().calendar(format, this)); + }, + + isLeapYear : function () { + var year = this.year(); + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + }, + + isDST : function () { + return (this.zone() < moment([this.year()]).zone() || + this.zone() < moment([this.year(), 5]).zone()); + }, + + day : function (input) { + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + return input == null ? day : + this.add({ d : input - day }); + }, + + startOf: function (units) { + units = units.replace(/s$/, ''); + // the following switch intentionally omits break keywords + // to utilize falling through the cases. + switch (units) { + case 'year': + this.month(0); + /* falls through */ + case 'month': + this.date(1); + /* falls through */ + case 'week': + case 'day': + this.hours(0); + /* falls through */ + case 'hour': + this.minutes(0); + /* falls through */ + case 'minute': + this.seconds(0); + /* falls through */ + case 'second': + this.milliseconds(0); + /* falls through */ + } + + // weeks are a special case + if (units === 'week') { + this.day(0); + } + + return this; + }, + + endOf: function (units) { + return this.startOf(units).add(units.replace(/s?$/, 's'), 1).subtract('ms', 1); + }, + + isAfter: function (input, units) { + units = typeof units !== 'undefined' ? units : 'millisecond'; + return +this.clone().startOf(units) > +moment(input).startOf(units); + }, + + isBefore: function (input, units) { + units = typeof units !== 'undefined' ? units : 'millisecond'; + return +this.clone().startOf(units) < +moment(input).startOf(units); + }, + + isSame: function (input, units) { + units = typeof units !== 'undefined' ? units : 'millisecond'; + return +this.clone().startOf(units) === +moment(input).startOf(units); + }, + + zone : function () { + return this._isUTC ? 0 : this._d.getTimezoneOffset(); + }, + + daysInMonth : function () { + return moment.utc([this.year(), this.month() + 1, 0]).date(); + }, + + dayOfYear : function (input) { + var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add("d", (input - dayOfYear)); + }, + + isoWeek : function (input) { + var week = weekOfYear(this, 1, 4); + return input == null ? week : this.add("d", (input - week) * 7); + }, + + week : function (input) { + var week = this.lang().week(this); + return input == null ? week : this.add("d", (input - week) * 7); + }, + + // If passed a language key, it will set the language for this + // instance. Otherwise, it will return the language configuration + // variables for this instance. + lang : function (key) { + if (key === undefined) { + return this._lang; + } else { + this._lang = getLangDefinition(key); + return this; + } + } + }; + + // helper for adding shortcuts + function makeGetterAndSetter(name, key) { + moment.fn[name] = moment.fn[name + 's'] = function (input) { + var utc = this._isUTC ? 'UTC' : ''; + if (input != null) { + this._d['set' + utc + key](input); + return this; + } else { + return this._d['get' + utc + key](); + } + }; + } + + // loop through and add shortcuts (Month, Date, Hours, Minutes, Seconds, Milliseconds) + for (i = 0; i < proxyGettersAndSetters.length; i ++) { + makeGetterAndSetter(proxyGettersAndSetters[i].toLowerCase().replace(/s$/, ''), proxyGettersAndSetters[i]); + } + + // add shortcut for year (uses different syntax than the getter/setter 'year' == 'FullYear') + makeGetterAndSetter('year', 'FullYear'); + + // add plural methods + moment.fn.days = moment.fn.day; + moment.fn.weeks = moment.fn.week; + moment.fn.isoWeeks = moment.fn.isoWeek; + + /************************************ + Duration Prototype + ************************************/ + + + moment.duration.fn = Duration.prototype = { + weeks : function () { + return absRound(this.days() / 7); + }, + + valueOf : function () { + return this._milliseconds + + this._days * 864e5 + + this._months * 2592e6; + }, + + humanize : function (withSuffix) { + var difference = +this, + output = relativeTime(difference, !withSuffix, this.lang()); + + if (withSuffix) { + output = this.lang().pastFuture(difference, output); + } + + return this.lang().postformat(output); + }, + + lang : moment.fn.lang + }; + + function makeDurationGetter(name) { + moment.duration.fn[name] = function () { + return this._data[name]; + }; + } + + function makeDurationAsGetter(name, factor) { + moment.duration.fn['as' + name] = function () { + return +this / factor; + }; + } + + for (i in unitMillisecondFactors) { + if (unitMillisecondFactors.hasOwnProperty(i)) { + makeDurationAsGetter(i, unitMillisecondFactors[i]); + makeDurationGetter(i.toLowerCase()); + } + } + + makeDurationAsGetter('Weeks', 6048e5); + + + /************************************ + Default Lang + ************************************/ + + + // Set default language, other languages will inherit from English. + moment.lang('en', { + ordinal : function (number) { + var b = number % 10, + output = (~~ (number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + } + }); + + + /************************************ + Exposing Moment + ************************************/ + + + // CommonJS module is defined + if (hasModule) { + module.exports = moment; + } + /*global ender:false */ + if (typeof ender === 'undefined') { + // here, `this` means `window` in the browser, or `global` on the server + // add `moment` as a global object via a string identifier, + // for Closure Compiler "advanced" mode + this['moment'] = moment; + } + /*global define:false */ + if (typeof define === "function" && define.amd) { + define("moment", [], function () { + return moment; + }); + } +}).call(this); \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.min.js b/modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.min.js new file mode 100644 index 0000000..4e8497a --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/webapp/js/moment-2.0.0.min.js @@ -0,0 +1,6 @@ +// moment.js +// version : 2.0.0 +// author : Tim Wood +// license : MIT +// momentjs.com +(function(e){function O(e,t){return function(n){return j(e.call(this,n),t)}}function M(e){return function(t){return this.lang().ordinal(e.call(this,t))}}function _(){}function D(e){H(this,e)}function P(e){var t=this._data={},n=e.years||e.year||e.y||0,r=e.months||e.month||e.M||0,i=e.weeks||e.week||e.w||0,s=e.days||e.day||e.d||0,o=e.hours||e.hour||e.h||0,u=e.minutes||e.minute||e.m||0,a=e.seconds||e.second||e.s||0,f=e.milliseconds||e.millisecond||e.ms||0;this._milliseconds=f+a*1e3+u*6e4+o*36e5,this._days=s+i*7,this._months=r+n*12,t.milliseconds=f%1e3,a+=B(f/1e3),t.seconds=a%60,u+=B(a/60),t.minutes=u%60,o+=B(u/60),t.hours=o%24,s+=B(o/24),s+=i*7,t.days=s%30,r+=B(s/30),t.months=r%12,n+=B(r/12),t.years=n}function H(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function B(e){return e<0?Math.ceil(e):Math.floor(e)}function j(e,t){var n=e+"";while(n.length<t)n="0"+n;return n}function F(e,t,n){var r=t._milliseconds,i=t._days,s=t._months,o;r&&e._d.setTime(+e+r*n),i&&e.dat e(e.date()+i*n),s&&(o=e.date(),e.date(1).month(e.month()+s*n).date(Math.min(o,e.daysInMonth())))}function I(e){return Object.prototype.toString.call(e)==="[object Array]"}function q(e,t){var n=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),i=0,s;for(s=0;s<n;s++)~~e[s]!==~~t[s]&&i++;return i+r}function R(e,t){return t.abbr=e,s[e]||(s[e]=new _),s[e].set(t),s[e]}function U(e){return e?(!s[e]&&o&&require("./lang/"+e),s[e]):t.fn._lang}function z(e){return e.match(/[.*]/)?e.replace(/^[|]$/g,""):e.replace(/\/g,"")}function W(e){var t=e.match(a),n,r;for(n=0,r=t.length;n<r;n++)A[t[n]]?t[n]=A[t[n]]:t[n]=z(t[n]);return function(i){var s="";for(n=0;n<r;n++)s+=typeof t[n].call=="function"?t[n].call(i,e):t[n];return s}}function X(e,t){function r(t){return e.lang().longDateFormat(t)||t}var n=5;while(n--&&f.test(t))t=t.replace(f,r);return C[t]||(C[t]=W(t)),C[t](e)}function V(e){switch(e){case"DDDD":return p;case"YYYY":return d;case"YYYYY":return v;case"S":case"SS":case"SSS": case"DDD":return h;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return m;case"X":return b;case"Z":case"ZZ":return g;case"T":return y;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return c;default:return new RegExp(e.replace("\",""))}}function $(e,t,n){var r,i,s=n._a;switch(e){case"M":case"MM":s[1]=t==null?0:~~t-1;break;case"MMM":case"MMMM":r=U(n._l).monthsParse(t),r!=null?s[1]=r:n._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":t!=null&&(s[2]=~~t);break;case"YY":s[0]=~~t+(~~t>68?1900:2e3);break;case"YYYY":case"YYYYY":s[0]=~~t;break;case"a":case"A":n._isPm=(t+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":s[3]=~~t;break;case"m":case"mm":s[4]=~~t;break;case"s":case"ss":s[5]=~~t;break;case"S":case"SS":case"SSS":s[6]=~~(("0."+t)*1e3);break;case"X":n._d=new Date(parseFloat(t)*1e3);break;case"Z":case"ZZ":n._useUTC=!0,r=(t+"").match(x),r&&r[1]&&(n._tzh=~~r[1]),r &&r[2]&&(n._tzm=~~r[2]),r&&r[0]==="+"&&(n._tzh=-n._tzh,n._tzm=-n._tzm)}t==null&&(n._isValid=!1)}function J(e){var t,n,r=[];if(e._d)return;for(t=0;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];r[3]+=e._tzh||0,r[4]+=e._tzm||0,n=new Date(0),e._useUTC?(n.setUTCFullYear(r[0],r[1],r[2]),n.setUTCHours(r[3],r[4],r[5],r[6])):(n.setFullYear(r[0],r[1],r[2]),n.setHours(r[3],r[4],r[5],r[6])),e._d=n}function K(e){var t=e._f.match(a),n=e._i,r,i;e._a=[];for(r=0;r<t.length;r++)i=(V(t[r]).exec(n)||[])[0],i&&(n=n.slice(n.indexOf(i)+i.length)),A[t[r]]&&$(t[r],i,e);e._isPm&&e._a[3]<12&&(e._a[3]+=12),e._isPm===!1&&e._a[3]===12&&(e._a[3]=0),J(e)}function Q(e){var t,n,r,i=99,s,o,u;while(e._f.length){t=H({},e),t._f=e._f.pop(),K(t),n=new D(t);if(n.isValid()){r=n;break}u=q(t._a,n.toArray()),u<i&&(i=u,r=n)}H(e,r)}function G(e){var t,n=e._i;if(w.exec(n)){e._f="YYYY-MM-DDT";for(t=0;t<4;t++)if(S[t][1].exec(n)){e._f+=S[t][0];break}g.exec(n)&&(e._f+=" Z"),K(e)}else e._d=new Date(n)}function Y(t){var n=t._i,r=u.exec(n);n===e?t._d=new Date:r?t._d=new Date(+r[1]):typeof n=="string"?G(t):I(n)?(t._a=n.slice(0),J(t)):t._d=n instanceof Date?new Date(+n):new Date(n)}function Z(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function et(e,t,n){var i=r(Math.abs(e)/1e3),s=r(i/60),o=r(s/60),u=r(o/24),a=r(u/365),f=i<45&&["s",i]||s===1&&["m"]||s<45&&["mm",s]||o===1&&["h"]||o<22&&["hh",o]||u===1&&["d"]||u<=25&&["dd",u]||u<=45&&["M"]||u<345&&["MM",r(u/30)]||a===1&&["y"]||["yy",a];return f[2]=t,f[3]=e>0,f[4]=n,Z.apply({},f)}function tt(e,n,r){var i=r-n,s=r-e.day();return s>i&&(s-=7),s<i-7&&(s+=7),Math.ceil(t(e).add("d",s).dayOfYear()/7)}function nt(e){var n=e._i,r=e._f;return n===null||n===""?null:(typeof n=="string"&&(e._i=n=U().preparse(n)),t.isMoment(n)?(e=H({},n),e._d=new Date(+n._d)):r?I(r)?Q(e):K(e):Y(e),new D(e))}function rt(e,n){t.fn[e]=t.fn[e+"s"]=function(e){var t=this._isUTC?"UTC":"";return e!=null?(this._d["set"+t+n](e),this):this._d["get"+t+n]()}}function it(e){t.duration.fn [e]=function(){return this._data[e]}}function st(e,n){t.duration.fn["as"+e]=function(){return+this/n}}var t,n="2.0.0",r=Math.round,i,s={},o=typeof module!="undefined"&&module.exports,u=/^/?Date((-?\d+)/i,a=/([[^[]*])|(\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,f=/([[^[]*])|(\)?(LT|LL?L?L?|l{1,4})/g,l=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,c=/\d\d?/,h=/\d{1,3}/,p=/\d{3}/,d=/\d{1,4}/,v=/[+-]?\d{1,6}/,m=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,g=/Z|[+-]\d\d:?\d\d/i,y=/T/i,b=/[+-]?\d+(.\d{1,3})?/,w=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(.\d\d?\d?)?)?)?)?([+-]\d\d:?\d\d)?)?/,E="YYYY-MM-DDTHH:mm:ssZ",S=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],x=/([+-]|\d\d)/gi,T="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("| "),N={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},C={},k="DDD w W M D d".split(" "),L="M D H h m s w W".split(" "),A={M:function(){return this.month()+1},MMM:function(e){return this.lang().monthsShort(this,e)},MMMM:function(e){return this.lang().months(this,e)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(e){return this.lang().weekdaysMin(this,e)},ddd:function(e){return this.lang().weekdaysShort(this,e)},dddd:function(e){return this.lang().weekdays(this,e)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return j(this.year()%100,2)},YYYY:function(){return j(this.year(),4)},YYYYY:function(){return j(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours() %12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return j(~~(this.milliseconds()/10),2)},SSS:function(){return j(this.milliseconds(),3)},Z:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+j(~~(e/60),2)+":"+j(~~e%60,2)},ZZ:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+j(~~(10*e/6),4)},X:function(){return this.unix()}};while(k.length)i=k.pop(),A[i+"o"]=M(A[i]);while(L.length)i=L.pop(),A[i+i]=O(A[i],2);A.DDDD=O(A.DDD,3),_.prototype={set:function(e){var t,n;for(n in e)t=e[n],typeof t=="function"?this[n]=t:this["_"+n]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(e){return this._months[e.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(e){return this._monthsShort[e.month()]},monthsParse:function(e){var n,r,i,s;this._monthsP arse||(this._monthsParse=[]);for(n=0;n<12;n++){this._monthsParse[n]||(r=t([2e3,n]),i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i"));if(this._monthsParse[n].test(e))return n}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(e){return this._weekdays[e.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(e){return this._weekdaysShort[e.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(e){return this._weekdaysMin[e.day()]},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(e){var t=this._longDateFormat[e];return!t&&this._longDateFormat[e.toUpperCase()]&&(t=this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]=t),t},meridiem:function(e,t,n){return e>11?n?"pm":"PM":n ?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},calendar:function(e,t){var n=this._calendar[e];return typeof n=="function"?n.apply(t):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(e,t,n,r){var i=this._relativeTime[n];return typeof i=="function"?i(e,t,n,r):i.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return typeof n=="function"?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return tt(e,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},t=function(e,t,n){return nt({_i:e,_f:t,_l:n,_isUTC:!1})},t.utc=function(e,t, n){return nt({_useUTC:!0,_isUTC:!0,_l:n,_i:e,_f:t})},t.unix=function(e){return t(e*1e3)},t.duration=function(e,n){var r=t.isDuration(e),i=typeof e=="number",s=r?e._data:i?{}:e,o;return i&&(n?s[n]=e:s.milliseconds=e),o=new P(s),r&&e.hasOwnProperty("_lang")&&(o._lang=e._lang),o},t.version=n,t.defaultFormat=E,t.lang=function(e,n){var r;if(!e)return t.fn._lang._abbr;n?R(e,n):s[e]||U(e),t.duration.fn._lang=t.fn._lang=U(e)},t.langData=function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),U(e)},t.isMoment=function(e){return e instanceof D},t.isDuration=function(e){return e instanceof P},t.fn=D.prototype={clone:function(){return t(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return t.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hou rs(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return this._isValid==null&&(this._a?this._isValid=!q(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray()):this._isValid=!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(e){var n=X(this,e||t.defaultFormat);return this.lang().postformat(n)},add:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,1),this},subtract:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,-1),this},diff:function(e,n,r){var i=this._isUTC?t(e).utc():t(e).local(),s=(this.zone()-i.zone())*6e4,o,u;return n&&(n=n.replace(/s$/,"")),n==="year"||n==="month"?(o=(this.daysInMonth()+i.daysInMonth())*432e5,u=(this.year()-i.year())*12+(this.month()-i.month()),u+=(this-t(this).startOf("month")-(i-t(i).startOf("month")))/o,n==="year"&&(u/=12)):(o=this-i-s,u=n==="second "?o/1e3:n==="minute"?o/6e4:n==="hour"?o/36e5:n==="day"?o/864e5:n==="week"?o/6048e5:o),r?u:B(u)},from:function(e,n){return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n)},fromNow:function(e){return this.from(t(),e)},calendar:function(){var e=this.diff(t().startOf("day"),"days",!0),n=e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse";return this.format(this.lang().calendar(n,this))},isLeapYear:function(){var e=this.year();return e%4===0&&e%100!==0||e%400===0},isDST:function(){return this.zone()<t([this.year()]).zone()||this.zone()<t([this.year(),5]).zone()},day:function(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e==null?t:this.add({d:e-t})},startOf:function(e){e=e.replace(/s$/,"");switch(e){case"year":this.month(0);case"month":this.date(1);case"week":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return e==="week"&&this.day(0) ,this},endOf:function(e){return this.startOf(e).add(e.replace(/s?$/,"s"),1).subtract("ms",1)},isAfter:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)>+t(e).startOf(n)},isBefore:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)<+t(e).startOf(n)},isSame:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)===+t(e).startOf(n)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return t.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(e){var n=r((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return e==null?n:this.add("d",e-n)},isoWeek:function(e){var t=tt(this,1,4);return e==null?t:this.add("d",(e-t)*7)},week:function(e){var t=this.lang().week(this);return e==null?t:this.add("d",(e-t)*7)},lang:function(t){return t===e?this._lang:(this._lang=U(t),this)}};for(i=0;i<T.length;i++)rt(T[i].toLowerCase().replace(/s$/,"" ),T[i]);rt("year","FullYear"),t.fn.days=t.fn.day,t.fn.weeks=t.fn.week,t.fn.isoWeeks=t.fn.isoWeek,t.duration.fn=P.prototype={weeks:function(){return B(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months*2592e6},humanize:function(e){var t=+this,n=et(t,!e,this.lang());return e&&(n=this.lang().pastFuture(t,n)),this.lang().postformat(n)},lang:t.fn.lang};for(i in N)N.hasOwnProperty(i)&&(st(i,N[i]),it(i.toLowerCase()));st("Weeks",6048e5),t.lang("en",{ordinal:function(e){var t=e%10,n=~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),o&&(module.exports=t),typeof ender=="undefined"&&(this.moment=t),typeof define=="function"&&define.amd&&define("moment",[],function(){return t})}).call(this); \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/moment.js b/modules/enterprise/gui/coregui/src/main/webapp/js/moment.js deleted file mode 100644 index 30a0a6c..0000000 --- a/modules/enterprise/gui/coregui/src/main/webapp/js/moment.js +++ /dev/null @@ -1,1400 +0,0 @@ -// moment.js -// version : 2.0.0 -// author : Tim Wood -// license : MIT -// momentjs.com - -(function (undefined) { - - /************************************ - Constants - ************************************/ - - var moment, - VERSION = "2.0.0", - round = Math.round, i, - // internal storage for language config files - languages = {}, - - // check for nodeJS - hasModule = (typeof module !== 'undefined' && module.exports), - - // ASP.NET json date format regex - aspNetJsonRegex = /^/?Date((-?\d+)/i, - - // format tokens - formattingTokens = /([[^[]*])|(\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g, - localFormattingTokens = /([[^[]*])|(\)?(LT|LL?L?L?|l{1,4})/g, - - // parsing tokens - parseMultipleFormatChunker = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi, - - // parsing token regexes - parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 - parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 - parseTokenThreeDigits = /\d{3}/, // 000 - 999 - parseTokenFourDigits = /\d{1,4}/, // 0 - 9999 - parseTokenSixDigits = /[+-]?\d{1,6}/, // -999,999 - 999,999 - parseTokenWord = /[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i, // any word (or two) characters or numbers including two word month in arabic. - parseTokenTimezone = /Z|[+-]\d\d:?\d\d/i, // +00:00 -00:00 +0000 -0000 or Z - parseTokenT = /T/i, // T (ISO seperator) - parseTokenTimestampMs = /[+-]?\d+(.\d{1,3})?/, // 123456789 123456789.123 - - // preliminary iso regex - // 0000-00-00 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 - isoRegex = /^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(.\d\d?\d?)?)?)?)?([+-]\d\d:?\d\d)?)?/, - isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', - - // iso time formats and regexes - isoTimes = [ - ['HH:mm:ss.S', /(T| )\d\d:\d\d:\d\d.\d{1,3}/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] - ], - - // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] - parseTimezoneChunker = /([+-]|\d\d)/gi, - - // getter and setter names - proxyGettersAndSetters = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), - unitMillisecondFactors = { - 'Milliseconds' : 1, - 'Seconds' : 1e3, - 'Minutes' : 6e4, - 'Hours' : 36e5, - 'Days' : 864e5, - 'Months' : 2592e6, - 'Years' : 31536e6 - }, - - // format function strings - formatFunctions = {}, - - // tokens to ordinalize and pad - ordinalizeTokens = 'DDD w W M D d'.split(' '), - paddedTokens = 'M D H h m s w W'.split(' '), - - formatTokenFunctions = { - M : function () { - return this.month() + 1; - }, - MMM : function (format) { - return this.lang().monthsShort(this, format); - }, - MMMM : function (format) { - return this.lang().months(this, format); - }, - D : function () { - return this.date(); - }, - DDD : function () { - return this.dayOfYear(); - }, - d : function () { - return this.day(); - }, - dd : function (format) { - return this.lang().weekdaysMin(this, format); - }, - ddd : function (format) { - return this.lang().weekdaysShort(this, format); - }, - dddd : function (format) { - return this.lang().weekdays(this, format); - }, - w : function () { - return this.week(); - }, - W : function () { - return this.isoWeek(); - }, - YY : function () { - return leftZeroFill(this.year() % 100, 2); - }, - YYYY : function () { - return leftZeroFill(this.year(), 4); - }, - YYYYY : function () { - return leftZeroFill(this.year(), 5); - }, - a : function () { - return this.lang().meridiem(this.hours(), this.minutes(), true); - }, - A : function () { - return this.lang().meridiem(this.hours(), this.minutes(), false); - }, - H : function () { - return this.hours(); - }, - h : function () { - return this.hours() % 12 || 12; - }, - m : function () { - return this.minutes(); - }, - s : function () { - return this.seconds(); - }, - S : function () { - return ~~(this.milliseconds() / 100); - }, - SS : function () { - return leftZeroFill(~~(this.milliseconds() / 10), 2); - }, - SSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - Z : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(~~(a / 60), 2) + ":" + leftZeroFill(~~a % 60, 2); - }, - ZZ : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(~~(10 * a / 6), 4); - }, - X : function () { - return this.unix(); - } - }; - - function padToken(func, count) { - return function (a) { - return leftZeroFill(func.call(this, a), count); - }; - } - function ordinalizeToken(func) { - return function (a) { - return this.lang().ordinal(func.call(this, a)); - }; - } - - while (ordinalizeTokens.length) { - i = ordinalizeTokens.pop(); - formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i]); - } - while (paddedTokens.length) { - i = paddedTokens.pop(); - formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); - } - formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); - - - /************************************ - Constructors - ************************************/ - - function Language() { - - } - - // Moment prototype object - function Moment(config) { - extend(this, config); - } - - // Duration Constructor - function Duration(duration) { - var data = this._data = {}, - years = duration.years || duration.year || duration.y || 0, - months = duration.months || duration.month || duration.M || 0, - weeks = duration.weeks || duration.week || duration.w || 0, - days = duration.days || duration.day || duration.d || 0, - hours = duration.hours || duration.hour || duration.h || 0, - minutes = duration.minutes || duration.minute || duration.m || 0, - seconds = duration.seconds || duration.second || duration.s || 0, - milliseconds = duration.milliseconds || duration.millisecond || duration.ms || 0; - - // representation for dateAddRemove - this._milliseconds = milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 36e5; // 1000 * 60 * 60 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = days + - weeks * 7; - // It is impossible translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = months + - years * 12; - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - seconds += absRound(milliseconds / 1000); - - data.seconds = seconds % 60; - minutes += absRound(seconds / 60); - - data.minutes = minutes % 60; - hours += absRound(minutes / 60); - - data.hours = hours % 24; - days += absRound(hours / 24); - - days += weeks * 7; - data.days = days % 30; - - months += absRound(days / 30); - - data.months = months % 12; - years += absRound(months / 12); - - data.years = years; - } - - - /************************************ - Helpers - ************************************/ - - - function extend(a, b) { - for (var i in b) { - if (b.hasOwnProperty(i)) { - a[i] = b[i]; - } - } - return a; - } - - function absRound(number) { - if (number < 0) { - return Math.ceil(number); - } else { - return Math.floor(number); - } - } - - // left zero fill a number - // see http://jsperf.com/left-zero-filling for performance comparison - function leftZeroFill(number, targetLength) { - var output = number + ''; - while (output.length < targetLength) { - output = '0' + output; - } - return output; - } - - // helper function for _.addTime and _.subtractTime - function addOrSubtractDurationFromMoment(mom, duration, isAdding) { - var ms = duration._milliseconds, - d = duration._days, - M = duration._months, - currentDate; - - if (ms) { - mom._d.setTime(+mom + ms * isAdding); - } - if (d) { - mom.date(mom.date() + d * isAdding); - } - if (M) { - currentDate = mom.date(); - mom.date(1) - .month(mom.month() + M * isAdding) - .date(Math.min(currentDate, mom.daysInMonth())); - } - } - - // check if is an array - function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; - } - - // compare two arrays, return the number of differences - function compareArrays(array1, array2) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if (~~array1[i] !== ~~array2[i]) { - diffs++; - } - } - return diffs + lengthDiff; - } - - - /************************************ - Languages - ************************************/ - - - Language.prototype = { - set : function (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - }, - - _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - months : function (m) { - return this._months[m.month()]; - }, - - _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - monthsShort : function (m) { - return this._monthsShort[m.month()]; - }, - - monthsParse : function (monthName) { - var i, mom, regex, output; - - if (!this._monthsParse) { - this._monthsParse = []; - } - - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - if (!this._monthsParse[i]) { - mom = moment([2000, i]); - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._monthsParse[i].test(monthName)) { - return i; - } - } - }, - - _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdays : function (m) { - return this._weekdays[m.day()]; - }, - - _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysShort : function (m) { - return this._weekdaysShort[m.day()]; - }, - - _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - weekdaysMin : function (m) { - return this._weekdaysMin[m.day()]; - }, - - _longDateFormat : { - LT : "h:mm A", - L : "MM/DD/YYYY", - LL : "MMMM D YYYY", - LLL : "MMMM D YYYY LT", - LLLL : "dddd, MMMM D YYYY LT" - }, - longDateFormat : function (key) { - var output = this._longDateFormat[key]; - if (!output && this._longDateFormat[key.toUpperCase()]) { - output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); - this._longDateFormat[key] = output; - } - return output; - }, - - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - }, - - _calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[last] dddd [at] LT', - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendar[key]; - return typeof output === 'function' ? output.apply(mom) : output; - }, - - _relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - relativeTime : function (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (typeof output === 'function') ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - }, - pastFuture : function (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - }, - - ordinal : function (number) { - return this._ordinal.replace("%d", number); - }, - _ordinal : "%d", - - preparse : function (string) { - return string; - }, - - postformat : function (string) { - return string; - }, - - week : function (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy); - }, - _week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }; - - // Loads a language definition into the `languages` cache. The function - // takes a key and optionally values. If not in the browser and no values - // are provided, it will load the language file module. As a convenience, - // this function also returns the language values. - function loadLang(key, values) { - values.abbr = key; - if (!languages[key]) { - languages[key] = new Language(); - } - languages[key].set(values); - return languages[key]; - } - - // Determines which language definition to use and returns it. - // - // With no parameters, it will return the global language. If you - // pass in a language key, such as 'en', it will return the - // definition for 'en', so long as 'en' has already been loaded using - // moment.lang. - function getLangDefinition(key) { - if (!key) { - return moment.fn._lang; - } - if (!languages[key] && hasModule) { - require('./lang/' + key); - } - return languages[key]; - } - - - /************************************ - Formatting - ************************************/ - - - function removeFormattingTokens(input) { - if (input.match(/[.*]/)) { - return input.replace(/^[|]$/g, ""); - } - return input.replace(/\/g, ""); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = ""; - for (i = 0; i < length; i++) { - output += typeof array[i].call === 'function' ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } - - // format date using native date object - function formatMoment(m, format) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return m.lang().longDateFormat(input) || input; - } - - while (i-- && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - } - - if (!formatFunctions[format]) { - formatFunctions[format] = makeFormatFunction(format); - } - - return formatFunctions[format](m); - } - - - /************************************ - Parsing - ************************************/ - - - // get the regex to find the next token - function getParseRegexForToken(token) { - switch (token) { - case 'DDDD': - return parseTokenThreeDigits; - case 'YYYY': - return parseTokenFourDigits; - case 'YYYYY': - return parseTokenSixDigits; - case 'S': - case 'SS': - case 'SSS': - case 'DDD': - return parseTokenOneToThreeDigits; - case 'MMM': - case 'MMMM': - case 'dd': - case 'ddd': - case 'dddd': - case 'a': - case 'A': - return parseTokenWord; - case 'X': - return parseTokenTimestampMs; - case 'Z': - case 'ZZ': - return parseTokenTimezone; - case 'T': - return parseTokenT; - case 'MM': - case 'DD': - case 'YY': - case 'HH': - case 'hh': - case 'mm': - case 'ss': - case 'M': - case 'D': - case 'd': - case 'H': - case 'h': - case 'm': - case 's': - return parseTokenOneOrTwoDigits; - default : - return new RegExp(token.replace('\', '')); - } - } - - // function to convert string input to date - function addTimeToArrayFromToken(token, input, config) { - var a, b, - datePartArray = config._a; - - switch (token) { - // MONTH - case 'M' : // fall through to MM - case 'MM' : - datePartArray[1] = (input == null) ? 0 : ~~input - 1; - break; - case 'MMM' : // fall through to MMMM - case 'MMMM' : - a = getLangDefinition(config._l).monthsParse(input); - // if we didn't find a month name, mark the date as invalid. - if (a != null) { - datePartArray[1] = a; - } else { - config._isValid = false; - } - break; - // DAY OF MONTH - case 'D' : // fall through to DDDD - case 'DD' : // fall through to DDDD - case 'DDD' : // fall through to DDDD - case 'DDDD' : - if (input != null) { - datePartArray[2] = ~~input; - } - break; - // YEAR - case 'YY' : - datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000); - break; - case 'YYYY' : - case 'YYYYY' : - datePartArray[0] = ~~input; - break; - // AM / PM - case 'a' : // fall through to A - case 'A' : - config._isPm = ((input + '').toLowerCase() === 'pm'); - break; - // 24 HOUR - case 'H' : // fall through to hh - case 'HH' : // fall through to hh - case 'h' : // fall through to hh - case 'hh' : - datePartArray[3] = ~~input; - break; - // MINUTE - case 'm' : // fall through to mm - case 'mm' : - datePartArray[4] = ~~input; - break; - // SECOND - case 's' : // fall through to ss - case 'ss' : - datePartArray[5] = ~~input; - break; - // MILLISECOND - case 'S' : - case 'SS' : - case 'SSS' : - datePartArray[6] = ~~ (('0.' + input) * 1000); - break; - // UNIX TIMESTAMP WITH MS - case 'X': - config._d = new Date(parseFloat(input) * 1000); - break; - // TIMEZONE - case 'Z' : // fall through to ZZ - case 'ZZ' : - config._useUTC = true; - a = (input + '').match(parseTimezoneChunker); - if (a && a[1]) { - config._tzh = ~~a[1]; - } - if (a && a[2]) { - config._tzm = ~~a[2]; - } - // reverse offsets - if (a && a[0] === '+') { - config._tzh = -config._tzh; - config._tzm = -config._tzm; - } - break; - } - - // if the input is null, the date is not valid - if (input == null) { - config._isValid = false; - } - } - - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function dateFromArray(config) { - var i, date, input = []; - - if (config._d) { - return; - } - - for (i = 0; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; - } - - // add the offsets to the time to be parsed so that we can have a clean array for checking isValid - input[3] += config._tzh || 0; - input[4] += config._tzm || 0; - - date = new Date(0); - - if (config._useUTC) { - date.setUTCFullYear(input[0], input[1], input[2]); - date.setUTCHours(input[3], input[4], input[5], input[6]); - } else { - date.setFullYear(input[0], input[1], input[2]); - date.setHours(input[3], input[4], input[5], input[6]); - } - - config._d = date; - } - - // date from string and format string - function makeDateFromStringAndFormat(config) { - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var tokens = config._f.match(formattingTokens), - string = config._i, - i, parsedInput; - - config._a = []; - - for (i = 0; i < tokens.length; i++) { - parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0]; - if (parsedInput) { - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - } - // don't parse if its not a known token - if (formatTokenFunctions[tokens[i]]) { - addTimeToArrayFromToken(tokens[i], parsedInput, config); - } - } - // handle am pm - if (config._isPm && config._a[3] < 12) { - config._a[3] += 12; - } - // if is 12 am, change hours to 0 - if (config._isPm === false && config._a[3] === 12) { - config._a[3] = 0; - } - // return - dateFromArray(config); - } - - // date from string and array of format strings - function makeDateFromStringAndArray(config) { - var tempConfig, - tempMoment, - bestMoment, - - scoreToBeat = 99, - i, - currentDate, - currentScore; - - while (config._f.length) { - tempConfig = extend({}, config); - tempConfig._f = config._f.pop(); - makeDateFromStringAndFormat(tempConfig); - tempMoment = new Moment(tempConfig); - - if (tempMoment.isValid()) { - bestMoment = tempMoment; - break; - } - - currentScore = compareArrays(tempConfig._a, tempMoment.toArray()); - - if (currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempMoment; - } - } - - extend(config, bestMoment); - } - - // date from iso format - function makeDateFromString(config) { - var i, - string = config._i; - if (isoRegex.exec(string)) { - config._f = 'YYYY-MM-DDT'; - for (i = 0; i < 4; i++) { - if (isoTimes[i][1].exec(string)) { - config._f += isoTimes[i][0]; - break; - } - } - if (parseTokenTimezone.exec(string)) { - config._f += " Z"; - } - makeDateFromStringAndFormat(config); - } else { - config._d = new Date(string); - } - } - - function makeDateFromInput(config) { - var input = config._i, - matched = aspNetJsonRegex.exec(input); - - if (input === undefined) { - config._d = new Date(); - } else if (matched) { - config._d = new Date(+matched[1]); - } else if (typeof input === 'string') { - makeDateFromString(config); - } else if (isArray(input)) { - config._a = input.slice(0); - dateFromArray(config); - } else { - config._d = input instanceof Date ? new Date(+input) : new Date(input); - } - } - - - /************************************ - Relative Time - ************************************/ - - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) { - return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime(milliseconds, withoutSuffix, lang) { - var seconds = round(Math.abs(milliseconds) / 1000), - minutes = round(seconds / 60), - hours = round(minutes / 60), - days = round(hours / 24), - years = round(days / 365), - args = seconds < 45 && ['s', seconds] || - minutes === 1 && ['m'] || - minutes < 45 && ['mm', minutes] || - hours === 1 && ['h'] || - hours < 22 && ['hh', hours] || - days === 1 && ['d'] || - days <= 25 && ['dd', days] || - days <= 45 && ['M'] || - days < 345 && ['MM', round(days / 30)] || - years === 1 && ['y'] || ['yy', years]; - args[2] = withoutSuffix; - args[3] = milliseconds > 0; - args[4] = lang; - return substituteTimeAgo.apply({}, args); - } - - - /************************************ - Week of Year - ************************************/ - - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(); - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - return Math.ceil(moment(mom).add('d', daysToDayOfWeek).dayOfYear() / 7); - } - - - /************************************ - Top Level Functions - ************************************/ - - function makeMoment(config) { - var input = config._i, - format = config._f; - - if (input === null || input === '') { - return null; - } - - if (typeof input === 'string') { - config._i = input = getLangDefinition().preparse(input); - } - - if (moment.isMoment(input)) { - config = extend({}, input); - config._d = new Date(+input._d); - } else if (format) { - if (isArray(format)) { - makeDateFromStringAndArray(config); - } else { - makeDateFromStringAndFormat(config); - } - } else { - makeDateFromInput(config); - } - - return new Moment(config); - } - - moment = function (input, format, lang) { - return makeMoment({ - _i : input, - _f : format, - _l : lang, - _isUTC : false - }); - }; - - // creating with utc - moment.utc = function (input, format, lang) { - return makeMoment({ - _useUTC : true, - _isUTC : true, - _l : lang, - _i : input, - _f : format - }); - }; - - // creating with unix timestamp (in seconds) - moment.unix = function (input) { - return moment(input * 1000); - }; - - // duration - moment.duration = function (input, key) { - var isDuration = moment.isDuration(input), - isNumber = (typeof input === 'number'), - duration = (isDuration ? input._data : (isNumber ? {} : input)), - ret; - - if (isNumber) { - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } - - ret = new Duration(duration); - - if (isDuration && input.hasOwnProperty('_lang')) { - ret._lang = input._lang; - } - - return ret; - }; - - // version number - moment.version = VERSION; - - // default format - moment.defaultFormat = isoFormat; - - // This function will load languages and then set the global language. If - // no arguments are passed in, it will simply return the current global - // language key. - moment.lang = function (key, values) { - var i; - - if (!key) { - return moment.fn._lang._abbr; - } - if (values) { - loadLang(key, values); - } else if (!languages[key]) { - getLangDefinition(key); - } - moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key); - }; - - // returns language data - moment.langData = function (key) { - if (key && key._lang && key._lang._abbr) { - key = key._lang._abbr; - } - return getLangDefinition(key); - }; - - // compare moment object - moment.isMoment = function (obj) { - return obj instanceof Moment; - }; - - // for typechecking Duration objects - moment.isDuration = function (obj) { - return obj instanceof Duration; - }; - - - /************************************ - Moment Prototype - ************************************/ - - - moment.fn = Moment.prototype = { - - clone : function () { - return moment(this); - }, - - valueOf : function () { - return +this._d; - }, - - unix : function () { - return Math.floor(+this._d / 1000); - }, - - toString : function () { - return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); - }, - - toDate : function () { - return this._d; - }, - - toJSON : function () { - return moment.utc(this).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - }, - - toArray : function () { - var m = this; - return [ - m.year(), - m.month(), - m.date(), - m.hours(), - m.minutes(), - m.seconds(), - m.milliseconds() - ]; - }, - - isValid : function () { - if (this._isValid == null) { - if (this._a) { - this._isValid = !compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()); - } else { - this._isValid = !isNaN(this._d.getTime()); - } - } - return !!this._isValid; - }, - - utc : function () { - this._isUTC = true; - return this; - }, - - local : function () { - this._isUTC = false; - return this; - }, - - format : function (inputString) { - var output = formatMoment(this, inputString || moment.defaultFormat); - return this.lang().postformat(output); - }, - - add : function (input, val) { - var dur; - // switch args to support add('s', 1) and add(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, 1); - return this; - }, - - subtract : function (input, val) { - var dur; - // switch args to support subtract('s', 1) and subtract(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, -1); - return this; - }, - - diff : function (input, units, asFloat) { - var that = this._isUTC ? moment(input).utc() : moment(input).local(), - zoneDiff = (this.zone() - that.zone()) * 6e4, - diff, output; - - if (units) { - // standardize on singular form - units = units.replace(/s$/, ''); - } - - if (units === 'year' || units === 'month') { - diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 - output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); - output += ((this - moment(this).startOf('month')) - (that - moment(that).startOf('month'))) / diff; - if (units === 'year') { - output = output / 12; - } - } else { - diff = (this - that) - zoneDiff; - output = units === 'second' ? diff / 1e3 : // 1000 - units === 'minute' ? diff / 6e4 : // 1000 * 60 - units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 - units === 'day' ? diff / 864e5 : // 1000 * 60 * 60 * 24 - units === 'week' ? diff / 6048e5 : // 1000 * 60 * 60 * 24 * 7 - diff; - } - return asFloat ? output : absRound(output); - }, - - from : function (time, withoutSuffix) { - return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix); - }, - - fromNow : function (withoutSuffix) { - return this.from(moment(), withoutSuffix); - }, - - calendar : function () { - var diff = this.diff(moment().startOf('day'), 'days', true), - format = diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(this.lang().calendar(format, this)); - }, - - isLeapYear : function () { - var year = this.year(); - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - }, - - isDST : function () { - return (this.zone() < moment([this.year()]).zone() || - this.zone() < moment([this.year(), 5]).zone()); - }, - - day : function (input) { - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - return input == null ? day : - this.add({ d : input - day }); - }, - - startOf: function (units) { - units = units.replace(/s$/, ''); - // the following switch intentionally omits break keywords - // to utilize falling through the cases. - switch (units) { - case 'year': - this.month(0); - /* falls through */ - case 'month': - this.date(1); - /* falls through */ - case 'week': - case 'day': - this.hours(0); - /* falls through */ - case 'hour': - this.minutes(0); - /* falls through */ - case 'minute': - this.seconds(0); - /* falls through */ - case 'second': - this.milliseconds(0); - /* falls through */ - } - - // weeks are a special case - if (units === 'week') { - this.day(0); - } - - return this; - }, - - endOf: function (units) { - return this.startOf(units).add(units.replace(/s?$/, 's'), 1).subtract('ms', 1); - }, - - isAfter: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) > +moment(input).startOf(units); - }, - - isBefore: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) < +moment(input).startOf(units); - }, - - isSame: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) === +moment(input).startOf(units); - }, - - zone : function () { - return this._isUTC ? 0 : this._d.getTimezoneOffset(); - }, - - daysInMonth : function () { - return moment.utc([this.year(), this.month() + 1, 0]).date(); - }, - - dayOfYear : function (input) { - var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add("d", (input - dayOfYear)); - }, - - isoWeek : function (input) { - var week = weekOfYear(this, 1, 4); - return input == null ? week : this.add("d", (input - week) * 7); - }, - - week : function (input) { - var week = this.lang().week(this); - return input == null ? week : this.add("d", (input - week) * 7); - }, - - // If passed a language key, it will set the language for this - // instance. Otherwise, it will return the language configuration - // variables for this instance. - lang : function (key) { - if (key === undefined) { - return this._lang; - } else { - this._lang = getLangDefinition(key); - return this; - } - } - }; - - // helper for adding shortcuts - function makeGetterAndSetter(name, key) { - moment.fn[name] = moment.fn[name + 's'] = function (input) { - var utc = this._isUTC ? 'UTC' : ''; - if (input != null) { - this._d['set' + utc + key](input); - return this; - } else { - return this._d['get' + utc + key](); - } - }; - } - - // loop through and add shortcuts (Month, Date, Hours, Minutes, Seconds, Milliseconds) - for (i = 0; i < proxyGettersAndSetters.length; i ++) { - makeGetterAndSetter(proxyGettersAndSetters[i].toLowerCase().replace(/s$/, ''), proxyGettersAndSetters[i]); - } - - // add shortcut for year (uses different syntax than the getter/setter 'year' == 'FullYear') - makeGetterAndSetter('year', 'FullYear'); - - // add plural methods - moment.fn.days = moment.fn.day; - moment.fn.weeks = moment.fn.week; - moment.fn.isoWeeks = moment.fn.isoWeek; - - /************************************ - Duration Prototype - ************************************/ - - - moment.duration.fn = Duration.prototype = { - weeks : function () { - return absRound(this.days() / 7); - }, - - valueOf : function () { - return this._milliseconds + - this._days * 864e5 + - this._months * 2592e6; - }, - - humanize : function (withSuffix) { - var difference = +this, - output = relativeTime(difference, !withSuffix, this.lang()); - - if (withSuffix) { - output = this.lang().pastFuture(difference, output); - } - - return this.lang().postformat(output); - }, - - lang : moment.fn.lang - }; - - function makeDurationGetter(name) { - moment.duration.fn[name] = function () { - return this._data[name]; - }; - } - - function makeDurationAsGetter(name, factor) { - moment.duration.fn['as' + name] = function () { - return +this / factor; - }; - } - - for (i in unitMillisecondFactors) { - if (unitMillisecondFactors.hasOwnProperty(i)) { - makeDurationAsGetter(i, unitMillisecondFactors[i]); - makeDurationGetter(i.toLowerCase()); - } - } - - makeDurationAsGetter('Weeks', 6048e5); - - - /************************************ - Default Lang - ************************************/ - - - // Set default language, other languages will inherit from English. - moment.lang('en', { - ordinal : function (number) { - var b = number % 10, - output = (~~ (number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - - /************************************ - Exposing Moment - ************************************/ - - - // CommonJS module is defined - if (hasModule) { - module.exports = moment; - } - /*global ender:false */ - if (typeof ender === 'undefined') { - // here, `this` means `window` in the browser, or `global` on the server - // add `moment` as a global object via a string identifier, - // for Closure Compiler "advanced" mode - this['moment'] = moment; - } - /*global define:false */ - if (typeof define === "function" && define.amd) { - define("moment", [], function () { - return moment; - }); - } -}).call(this); \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/moment.min.js b/modules/enterprise/gui/coregui/src/main/webapp/js/moment.min.js deleted file mode 100644 index 4e8497a..0000000 --- a/modules/enterprise/gui/coregui/src/main/webapp/js/moment.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// moment.js -// version : 2.0.0 -// author : Tim Wood -// license : MIT -// momentjs.com -(function(e){function O(e,t){return function(n){return j(e.call(this,n),t)}}function M(e){return function(t){return this.lang().ordinal(e.call(this,t))}}function _(){}function D(e){H(this,e)}function P(e){var t=this._data={},n=e.years||e.year||e.y||0,r=e.months||e.month||e.M||0,i=e.weeks||e.week||e.w||0,s=e.days||e.day||e.d||0,o=e.hours||e.hour||e.h||0,u=e.minutes||e.minute||e.m||0,a=e.seconds||e.second||e.s||0,f=e.milliseconds||e.millisecond||e.ms||0;this._milliseconds=f+a*1e3+u*6e4+o*36e5,this._days=s+i*7,this._months=r+n*12,t.milliseconds=f%1e3,a+=B(f/1e3),t.seconds=a%60,u+=B(a/60),t.minutes=u%60,o+=B(u/60),t.hours=o%24,s+=B(o/24),s+=i*7,t.days=s%30,r+=B(s/30),t.months=r%12,n+=B(r/12),t.years=n}function H(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function B(e){return e<0?Math.ceil(e):Math.floor(e)}function j(e,t){var n=e+"";while(n.length<t)n="0"+n;return n}function F(e,t,n){var r=t._milliseconds,i=t._days,s=t._months,o;r&&e._d.setTime(+e+r*n),i&&e.dat e(e.date()+i*n),s&&(o=e.date(),e.date(1).month(e.month()+s*n).date(Math.min(o,e.daysInMonth())))}function I(e){return Object.prototype.toString.call(e)==="[object Array]"}function q(e,t){var n=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),i=0,s;for(s=0;s<n;s++)~~e[s]!==~~t[s]&&i++;return i+r}function R(e,t){return t.abbr=e,s[e]||(s[e]=new _),s[e].set(t),s[e]}function U(e){return e?(!s[e]&&o&&require("./lang/"+e),s[e]):t.fn._lang}function z(e){return e.match(/[.*]/)?e.replace(/^[|]$/g,""):e.replace(/\/g,"")}function W(e){var t=e.match(a),n,r;for(n=0,r=t.length;n<r;n++)A[t[n]]?t[n]=A[t[n]]:t[n]=z(t[n]);return function(i){var s="";for(n=0;n<r;n++)s+=typeof t[n].call=="function"?t[n].call(i,e):t[n];return s}}function X(e,t){function r(t){return e.lang().longDateFormat(t)||t}var n=5;while(n--&&f.test(t))t=t.replace(f,r);return C[t]||(C[t]=W(t)),C[t](e)}function V(e){switch(e){case"DDDD":return p;case"YYYY":return d;case"YYYYY":return v;case"S":case"SS":case"SSS": case"DDD":return h;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return m;case"X":return b;case"Z":case"ZZ":return g;case"T":return y;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return c;default:return new RegExp(e.replace("\",""))}}function $(e,t,n){var r,i,s=n._a;switch(e){case"M":case"MM":s[1]=t==null?0:~~t-1;break;case"MMM":case"MMMM":r=U(n._l).monthsParse(t),r!=null?s[1]=r:n._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":t!=null&&(s[2]=~~t);break;case"YY":s[0]=~~t+(~~t>68?1900:2e3);break;case"YYYY":case"YYYYY":s[0]=~~t;break;case"a":case"A":n._isPm=(t+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":s[3]=~~t;break;case"m":case"mm":s[4]=~~t;break;case"s":case"ss":s[5]=~~t;break;case"S":case"SS":case"SSS":s[6]=~~(("0."+t)*1e3);break;case"X":n._d=new Date(parseFloat(t)*1e3);break;case"Z":case"ZZ":n._useUTC=!0,r=(t+"").match(x),r&&r[1]&&(n._tzh=~~r[1]),r &&r[2]&&(n._tzm=~~r[2]),r&&r[0]==="+"&&(n._tzh=-n._tzh,n._tzm=-n._tzm)}t==null&&(n._isValid=!1)}function J(e){var t,n,r=[];if(e._d)return;for(t=0;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];r[3]+=e._tzh||0,r[4]+=e._tzm||0,n=new Date(0),e._useUTC?(n.setUTCFullYear(r[0],r[1],r[2]),n.setUTCHours(r[3],r[4],r[5],r[6])):(n.setFullYear(r[0],r[1],r[2]),n.setHours(r[3],r[4],r[5],r[6])),e._d=n}function K(e){var t=e._f.match(a),n=e._i,r,i;e._a=[];for(r=0;r<t.length;r++)i=(V(t[r]).exec(n)||[])[0],i&&(n=n.slice(n.indexOf(i)+i.length)),A[t[r]]&&$(t[r],i,e);e._isPm&&e._a[3]<12&&(e._a[3]+=12),e._isPm===!1&&e._a[3]===12&&(e._a[3]=0),J(e)}function Q(e){var t,n,r,i=99,s,o,u;while(e._f.length){t=H({},e),t._f=e._f.pop(),K(t),n=new D(t);if(n.isValid()){r=n;break}u=q(t._a,n.toArray()),u<i&&(i=u,r=n)}H(e,r)}function G(e){var t,n=e._i;if(w.exec(n)){e._f="YYYY-MM-DDT";for(t=0;t<4;t++)if(S[t][1].exec(n)){e._f+=S[t][0];break}g.exec(n)&&(e._f+=" Z"),K(e)}else e._d=new Date(n)}function Y(t){var n=t._i,r=u.exec(n);n===e?t._d=new Date:r?t._d=new Date(+r[1]):typeof n=="string"?G(t):I(n)?(t._a=n.slice(0),J(t)):t._d=n instanceof Date?new Date(+n):new Date(n)}function Z(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function et(e,t,n){var i=r(Math.abs(e)/1e3),s=r(i/60),o=r(s/60),u=r(o/24),a=r(u/365),f=i<45&&["s",i]||s===1&&["m"]||s<45&&["mm",s]||o===1&&["h"]||o<22&&["hh",o]||u===1&&["d"]||u<=25&&["dd",u]||u<=45&&["M"]||u<345&&["MM",r(u/30)]||a===1&&["y"]||["yy",a];return f[2]=t,f[3]=e>0,f[4]=n,Z.apply({},f)}function tt(e,n,r){var i=r-n,s=r-e.day();return s>i&&(s-=7),s<i-7&&(s+=7),Math.ceil(t(e).add("d",s).dayOfYear()/7)}function nt(e){var n=e._i,r=e._f;return n===null||n===""?null:(typeof n=="string"&&(e._i=n=U().preparse(n)),t.isMoment(n)?(e=H({},n),e._d=new Date(+n._d)):r?I(r)?Q(e):K(e):Y(e),new D(e))}function rt(e,n){t.fn[e]=t.fn[e+"s"]=function(e){var t=this._isUTC?"UTC":"";return e!=null?(this._d["set"+t+n](e),this):this._d["get"+t+n]()}}function it(e){t.duration.fn [e]=function(){return this._data[e]}}function st(e,n){t.duration.fn["as"+e]=function(){return+this/n}}var t,n="2.0.0",r=Math.round,i,s={},o=typeof module!="undefined"&&module.exports,u=/^/?Date((-?\d+)/i,a=/([[^[]*])|(\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,f=/([[^[]*])|(\)?(LT|LL?L?L?|l{1,4})/g,l=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,c=/\d\d?/,h=/\d{1,3}/,p=/\d{3}/,d=/\d{1,4}/,v=/[+-]?\d{1,6}/,m=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,g=/Z|[+-]\d\d:?\d\d/i,y=/T/i,b=/[+-]?\d+(.\d{1,3})?/,w=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(.\d\d?\d?)?)?)?)?([+-]\d\d:?\d\d)?)?/,E="YYYY-MM-DDTHH:mm:ssZ",S=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],x=/([+-]|\d\d)/gi,T="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("| "),N={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},C={},k="DDD w W M D d".split(" "),L="M D H h m s w W".split(" "),A={M:function(){return this.month()+1},MMM:function(e){return this.lang().monthsShort(this,e)},MMMM:function(e){return this.lang().months(this,e)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(e){return this.lang().weekdaysMin(this,e)},ddd:function(e){return this.lang().weekdaysShort(this,e)},dddd:function(e){return this.lang().weekdays(this,e)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return j(this.year()%100,2)},YYYY:function(){return j(this.year(),4)},YYYYY:function(){return j(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours() %12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return j(~~(this.milliseconds()/10),2)},SSS:function(){return j(this.milliseconds(),3)},Z:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+j(~~(e/60),2)+":"+j(~~e%60,2)},ZZ:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+j(~~(10*e/6),4)},X:function(){return this.unix()}};while(k.length)i=k.pop(),A[i+"o"]=M(A[i]);while(L.length)i=L.pop(),A[i+i]=O(A[i],2);A.DDDD=O(A.DDD,3),_.prototype={set:function(e){var t,n;for(n in e)t=e[n],typeof t=="function"?this[n]=t:this["_"+n]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(e){return this._months[e.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(e){return this._monthsShort[e.month()]},monthsParse:function(e){var n,r,i,s;this._monthsP arse||(this._monthsParse=[]);for(n=0;n<12;n++){this._monthsParse[n]||(r=t([2e3,n]),i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i"));if(this._monthsParse[n].test(e))return n}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(e){return this._weekdays[e.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(e){return this._weekdaysShort[e.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(e){return this._weekdaysMin[e.day()]},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(e){var t=this._longDateFormat[e];return!t&&this._longDateFormat[e.toUpperCase()]&&(t=this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]=t),t},meridiem:function(e,t,n){return e>11?n?"pm":"PM":n ?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},calendar:function(e,t){var n=this._calendar[e];return typeof n=="function"?n.apply(t):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(e,t,n,r){var i=this._relativeTime[n];return typeof i=="function"?i(e,t,n,r):i.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return typeof n=="function"?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return tt(e,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},t=function(e,t,n){return nt({_i:e,_f:t,_l:n,_isUTC:!1})},t.utc=function(e,t, n){return nt({_useUTC:!0,_isUTC:!0,_l:n,_i:e,_f:t})},t.unix=function(e){return t(e*1e3)},t.duration=function(e,n){var r=t.isDuration(e),i=typeof e=="number",s=r?e._data:i?{}:e,o;return i&&(n?s[n]=e:s.milliseconds=e),o=new P(s),r&&e.hasOwnProperty("_lang")&&(o._lang=e._lang),o},t.version=n,t.defaultFormat=E,t.lang=function(e,n){var r;if(!e)return t.fn._lang._abbr;n?R(e,n):s[e]||U(e),t.duration.fn._lang=t.fn._lang=U(e)},t.langData=function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),U(e)},t.isMoment=function(e){return e instanceof D},t.isDuration=function(e){return e instanceof P},t.fn=D.prototype={clone:function(){return t(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return t.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hou rs(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return this._isValid==null&&(this._a?this._isValid=!q(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray()):this._isValid=!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(e){var n=X(this,e||t.defaultFormat);return this.lang().postformat(n)},add:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,1),this},subtract:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,-1),this},diff:function(e,n,r){var i=this._isUTC?t(e).utc():t(e).local(),s=(this.zone()-i.zone())*6e4,o,u;return n&&(n=n.replace(/s$/,"")),n==="year"||n==="month"?(o=(this.daysInMonth()+i.daysInMonth())*432e5,u=(this.year()-i.year())*12+(this.month()-i.month()),u+=(this-t(this).startOf("month")-(i-t(i).startOf("month")))/o,n==="year"&&(u/=12)):(o=this-i-s,u=n==="second "?o/1e3:n==="minute"?o/6e4:n==="hour"?o/36e5:n==="day"?o/864e5:n==="week"?o/6048e5:o),r?u:B(u)},from:function(e,n){return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n)},fromNow:function(e){return this.from(t(),e)},calendar:function(){var e=this.diff(t().startOf("day"),"days",!0),n=e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse";return this.format(this.lang().calendar(n,this))},isLeapYear:function(){var e=this.year();return e%4===0&&e%100!==0||e%400===0},isDST:function(){return this.zone()<t([this.year()]).zone()||this.zone()<t([this.year(),5]).zone()},day:function(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e==null?t:this.add({d:e-t})},startOf:function(e){e=e.replace(/s$/,"");switch(e){case"year":this.month(0);case"month":this.date(1);case"week":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return e==="week"&&this.day(0) ,this},endOf:function(e){return this.startOf(e).add(e.replace(/s?$/,"s"),1).subtract("ms",1)},isAfter:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)>+t(e).startOf(n)},isBefore:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)<+t(e).startOf(n)},isSame:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)===+t(e).startOf(n)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return t.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(e){var n=r((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return e==null?n:this.add("d",e-n)},isoWeek:function(e){var t=tt(this,1,4);return e==null?t:this.add("d",(e-t)*7)},week:function(e){var t=this.lang().week(this);return e==null?t:this.add("d",(e-t)*7)},lang:function(t){return t===e?this._lang:(this._lang=U(t),this)}};for(i=0;i<T.length;i++)rt(T[i].toLowerCase().replace(/s$/,"" ),T[i]);rt("year","FullYear"),t.fn.days=t.fn.day,t.fn.weeks=t.fn.week,t.fn.isoWeeks=t.fn.isoWeek,t.duration.fn=P.prototype={weeks:function(){return B(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months*2592e6},humanize:function(e){var t=+this,n=et(t,!e,this.lang());return e&&(n=this.lang().pastFuture(t,n)),this.lang().postformat(n)},lang:t.fn.lang};for(i in N)N.hasOwnProperty(i)&&(st(i,N[i]),it(i.toLowerCase()));st("Weeks",6048e5),t.lang("en",{ordinal:function(e){var t=e%10,n=~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),o&&(module.exports=t),typeof ender=="undefined"&&(this.moment=t),typeof define=="function"&&define.amd&&define("moment",[],function(){return t})}).call(this); \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/rhq-4.9.0.js b/modules/enterprise/gui/coregui/src/main/webapp/js/rhq-4.9.0.js new file mode 100644 index 0000000..7e89bb1 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/webapp/js/rhq-4.9.0.js @@ -0,0 +1,183 @@ +/** + * RHQ Charting Javascript Functions. + */ + +/** + * ChartContext Constructor Object + * Contains all of the data required to render a chart. + * A ChartContext can be passed to multiple chart renders to display different chart types + * of that data. + * @param chartId + * @param chartHeight + * @param metricsData + * @param xAxisLabel + * @param chartTitle + * @param yAxisUnits + * @param minChartTitle + * @param avgChartTitle + * @param peakChartTitle + * @param dateLabel + * @param timeLabel + * @param downLabel + * @param unknownLabel + * @param noDataLabel + * @param hoverStartLabel + * @param hoverEndLabel + * @param hoverPeriodLabel + * @param hoverBarLabel + * @param chartHoverTimeFormat + * @param chartHoverDateFormat + * @param isPortalGraph + * @param portalId + * @param buttonBarDateTimeFormat + * @param singleValueLabel + * @param chartXaxisTimeFormatHours + * @param chartXaxisTimeFormatHoursMinutes + * @param hideLegend + * @constructor + */ +var ChartContext = function (chartId, chartHeight, metricsData, xAxisLabel, chartTitle, yAxisUnits, minChartTitle, avgChartTitle, peakChartTitle, dateLabel, timeLabel, downLabel, unknownLabel, noDataLabel, hoverStartLabel, hoverEndLabel, hoverPeriodLabel, hoverBarLabel, chartHoverTimeFormat, chartHoverDateFormat, isPortalGraph, portalId, buttonBarDateTimeFormat, singleValueLabel, chartXaxisTimeFormatHours, chartXaxisTimeFormatHoursMinutes, hideLegend) { + "use strict"; + if (!(this instanceof ChartContext)) { + throw new Error("ChartContext function cannot be called as a function."); + } + this.chartId = chartId; + this.chartHeight = chartHeight; + this.data = jQuery.parseJSON(metricsData); // make into json + this.xAxisLabel = xAxisLabel; + this.chartTitle = chartTitle; + this.yAxisUnits = yAxisUnits; + this.minChartTitle = minChartTitle; + this.avgChartTitle = avgChartTitle; + this.peakChartTitle = peakChartTitle; + this.dateLabel = dateLabel; + this.timeLabel = timeLabel; + this.downLabel = downLabel; + this.unknownLabel = unknownLabel; + this.singleValueLabel = singleValueLabel; + this.noDataLabel = noDataLabel; + this.hoverStartLabel = hoverStartLabel; + this.hoverEndLabel = hoverEndLabel; + this.hoverPeriodLabel = hoverPeriodLabel; + this.hoverBarLabel = hoverBarLabel; + this.chartHoverTimeFormat = chartHoverTimeFormat; + this.chartHoverDateFormat = chartHoverDateFormat; + this.isPortalGraph = isPortalGraph; + this.portalId = portalId; + if (isPortalGraph) { + this.chartHandle = "rChart-" + chartId + "-" + portalId; + } + else { + this.chartHandle = "rChart-" + chartId; + } + this.chartSelection = this.chartHandle + " svg"; + this.buttonBarDateTimeFormat = buttonBarDateTimeFormat; + this.chartXaxisTimeFormatHours = chartXaxisTimeFormatHours; + this.chartXaxisTimeFormatHoursMinutes = chartXaxisTimeFormatHoursMinutes; + this.hideLegend = hideLegend; + + }, + /** + * Availability Context object constructor + * @param chartId + * @param availData + * @param dateLabel + * @param timeLabel + * @param hoverStartLabel + * @param hoverBarLabel + * @param availabilityLabel + * @param chartHoverTimeFormat + * @param chartHoverDateFormat + * @param chartTitle + * @param chartUpLabel + * @param chartDownLabel + * @param chartXaxisTimeFormatHours + * @param chartXaxisTimeFormatHoursMinutes + * @constructor + */ + AvailChartContext = function (chartId, availData, dateLabel, timeLabel, hoverStartLabel, hoverBarLabel, availabilityLabel, chartHoverTimeFormat, chartHoverDateFormat, chartTitle, chartUpLabel, chartDownLabel, chartXaxisTimeFormatHours, chartXaxisTimeFormatHoursMinutes) { + "use strict"; + if (!(this instanceof AvailChartContext)) { + throw new Error("AvailChartContext function cannot be called as a function."); + } + this.chartId = chartId; + this.chartHandle = "#availChart-" + this.chartId; + this.chartSelection = this.chartHandle + " svg"; + this.data = jQuery.parseJSON(availData); // make into json + this.dateLabel = dateLabel; + this.timeLabel = timeLabel; + this.hoverStartLabel = hoverStartLabel; + this.hoverBarLabel = hoverBarLabel; + this.hoverBarAvailabilityLabel = availabilityLabel; + this.chartHoverTimeFormat = chartHoverTimeFormat; + this.chartHoverDateFormat = chartHoverDateFormat; + this.chartTitle = chartTitle; + this.chartDownLabel = chartDownLabel; + this.chartUpLabel = chartUpLabel; + this.chartXaxisTimeFormatHours = chartXaxisTimeFormatHours; + this.chartXaxisTimeFormatHoursMinutes = chartXaxisTimeFormatHoursMinutes; + + }, + + /** + * GraphDateContext object constructor. + * @param startDate moment object representing startDate range + * @param endDate moment object representing endDate range + * @constructor + */ + GraphDateContext = function (startDate, endDate) { + "use strict"; + if (!(this instanceof GraphDateContext)) { + throw new Error("GraphDateContext function cannot be called as a function."); + } + this.startDate = startDate; + this.endDate = endDate; + }, + rhqCommon = (function () { + "use strict"; + + + var timeFormat = function (formats) { + return function(date) { + var i = formats.length - 1, f = formats[i]; + while (!f[1](date)) f = formats[--i]; + return f[0](date); + }; + }; + + return { + getD3CustomTimeFormat: function (xAxisTimeFormatHours, xAxisTimeFormatHoursMinutes) { + return timeFormat([ + [d3.time.format("%Y"), function () { + return true; + }], + [d3.time.format("%B"), function (d) { + return d.getMonth(); + }], + [d3.time.format("%b %d"), function (d) { + return d.getDate() != 1; + }], + [d3.time.format("%a %d"), function (d) { + return d.getDay() && d.getDate() != 1; + }], + [d3.time.format(xAxisTimeFormatHours), function (d) { + return d.getHours(); + }], + [d3.time.format(xAxisTimeFormatHoursMinutes), function (d) { + return d.getMinutes(); + }], + [d3.time.format(":%S"), function (d) { + return d.getSeconds(); + }], + [d3.time.format(".%L"), function (d) { + return d.getMilliseconds(); + }] + ]); + } + + }; + })(); + + + + diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js b/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js deleted file mode 100644 index 7e89bb1..0000000 --- a/modules/enterprise/gui/coregui/src/main/webapp/js/rhq.js +++ /dev/null @@ -1,183 +0,0 @@ -/** - * RHQ Charting Javascript Functions. - */ - -/** - * ChartContext Constructor Object - * Contains all of the data required to render a chart. - * A ChartContext can be passed to multiple chart renders to display different chart types - * of that data. - * @param chartId - * @param chartHeight - * @param metricsData - * @param xAxisLabel - * @param chartTitle - * @param yAxisUnits - * @param minChartTitle - * @param avgChartTitle - * @param peakChartTitle - * @param dateLabel - * @param timeLabel - * @param downLabel - * @param unknownLabel - * @param noDataLabel - * @param hoverStartLabel - * @param hoverEndLabel - * @param hoverPeriodLabel - * @param hoverBarLabel - * @param chartHoverTimeFormat - * @param chartHoverDateFormat - * @param isPortalGraph - * @param portalId - * @param buttonBarDateTimeFormat - * @param singleValueLabel - * @param chartXaxisTimeFormatHours - * @param chartXaxisTimeFormatHoursMinutes - * @param hideLegend - * @constructor - */ -var ChartContext = function (chartId, chartHeight, metricsData, xAxisLabel, chartTitle, yAxisUnits, minChartTitle, avgChartTitle, peakChartTitle, dateLabel, timeLabel, downLabel, unknownLabel, noDataLabel, hoverStartLabel, hoverEndLabel, hoverPeriodLabel, hoverBarLabel, chartHoverTimeFormat, chartHoverDateFormat, isPortalGraph, portalId, buttonBarDateTimeFormat, singleValueLabel, chartXaxisTimeFormatHours, chartXaxisTimeFormatHoursMinutes, hideLegend) { - "use strict"; - if (!(this instanceof ChartContext)) { - throw new Error("ChartContext function cannot be called as a function."); - } - this.chartId = chartId; - this.chartHeight = chartHeight; - this.data = jQuery.parseJSON(metricsData); // make into json - this.xAxisLabel = xAxisLabel; - this.chartTitle = chartTitle; - this.yAxisUnits = yAxisUnits; - this.minChartTitle = minChartTitle; - this.avgChartTitle = avgChartTitle; - this.peakChartTitle = peakChartTitle; - this.dateLabel = dateLabel; - this.timeLabel = timeLabel; - this.downLabel = downLabel; - this.unknownLabel = unknownLabel; - this.singleValueLabel = singleValueLabel; - this.noDataLabel = noDataLabel; - this.hoverStartLabel = hoverStartLabel; - this.hoverEndLabel = hoverEndLabel; - this.hoverPeriodLabel = hoverPeriodLabel; - this.hoverBarLabel = hoverBarLabel; - this.chartHoverTimeFormat = chartHoverTimeFormat; - this.chartHoverDateFormat = chartHoverDateFormat; - this.isPortalGraph = isPortalGraph; - this.portalId = portalId; - if (isPortalGraph) { - this.chartHandle = "rChart-" + chartId + "-" + portalId; - } - else { - this.chartHandle = "rChart-" + chartId; - } - this.chartSelection = this.chartHandle + " svg"; - this.buttonBarDateTimeFormat = buttonBarDateTimeFormat; - this.chartXaxisTimeFormatHours = chartXaxisTimeFormatHours; - this.chartXaxisTimeFormatHoursMinutes = chartXaxisTimeFormatHoursMinutes; - this.hideLegend = hideLegend; - - }, - /** - * Availability Context object constructor - * @param chartId - * @param availData - * @param dateLabel - * @param timeLabel - * @param hoverStartLabel - * @param hoverBarLabel - * @param availabilityLabel - * @param chartHoverTimeFormat - * @param chartHoverDateFormat - * @param chartTitle - * @param chartUpLabel - * @param chartDownLabel - * @param chartXaxisTimeFormatHours - * @param chartXaxisTimeFormatHoursMinutes - * @constructor - */ - AvailChartContext = function (chartId, availData, dateLabel, timeLabel, hoverStartLabel, hoverBarLabel, availabilityLabel, chartHoverTimeFormat, chartHoverDateFormat, chartTitle, chartUpLabel, chartDownLabel, chartXaxisTimeFormatHours, chartXaxisTimeFormatHoursMinutes) { - "use strict"; - if (!(this instanceof AvailChartContext)) { - throw new Error("AvailChartContext function cannot be called as a function."); - } - this.chartId = chartId; - this.chartHandle = "#availChart-" + this.chartId; - this.chartSelection = this.chartHandle + " svg"; - this.data = jQuery.parseJSON(availData); // make into json - this.dateLabel = dateLabel; - this.timeLabel = timeLabel; - this.hoverStartLabel = hoverStartLabel; - this.hoverBarLabel = hoverBarLabel; - this.hoverBarAvailabilityLabel = availabilityLabel; - this.chartHoverTimeFormat = chartHoverTimeFormat; - this.chartHoverDateFormat = chartHoverDateFormat; - this.chartTitle = chartTitle; - this.chartDownLabel = chartDownLabel; - this.chartUpLabel = chartUpLabel; - this.chartXaxisTimeFormatHours = chartXaxisTimeFormatHours; - this.chartXaxisTimeFormatHoursMinutes = chartXaxisTimeFormatHoursMinutes; - - }, - - /** - * GraphDateContext object constructor. - * @param startDate moment object representing startDate range - * @param endDate moment object representing endDate range - * @constructor - */ - GraphDateContext = function (startDate, endDate) { - "use strict"; - if (!(this instanceof GraphDateContext)) { - throw new Error("GraphDateContext function cannot be called as a function."); - } - this.startDate = startDate; - this.endDate = endDate; - }, - rhqCommon = (function () { - "use strict"; - - - var timeFormat = function (formats) { - return function(date) { - var i = formats.length - 1, f = formats[i]; - while (!f[1](date)) f = formats[--i]; - return f[0](date); - }; - }; - - return { - getD3CustomTimeFormat: function (xAxisTimeFormatHours, xAxisTimeFormatHoursMinutes) { - return timeFormat([ - [d3.time.format("%Y"), function () { - return true; - }], - [d3.time.format("%B"), function (d) { - return d.getMonth(); - }], - [d3.time.format("%b %d"), function (d) { - return d.getDate() != 1; - }], - [d3.time.format("%a %d"), function (d) { - return d.getDay() && d.getDate() != 1; - }], - [d3.time.format(xAxisTimeFormatHours), function (d) { - return d.getHours(); - }], - [d3.time.format(xAxisTimeFormatHoursMinutes), function (d) { - return d.getMinutes(); - }], - [d3.time.format(":%S"), function (d) { - return d.getSeconds(); - }], - [d3.time.format(".%L"), function (d) { - return d.getMilliseconds(); - }] - ]); - } - - }; - })(); - - - -
rhq-commits@lists.fedorahosted.org