diff --git a/CHANGELOG.md b/CHANGELOG.md
index ec6048c..308d071 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+# 1.36.0 (08/04/2016)
+
+## Features
+
+ - Dashboard Performance: optimized dashboard and widget performance
+
+ - Animations: Enabled assorted animations across Cyclotron, e.g. transitioning accordions, slide-in dialogs.
+
+ - Dashboard Sidebar: Show/Hide Widgets: added a master toggle to show or hide all widgets
+
+## Bug Fixes
+
+ - Number Widget: improved auto-scaling algorithm to avoid situations with overlapping or truncated text
+
# 1.35.0 (07/21/2016)
## Features
diff --git a/cyclotron-site/app/partials/dashboard.jade b/cyclotron-site/app/partials/dashboard.jade
index ca80902..8259616 100644
--- a/cyclotron-site/app/partials/dashboard.jade
+++ b/cyclotron-site/app/partials/dashboard.jade
@@ -1,6 +1,5 @@
-//- Dashboards
-div.dashboard.dashboard-page-background(ng-class='{ "has-sidebar": dashboard.sidebar.showDashboardSidebar }')
+.dashboard.dashboard-page-background(ng-class='{ "has-sidebar": dashboard.sidebar.showDashboardSidebar }')
.click-cover
@@ -16,7 +15,7 @@ div.dashboard.dashboard-page-background(ng-class='{ "has-sidebar": dashboard.sid
i.fa.fa-chevron-right(ng-click='moveForward()', ng-class='{ disabled: !canMoveForward() }', title='Go to the next page')
.dashboard-pages
- div(dashboard-page, ng-repeat='page in currentPage',
+ dashboard-page(ng-repeat='page in currentPage',
dashboard='dashboard', page='page', page-number='{{ currentPageIndex }}',
page-overrides='dashboardOverrides.pages[currentPageIndex]')
diff --git a/cyclotron-site/app/partials/dashboardSidebar.jade b/cyclotron-site/app/partials/dashboardSidebar.jade
index e53e675..0679a9e 100644
--- a/cyclotron-site/app/partials/dashboardSidebar.jade
+++ b/cyclotron-site/app/partials/dashboardSidebar.jade
@@ -25,18 +25,25 @@
accordion-group(ng-repeat='content in dashboard.sidebar.sidebarContent track by $index', heading='{{ content.heading }}')
div(ng-bind-html='trustHtml(content.html)')
- accordion-group(heading='Show/Hide Widgets', ng-if='dashboard.sidebar.showHideWidgets == true')
+ accordion-group.show-hide-widgets(heading='Show/Hide Widgets', ng-if='dashboard.sidebar.showHideWidgets == true')
table.table
tr(ng-repeat='widget in widgetVisibilities track by $index')
td {{ widget.label }}
td
switch(ng-model='widget.visible', ng-change='changeVisibility(widget, $index)')
+ tr
+ td(colspan='2')
+ hr
+ tr
+ td All Widgets
+ td
+ switch(ng-model='allWidgetsVisible', ng-change='toggleAllWidgets()')
p.centered
a(ng-click='resetDashboardOverrides()', title='Reset to default')
i.fa.fa-refresh
| Reset to default
.sidebar-footer
.logos
- a.logo(ng-repeat='logo in footerLogos', title='{{ logo.title }}',
- ng-href='{{ logo.href }}', target='_self')
- img(ng-src='{{ logo.src }}', alt='{{ logo.title }}')
+ a.logo(ng-repeat='logo in ::footerLogos', title='{{ ::logo.title }}',
+ ng-href='{{ ::logo.href }}', target='_self')
+ img(ng-src='{{ ::logo.src }}', alt='{{ ::logo.title }}')
diff --git a/cyclotron-site/app/scripts/common/app.coffee b/cyclotron-site/app/scripts/common/app.coffee
index 7359aef..a489c81 100644
--- a/cyclotron-site/app/scripts/common/app.coffee
+++ b/cyclotron-site/app/scripts/common/app.coffee
@@ -36,6 +36,7 @@ $ ->
# Cyclotron main application
cyclotronApp = angular.module 'cyclotronApp', [
+ 'ngAnimate'
'ngResource'
'ngSanitize'
'ngTranscludeMod'
diff --git a/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee b/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee
index 25c472d..9b89bb9 100644
--- a/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee
+++ b/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee
@@ -26,7 +26,7 @@ cyclotronServices.factory 'commonConfigService', ->
exports = {
- version: '1.35.0'
+ version: '1.36.0'
logging:
enableDebug: false
diff --git a/cyclotron-site/app/scripts/common/services/services.userService.coffee b/cyclotron-site/app/scripts/common/services/services.userService.coffee
index 6948e79..65bc628 100644
--- a/cyclotron-site/app/scripts/common/services/services.userService.coffee
+++ b/cyclotron-site/app/scripts/common/services/services.userService.coffee
@@ -162,7 +162,7 @@ cyclotronServices.factory 'userService', ($http, $q, $localForage, configService
promise.success (results) ->
deferred.resolve(results)
promise.error (error) ->
- console.log('UserService error: ' + error)
+ logService.error('UserService error: ' + error)
deferred.reject()
return deferred.promise
diff --git a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.cyclotronData.coffee b/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.cyclotronData.coffee
index 20c608d..f87a655 100644
--- a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.cyclotronData.coffee
+++ b/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.cyclotronData.coffee
@@ -35,7 +35,6 @@ cyclotronDataSources.factory 'cyclotrondataDataSource', ($q, $http, configServic
# Successful Result
successCallback = (result) ->
- console.log result
q.resolve
'0':
data: result.data
diff --git a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee b/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
index 470244e..4b2bd04 100644
--- a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
+++ b/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.splunk.coffee
@@ -28,7 +28,7 @@
# response is not valid JSON. This Data Source fixes the response, parses it into a
# JSON array, and selects the final result. All the preview results are ignored.
#
-cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, dataSourceFactory) ->
+cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, dataSourceFactory, logService) ->
getSplunkUrl = (options) ->
# Using 'json_rows' mode since 'json' is not actually valid JSON
@@ -43,10 +43,8 @@ cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, data
.search searchOptions
.toString()
- console.log uri
return uri
-
getProxyRequest = (options) ->
# Format: https://github.com/mikeal/request#requestoptions-callback
{
@@ -82,7 +80,7 @@ cyclotronDataSources.factory 'splunkDataSource', ($q, $http, configService, data
# Select the final result (non-preview)
splunkResult = _.find results, { preview: false }
catch e
- console.log 'Unexpected response from Splunk: ' + proxyResult.body
+ logService.error 'Unexpected response from Splunk: ' + proxyResult.body
splunkResult = null
return errorCallback 'Error retrieving data from Splunk', -1 unless _.isObject splunkResult
diff --git a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboard.coffee b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboard.coffee
index 4b0bb31..3895cb7 100644
--- a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboard.coffee
+++ b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboard.coffee
@@ -26,14 +26,15 @@
#
cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configService, layoutService, logService) ->
{
- restrict: 'AC'
+ restrict: 'C'
link: (scope, element, attrs) ->
$element = $(element)
$dashboardSidebar = $element.children '.dashboard-sidebar'
$dashboardControls = $element.children '.dashboard-controls'
- scope.controlTimer = null
+ controlTimer = null
+ controlTarget = null
calculateMouseTarget = ->
# Get all dimensions and the padding options
@@ -46,7 +47,7 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS
return unless $dashboardControls? and controlOffset?
- scope.controlTarget = {
+ controlTarget = {
top: controlOffset.top - padY
bottom: controlOffset.top + controlHeight + padY
left: controlOffset.left - padX
@@ -61,18 +62,18 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS
$dashboardControls.addClass 'active'
# Set timer to remove the controls after some delay
- $timeout.cancel(scope.controlTimer) if scope.controlTimer?
+ $timeout.cancel(controlTimer) if controlTimer?
- scope.controlTimer = $timeout(makeControlsDisappear, configService.dashboard.controls.duration)
+ controlTimer = $timeout(makeControlsDisappear, configService.dashboard.controls.duration)
, 500, { leading: true })
controlHitTest = (event) ->
- return unless scope.controlTarget?
+ return unless controlTarget?
# Abort if outside the target
- if event.pageX < scope.controlTarget.left ||
- event.pageX > scope.controlTarget.right ||
- event.pageY < scope.controlTarget.top ||
- event.pageY > scope.controlTarget.bottom
+ if event.pageX < controlTarget.left ||
+ event.pageX > controlTarget.right ||
+ event.pageY < controlTarget.top ||
+ event.pageY > controlTarget.bottom
return
makeControlsAppear()
@@ -89,9 +90,7 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS
$(document).on 'scroll', calculateMouseTarget
- $(window).on 'resize', _.debounce(->
- scope.$apply(calculateMouseTarget)
- , 500, { leading: false, maxWait: 1000 })
+ $(window).on 'resize', _.debounce(calculateMouseTarget, 500, { leading: false })
#
# Cleanup
@@ -102,7 +101,7 @@ cyclotronDirectives.directive 'dashboard', ($compile, $window, $timeout, configS
$(window).off 'resize', calculateMouseTarget
# Cancel timer
- $timeout.cancel(scope.controlTimer) if scope.controlTimer?
+ $timeout.cancel(controlTimer) if controlTimer?
return
}
diff --git a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardPage.coffee b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardPage.coffee
index 57eecf5..c556d9f 100644
--- a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardPage.coffee
+++ b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardPage.coffee
@@ -27,7 +27,7 @@
cyclotronDirectives.directive 'dashboardPage', ($compile, $window, $timeout, configService, layoutService, logService) ->
{
replace: true
- restrict: 'A'
+ restrict: 'E'
scope:
page: '='
diff --git a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee
index a483b2b..cb2afdb 100644
--- a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee
+++ b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee
@@ -19,7 +19,7 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
restrict: 'EAC'
link: (scope, element, attrs) ->
# Initial position
- scope.sidebarExpanded = false
+ isSidebarExpanded = false
$element = $(element)
$parent = $element.parent()
@@ -31,8 +31,8 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
$expanderIcon = $expander.children 'i'
$clickCover = $parent.find '.click-cover'
- scope.$watch 'sidebarExpanded', (expanded) ->
- if expanded
+ updateExpandedState = ->
+ if isSidebarExpanded
$element.removeClass 'collapsed'
$clickCover.css 'display', 'block'
$expanderIcon.removeClass 'fa-caret-right'
@@ -47,21 +47,19 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
$hitbox.on 'click', (event) ->
event.preventDefault()
- scope.$apply ->
- scope.sidebarExpanded = !scope.sidebarExpanded
+ isSidebarExpanded = !isSidebarExpanded
+ updateExpandedState()
$clickCover.on 'click', (event) ->
event.preventDefault()
- scope.$apply ->
- scope.sidebarExpanded = false
+ isSidebarExpanded = false
+ updateExpandedState()
# Resize accordion around header/footer
sizer = ->
$accordion.height($element.outerHeight() - $header.outerHeight() - $footer.outerHeight())
- $element.on 'resize', _.debounce(->
- scope.$apply sizer
- , 300, { leading: false, maxWait: 600 })
+ $element.on 'resize', _.debounce sizer, 300, { leading: false, maxWait: 600 }
# Run in 100ms
timer = $timeout sizer, 100
@@ -76,8 +74,9 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
$scope.footerLogos = configService.dashboardSidebar?.footer?.logos || []
$scope.widgetVisibilities = []
$scope.widgetOverrides = []
+ $scope.allWidgetsVisible = false
- $scope.updateVisibility = ->
+ updateVisibility = ->
actualWidgets = $scope.currentPage[0]?.widgets
$scope.widgetOverrides = $scope.dashboardOverrides?.pages[$scope.currentPageIndex]?.widgets
@@ -94,6 +93,9 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
label: dashboardService.getWidgetName(widget, index)
visible: visible
}
+
+ visibleWidgets = _.filter($scope.widgetVisibilities, { visible: true }).length
+ $scope.allWidgetsVisible = (visibleWidgets / $scope.widgetVisibilities.length) > 0.5
$scope.changeVisibility = (widget, index) ->
@@ -103,14 +105,19 @@ cyclotronDirectives.directive 'dashboardSidebar', ($timeout, layoutService) ->
$scope.widgetOverrides[index].hidden = true
return
- $scope.$watch 'currentPage', (currentPage) ->
+ $scope.toggleAllWidgets = ->
+ _.each $scope.widgetOverrides, (widget) ->
+ widget.hidden = $scope.allWidgetsVisible
+ return
+ return
+
+ $scope.$watchCollection 'currentPage', (currentPage) ->
return unless currentPage?.length > 0
- $scope.updateVisibility()
- , true
+ updateVisibility()
$scope.$watch 'dashboardOverrides', (dashboardOverrides) ->
return unless dashboardOverrides?
- $scope.updateVisibility()
+ updateVisibility()
, true
}
diff --git a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee
index 071a6b6..edbec71 100644
--- a/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee
+++ b/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardWidget.coffee
@@ -31,14 +31,20 @@ cyclotronDirectives.directive 'dashboardWidget', (layoutService) ->
return
- scope.$watch('layout', (layout) ->
+ scope.$watch 'layout', (layout) ->
return unless layout?
# Set the border width if overloaded (otherwise keep theme default)
if layout.borderWidth?
$element.css('border-width', layout.borderWidth + 'px')
- , true)
+ return
+
+ controller: ($scope) ->
+
+ # Evaluate Title of Widget
+ $scope.widgetTitle = -> _.jsExec $scope.widget.title
return
+
}
diff --git a/cyclotron-site/app/scripts/dashboards/directives/directives.sidebarAccordion.coffee b/cyclotron-site/app/scripts/dashboards/directives/directives.sidebarAccordion.coffee
index c916fdb..09a515d 100644
--- a/cyclotron-site/app/scripts/dashboards/directives/directives.sidebarAccordion.coffee
+++ b/cyclotron-site/app/scripts/dashboards/directives/directives.sidebarAccordion.coffee
@@ -74,7 +74,7 @@ cyclotronDirectives.directive 'sidebarAccordion', ($sce, $timeout) ->
sizer = ->
scope.accordionHeight = scope.getAccordionHeight()
- $(element).on 'resize', _.throttle(->
+ $(element).on 'resize', _.debounce(->
scope.$apply sizer
, 100)
diff --git a/cyclotron-site/app/scripts/dashboards/directives/directives.widget.coffee b/cyclotron-site/app/scripts/dashboards/directives/directives.widget.coffee
index 15811ca..3a608bc 100644
--- a/cyclotron-site/app/scripts/dashboards/directives/directives.widget.coffee
+++ b/cyclotron-site/app/scripts/dashboards/directives/directives.widget.coffee
@@ -63,45 +63,45 @@ cyclotronDirectives.directive 'widget', ($compile, $sce, $window, layoutService)
# Apply overrides if necessary (mobile devices)
if layout.forceGridWidth?
if scope.widget.gridWidth == layout.originalGridColumns
- scope.widgetGridWidth = layout.gridColumns
+ widgetGridWidth = layout.gridColumns
else
- scope.widgetGridWidth = layout.forceGridWidth
- scope.widgetWidth = null
+ widgetGridWidth = layout.forceGridWidth
+ widgetWidth = null
else
- scope.widgetGridWidth = scope.widget.gridWidth
- scope.widgetWidth = scope.widget.width
+ widgetGridWidth = scope.widget.gridWidth
+ widgetWidth = scope.widget.width
if layout.forceGridHeight?
if scope.widget.gridHeight == layout.originalGridRows
- scope.widgetGridHeight = layout.gridRows
+ widgetGridHeight = layout.gridRows
else
- scope.widgetGridHeight = layout.forceGridHeight
- scope.widgetHeight = null
+ widgetGridHeight = layout.forceGridHeight
+ widgetHeight = null
else
- scope.widgetGridHeight = scope.widget.gridHeight
- scope.widgetHeight = scope.widget.height
+ widgetGridHeight = scope.widget.gridHeight
+ widgetHeight = scope.widget.height
# Calculate widget dimensions
- if scope.widgetHeight?
- scope.widgetHeight = scope.widget.height
- else if scope.widgetGridHeight?
- scope.widgetHeight = layout.gridSquareHeight * scope.widgetGridHeight + ((layout.gutter) * (scope.widgetGridHeight - 1))
-
- if scope.widgetWidth?
- scope.widgetWidth = scope.widget.width
- else if scope.widgetGridWidth?
- scope.widgetWidth = layout.gridSquareWidth * scope.widgetGridWidth + (layout.gutter * (scope.widgetGridWidth - 1))
+ if widgetHeight?
+ widgetHeight = scope.widget.height
+ else if widgetGridHeight?
+ widgetHeight = layout.gridSquareHeight * widgetGridHeight + ((layout.gutter) * (widgetGridHeight - 1))
+
+ if widgetWidth?
+ widgetWidth = scope.widget.width
+ else if widgetGridWidth?
+ widgetWidth = layout.gridSquareWidth * widgetGridWidth + (layout.gutter * (widgetGridWidth - 1))
else
- scope.widgetWidth = layout.gridSquareWidth
+ widgetWidth = layout.gridSquareWidth
# Set height/width
- scope.widgetWidth = Math.floor(scope.widgetWidth) if _.isNumber(scope.widgetWidth)
- scope.widgetHeight = Math.floor(scope.widgetHeight) if _.isNumber(scope.widgetHeight)
- $element.width scope.widgetWidth
- $element.height scope.widgetHeight
+ widgetWidth = Math.floor(widgetWidth) if _.isNumber(widgetWidth)
+ widgetHeight = Math.floor(widgetHeight) if _.isNumber(widgetHeight)
+ $element.width widgetWidth
+ $element.height widgetHeight
$element.css 'display', 'block'
- if scope.widgetWidth < scope.widgetHeight
+ if widgetWidth < widgetHeight
$element.addClass 'widget-skinny'
else
$element.removeClass 'widget-skinny'
@@ -165,8 +165,9 @@ cyclotronDirectives.directive 'widget', ($compile, $sce, $window, layoutService)
template = '' + template
if widget.helpText?
+ # Store Help Text in scope for tooltip
scope.helpText = _.jsExec widget.helpText
- template = '' + template
+ template = '' + template
compiledValue = $compile(template)(scope)
@@ -177,7 +178,7 @@ cyclotronDirectives.directive 'widget', ($compile, $sce, $window, layoutService)
return
# Watch for page layout changes and resize the widget
- scope.$watch 'layout', updateLayout, true
+ scope.$watch 'layout', updateLayout
# Watch for widget visibility to change
scope.$watch 'pageOverrides', (-> updateLayout(scope.layout)), true
diff --git a/cyclotron-site/app/scripts/mgmt/directives/directives.metricsGraphics.coffee b/cyclotron-site/app/scripts/mgmt/directives/directives.metricsGraphics.coffee
index 6a32f2e..fb87dfb 100644
--- a/cyclotron-site/app/scripts/mgmt/directives/directives.metricsGraphics.coffee
+++ b/cyclotron-site/app/scripts/mgmt/directives/directives.metricsGraphics.coffee
@@ -24,7 +24,7 @@ cyclotronDirectives.directive 'metricsGraphics', ->
link: (scope, element) ->
$element = $(element)
- scope.width = $element.width()
+ chartWidth = $element.width()
# Generate random element ID
if _.isEmpty $element.prop('id')
@@ -37,7 +37,7 @@ cyclotronDirectives.directive 'metricsGraphics', ->
options =
title: null
height: 200
- width: scope.width
+ width: chartWidth
target: '#' + scope.id
data: scope.data
interpolate: 'cardinal'
@@ -59,8 +59,7 @@ cyclotronDirectives.directive 'metricsGraphics', ->
redraw()
$element.resize _.debounce ->
- scope.$apply ->
- scope.width = $element.width()
- redraw()
- , 90, { leading: false, maxWait: 200 }
+ chartWidth = $element.width()
+ redraw()
+ , 100, { leading: false, maxWait: 300 }
}
diff --git a/cyclotron-site/app/styles/dashboards/_sidebar.less b/cyclotron-site/app/styles/dashboards/_sidebar.less
index 4379df5..8d3d55f 100644
--- a/cyclotron-site/app/styles/dashboards/_sidebar.less
+++ b/cyclotron-site/app/styles/dashboards/_sidebar.less
@@ -130,6 +130,12 @@
font-size: @sidebar-heading-font-size;
}
}
+
+ .show-hide-widgets {
+ p.centered {
+ margin-bottom: 1rem;
+ }
+ }
}
.sidebar-footer {
diff --git a/cyclotron-site/app/widgets/annotationChart/annotationChart.jade b/cyclotron-site/app/widgets/annotationChart/annotationChart.jade
index d89e2d1..548d579 100644
--- a/cyclotron-site/app/widgets/annotationChart/annotationChart.jade
+++ b/cyclotron-site/app/widgets/annotationChart/annotationChart.jade
@@ -1,5 +1,5 @@
.annotation-chart-widget(ng-controller='AnnotationChartWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.annotation-editor(ng-if='selectedPoint')
button.btn.btn-link(type='button',
diff --git a/cyclotron-site/app/widgets/annotationChart/annotationChartWidget.coffee b/cyclotron-site/app/widgets/annotationChart/annotationChartWidget.coffee
index fac67ba..cdc3947 100644
--- a/cyclotron-site/app/widgets/annotationChart/annotationChartWidget.coffee
+++ b/cyclotron-site/app/widgets/annotationChart/annotationChartWidget.coffee
@@ -49,8 +49,6 @@ cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, cyclotr
moment(d).toDate()
else _.identity
- $scope.widgetTitle = -> _.jsExec $scope.widget.title
-
# Evaluates a list of series objects and stores in $scope.series
# Auto-assigns missing annotation columns
$scope.updateSeries = ->
@@ -165,7 +163,7 @@ cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, cyclotr
$scope.dataSource.execute(true)
$scope.handleError = (message) ->
- console.log 'Annotation Chart error: ' + message
+ logService.error 'Annotation Chart error: ' + message
$scope.selectItem = (selectedItem) ->
if _.isUndefined(selectedItem) or $scope.widget.annotationEditing != true or _.isEmpty($scope.widget.annotationKey)
@@ -174,8 +172,7 @@ cyclotronApp.controller 'AnnotationChartWidget', ($scope, configService, cyclotr
seriesId = $scope.chartObject.data.cols[selectedItem.column].id
selectedSeries = _.find $scope.series, { id: seriesId }
- console.log 'Selected Series'
- console.log selectedSeries
+
$scope.selectedPoint =
x: $scope.data[selectedItem.row][$scope.xAxisId]
series: selectedSeries
diff --git a/cyclotron-site/app/widgets/chart/chart.jade b/cyclotron-site/app/widgets/chart/chart.jade
index 5c4b8e7..1fcdf2e 100644
--- a/cyclotron-site/app/widgets/chart/chart.jade
+++ b/cyclotron-site/app/widgets/chart/chart.jade
@@ -1,5 +1,5 @@
.chart-widget(ng-controller='ChartWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.spinjs(ng-if='loading')
.widget-error(ng-if='dataSourceError == true && !loading')
diff --git a/cyclotron-site/app/widgets/chart/chartWidget.coffee b/cyclotron-site/app/widgets/chart/chartWidget.coffee
index f53291a..71d0ae6 100644
--- a/cyclotron-site/app/widgets/chart/chartWidget.coffee
+++ b/cyclotron-site/app/widgets/chart/chartWidget.coffee
@@ -37,8 +37,6 @@ cyclotronApp.controller 'ChartWidget', ($scope, dashboardService, dataService) -
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
- $scope.widgetTitle = -> _.jsExec $scope.widget.title
-
getChart = ->
defaults =
credits:
diff --git a/cyclotron-site/app/widgets/chart/directives.highchart.coffee b/cyclotron-site/app/widgets/chart/directives.highchart.coffee
index 6210c92..818f877 100644
--- a/cyclotron-site/app/widgets/chart/directives.highchart.coffee
+++ b/cyclotron-site/app/widgets/chart/directives.highchart.coffee
@@ -38,20 +38,23 @@ cyclotronDirectives.directive 'highchart', (configService) ->
link: (scope, element, attrs) ->
$element = $(element)
$parent = $element.parent()
+ $title = $parent.children('h1')
+
+ # Reference to Highcharts Chart object
+ highchartsObj = null
resize = ->
# Set height
parentHeight = $parent.height()
- title = $parent.children('h1')
- if title.length
- $element.height(parentHeight - title.height())
+ if $title.length
+ $element.height(parentHeight - $title.height())
else
$element.height(parentHeight)
# Set highcharts size
- if scope.chartObj?
- scope.chartObj.setSize($parent.width(), $element.height(), false)
+ if highchartsObj?
+ highchartsObj.setSize($parent.width(), $element.height(), false)
chartDefaults =
chart:
@@ -69,12 +72,12 @@ cyclotronDirectives.directive 'highchart', (configService) ->
resize()
# Create or Update
- if scope.chartObj? && _.isEqual(_.omit(scope.currentChart, 'series'), _.omit(chart, 'series'))
+ if highchartsObj? && _.isEqual(_.omit(scope.currentChart, 'series'), _.omit(chart, 'series'))
seriesToRemove = []
# Update each series with new data
- _.each scope.chartObj.series, (aSeries) ->
+ _.each highchartsObj.series, (aSeries) ->
newSeries = _.find chart.series, { name: aSeries.name }
# Remove the series from the chart if it doesn't exist anymore.
@@ -102,22 +105,22 @@ cyclotronDirectives.directive 'highchart', (configService) ->
# Add new series to the chart
_.each chart.series, (toSeries, index) ->
- existingSeries = _.find scope.chartObj.series, { name: toSeries.name }
+ existingSeries = _.find highchartsObj.series, { name: toSeries.name }
if !existingSeries?
- scope.chartObj.addSeries(toSeries, false)
+ highchartsObj.addSeries(toSeries, false)
# Remove any missing series
_.each seriesToRemove, (aSeries) ->
aSeries.remove(false)
# Redraw at once
- scope.chartObj.redraw()
+ highchartsObj.redraw()
else
# Clean up old chart if exists
- if scope.chartObj?
- scope.chartObj.destroy()
+ if highchartsObj?
+ highchartsObj.destroy()
newChart = _.cloneDeep(chart)
scope.currentChart = chart
@@ -130,29 +133,24 @@ cyclotronDirectives.directive 'highchart', (configService) ->
_.merge(newChart, chartDefaults, _.default)
scope.chartSeries = newChart.series
- scope.chartObj = new Highcharts.Chart(newChart)
+ highchartsObj = new Highcharts.Chart(newChart)
, true)
#
# Resize when layout changes
#
- resizeFunction = ->
- scope.$apply ->
- _.delay(resize, 100)
- _.delay(resize, 450)
-
+ resizeFunction = _.debounce resize, 100, { leading: false, maxWait: 300 }
$(window).on 'resize', resizeFunction
-
#
# Cleanup
#
scope.$on '$destroy', ->
$(window).off 'resize', resizeFunction
- if scope.chartObj?
- scope.chartObj.destroy()
- delete scope.chartObj
+ if highchartsObj?
+ highchartsObj.destroy()
+ highchartsObj = null
return
}
diff --git a/cyclotron-site/app/widgets/html/html.jade b/cyclotron-site/app/widgets/html/html.jade
index d29ea5a..3e11fe7 100644
--- a/cyclotron-site/app/widgets/html/html.jade
+++ b/cyclotron-site/app/widgets/html/html.jade
@@ -1,7 +1,7 @@
//- Embedded Html Widget
.html-widget(ng-controller='HtmlWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.spinjs(ng-if='loading')
.widget-error(ng-if='dataSourceError == true && !loading')
diff --git a/cyclotron-site/app/widgets/html/htmlWidget.coffee b/cyclotron-site/app/widgets/html/htmlWidget.coffee
index 0210a4a..02a24f7 100644
--- a/cyclotron-site/app/widgets/html/htmlWidget.coffee
+++ b/cyclotron-site/app/widgets/html/htmlWidget.coffee
@@ -36,8 +36,6 @@ cyclotronApp.controller 'HtmlWidget', ($scope, dashboardService, dataService) ->
$scope.htmlStrings = []
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
-
if $scope.widget.preHtml?
$scope.preHtml = _.jsExec $scope.widget.preHtml
diff --git a/cyclotron-site/app/widgets/image/image.jade b/cyclotron-site/app/widgets/image/image.jade
index 68f9318..785368b 100644
--- a/cyclotron-site/app/widgets/image/image.jade
+++ b/cyclotron-site/app/widgets/image/image.jade
@@ -1,5 +1,5 @@
.image-widget(ng-controller='ImageWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.widget-body
a(ng-if='link', ng-href='{{ link }}', target='{{ linkTarget() }}')
diff --git a/cyclotron-site/app/widgets/image/imageWidget.coffee b/cyclotron-site/app/widgets/image/imageWidget.coffee
index 856c651..7255da1 100644
--- a/cyclotron-site/app/widgets/image/imageWidget.coffee
+++ b/cyclotron-site/app/widgets/image/imageWidget.coffee
@@ -26,8 +26,6 @@ cyclotronApp.controller 'ImageWidget', ($scope, $interval) ->
$scope.link = $scope.currentImage.link
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
-
$scope.linkTarget = ->
if $scope.dashboard.openLinksInNewWindow == false then '_self' else '_blank'
diff --git a/cyclotron-site/app/widgets/javascript/javascript.jade b/cyclotron-site/app/widgets/javascript/javascript.jade
index 94e62ba..ae6216a 100644
--- a/cyclotron-site/app/widgets/javascript/javascript.jade
+++ b/cyclotron-site/app/widgets/javascript/javascript.jade
@@ -1,5 +1,5 @@
div.javascript-widget(ng-controller='JavascriptWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.spinjs(ng-if='loading')
.widget-error(ng-if='dataSourceError && !loading')
diff --git a/cyclotron-site/app/widgets/javascript/javascriptWidget.coffee b/cyclotron-site/app/widgets/javascript/javascriptWidget.coffee
index ac72381..83168c7 100644
--- a/cyclotron-site/app/widgets/javascript/javascriptWidget.coffee
+++ b/cyclotron-site/app/widgets/javascript/javascriptWidget.coffee
@@ -37,7 +37,6 @@ cyclotronApp.controller 'JavascriptWidget', ($scope, dashboardService, dataServi
$scope.data = null
$scope.jsObject = _.executeFunctionByName($scope.widget.functionName, window, $scope.widget)
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
$scope.reload = ->
$scope.dataSource.execute(true)
diff --git a/cyclotron-site/app/widgets/number/directives.theNumber.coffee b/cyclotron-site/app/widgets/number/directives.theNumber.coffee
index ac8a2a7..67fd513 100644
--- a/cyclotron-site/app/widgets/number/directives.theNumber.coffee
+++ b/cyclotron-site/app/widgets/number/directives.theNumber.coffee
@@ -71,11 +71,12 @@ cyclotronDirectives.directive 'theNumber', ($timeout) ->
fontSize = Math.min(102, numberHeight / 2)
iterations = 0
currentWidth = 0
+ currentHeight = 0
sizeMe = ->
h1.css('font-size', fontSize + 'px')
h1.css('line-height', fontSize + 'px')
- spans.css('font-size', fontSize*.75 + 'px')
+ spans.css('font-size', fontSize * 0.75 + 'px')
iterations++
currentWidth = 0
@@ -83,8 +84,15 @@ cyclotronDirectives.directive 'theNumber', ($timeout) ->
currentWidth = h1.width()
else
$element.children().each -> currentWidth += $(this).width()
+
+ currentHeight = 0
+ if scope.isHorizontal
+ $element.children().each -> currentHeight += $(this).height()
+ else
+ currentHeight = h1.height()
+
sizeMe()
- while (currentWidth + 25 >= numberWidth || h1.height() > fontSize * 2) && iterations < 15
+ while ((currentWidth + 25 >= numberWidth || h1.height() > fontSize * 2) or currentHeight > numberHeight) && iterations < 25
fontSize -= 4
sizeMe()
@@ -101,7 +109,7 @@ cyclotronDirectives.directive 'theNumber', ($timeout) ->
spans.each -> currentWidth = Math.max(currentWidth, $(this).width())
sizePrefixSuffix()
- sizePrefixSuffix() while currentWidth + 15 >= numberWidth && iterations < 10
+ sizePrefixSuffix() while currentWidth + 15 >= numberWidth && iterations < 15
# Set everything to block display now
h1.css('display', 'block')
@@ -117,17 +125,16 @@ cyclotronDirectives.directive 'theNumber', ($timeout) ->
return
# Update on window resizing
- $widgetBody.on 'resize', _.throttle(->
- scope.$apply ->
- sizer()
- , 80)
+ resizeFunction = _.debounce sizer, 100, { leading: false, maxWait: 300 }
+ $widgetBody.on 'resize', resizeFunction
+ # Resize now
$timeout(sizer, 10)
#
# Cleanup
#
scope.$on '$destroy', ->
- $widgetBody.off 'resize'
+ $widgetBody.off 'resize', resizeFunction
return
}
diff --git a/cyclotron-site/app/widgets/number/number.jade b/cyclotron-site/app/widgets/number/number.jade
index 81caa22..5effc6e 100644
--- a/cyclotron-site/app/widgets/number/number.jade
+++ b/cyclotron-site/app/widgets/number/number.jade
@@ -1,6 +1,6 @@
.number-widget(ng-controller='NumberWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.widget-body
diff --git a/cyclotron-site/app/widgets/number/numberWidget.coffee b/cyclotron-site/app/widgets/number/numberWidget.coffee
index 6111067..14e1bce 100644
--- a/cyclotron-site/app/widgets/number/numberWidget.coffee
+++ b/cyclotron-site/app/widgets/number/numberWidget.coffee
@@ -39,8 +39,6 @@ cyclotronApp.controller 'NumberWidget', ($scope, dashboardService, dataService)
if $scope.numberCount <= 4 and $scope.widget.autoSize != false
$scope.isHorizontal = !$scope.isHorizontal
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
-
$scope.linkTarget = ->
if $scope.dashboard.openLinksInNewWindow == false then '_self' else '_blank'
diff --git a/cyclotron-site/app/widgets/qrcode/directives.qrcode.coffee b/cyclotron-site/app/widgets/qrcode/directives.qrcode.coffee
index 506bce9..55282ef 100644
--- a/cyclotron-site/app/widgets/qrcode/directives.qrcode.coffee
+++ b/cyclotron-site/app/widgets/qrcode/directives.qrcode.coffee
@@ -45,5 +45,14 @@ cyclotronDirectives.directive 'qrcode', ->
scope.$watch 'options', (options) ->
makeCode()
- $widget.resize makeCode
+ # Update on window resizing
+ resizeFunction = _.debounce makeCode, 100, { leading: false, maxWait: 300 }
+ $widget.on 'resize', resizeFunction
+
+ #
+ # Cleanup
+ #
+ scope.$on '$destroy', ->
+ $widget.off 'resize', resizeFunction
+ return
}
diff --git a/cyclotron-site/app/widgets/stoplight/directives.trafficlight.coffee b/cyclotron-site/app/widgets/stoplight/directives.trafficlight.coffee
index 419c46d..cc3a9fe 100644
--- a/cyclotron-site/app/widgets/stoplight/directives.trafficlight.coffee
+++ b/cyclotron-site/app/widgets/stoplight/directives.trafficlight.coffee
@@ -90,11 +90,7 @@ cyclotronDirectives.directive 'trafficlight', ($timeout) ->
})
# Update on parent resizing
- $widgetBody.on 'resize', _.throttle(->
- scope.$apply ->
- sizer()
- , 50)
-
+ $widgetBody.on 'resize', _.debounce sizer, 100, { leading: false, maxWait: 300 }
$timeout(sizer, 10)
scope.$watch 'activeColor', (color) ->
diff --git a/cyclotron-site/app/widgets/stoplight/stoplight.jade b/cyclotron-site/app/widgets/stoplight/stoplight.jade
index 20e66f3..7e29a25 100644
--- a/cyclotron-site/app/widgets/stoplight/stoplight.jade
+++ b/cyclotron-site/app/widgets/stoplight/stoplight.jade
@@ -1,5 +1,5 @@
.stoplight-widget(ng-controller='StoplightWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.widget-body
diff --git a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee b/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee
index e6345eb..9198231 100644
--- a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee
+++ b/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee
@@ -25,8 +25,6 @@ cyclotronApp.controller 'StoplightWidget', ($scope, dashboardService, dataServic
$scope.activeColor = null
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
-
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?
diff --git a/cyclotron-site/app/widgets/table/directives.tableFixedHeader.coffee b/cyclotron-site/app/widgets/table/directives.tableFixedHeader.coffee
index 666d330..1510ea7 100644
--- a/cyclotron-site/app/widgets/table/directives.tableFixedHeader.coffee
+++ b/cyclotron-site/app/widgets/table/directives.tableFixedHeader.coffee
@@ -84,7 +84,7 @@ cyclotronDirectives.directive 'tableFixedHeader', ($window, configService) ->
$widgetBody.on 'resize', _.throttle(resize, 250, { leading: false, maxWait: 500 })
- scope.$watch 'sortBy+sortedRows', _.throttle(resize, 200, { leading: false, trailing: true })
+ scope.$watchGroup ['sortBy', 'sortedRows'], _.throttle(resize, 200, { leading: false, trailing: true })
#
# Handle scroll events
diff --git a/cyclotron-site/app/widgets/table/table.jade b/cyclotron-site/app/widgets/table/table.jade
index a4b34f4..4de090a 100644
--- a/cyclotron-site/app/widgets/table/table.jade
+++ b/cyclotron-site/app/widgets/table/table.jade
@@ -1,5 +1,5 @@
.table-widget(ng-controller='TableWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.widget-body
.spinjs(ng-if='loading')
@@ -15,29 +15,29 @@
th.group(ng-repeat='group in columnGroups', colspan='{{ group.length }}',
ng-class='{ empty: group.name === null }') {{ group.name }}
tr(table-row)
- th(ng-repeat='column in columns', ng-class='{ empty: column.label === "" }', title='{{ column.headerTooltip }}')
- a(ng-if='widget.enableSort != false', ng-click='selectSort(column.name)') {{ column.label }}
- span(ng-if='widget.enableSort == false') {{ column.label }}
+ th(ng-repeat='column in columns', ng-class='{ empty: column.label === "" }', title='{{ ::column.headerTooltip }}')
+ a(ng-if='widget.enableSort != false', ng-click='selectSort(column.name)') {{ ::column.label }}
+ span(ng-if='widget.enableSort == false') {{ ::column.label }}
i.fa.fa-sort-up(ng-show='isSorted(column.name, true)')
i.fa.fa-sort-down(ng-show='isSorted(column.name, false)')
i.fa.fa-sort-down.invisible(ng-show='!isSorted(column.name, false) && !isSorted(column.name, true)')
tbody
tr(ng-repeat='row in sortedRows | limitTo:paging.itemsPerPage:(paging.currentPage-1)*paging.itemsPerPage', table-rule, table-row)
- td(ng-repeat='column in columns', table-rule, table-column,
+ td(ng-repeat='column in ::columns', table-rule, table-column,
ng-class='{hidden: getRowSpan(row, column) == 0, aLink: getCellProperty(row, column, "link"), actionable: column.onClick}',
rowspan='{{ getRowSpan(row, column) }}',
title='{{ getCellProperty(row, column, "tooltip") }}'
ng-click='onClickEvent(row, column)')
- img(ng-if='getCellProperty(row, column, "image")', ng-src='{{ getCellProperty(row, column, "image") }}', style='height: {{ getCellProperty(row, column, "imageHeight", "1em") }};')
+ img(ng-if='::getCellProperty(row, column, "image")', ng-src='{{ ::getCellProperty(row, column, "image") }}', style='height: {{ ::getCellProperty(row, column, "imageHeight", "1em") }};')
- i(ng-if='getCellProperty(row, column, "icon")', class='fa {{ getCellProperty(row, column, "icon") }}', ng-style='{color: getCellProperty(row, column, "iconColor")}')
+ i(ng-if='::getCellProperty(row, column, "icon")', class='fa {{ ::getCellProperty(row, column, "icon") }}', ng-style='{color: getCellProperty(row, column, "iconColor")}')
//- Normal text output
- span(ng-if='!getCellProperty(row, column, "link")') {{ getText(row, column) }}
+ span(ng-if='::!getCellProperty(row, column, "link")') {{ ::getText(row, column) }}
//- Link if the column specifies a link
- a(ng-if='getCellProperty(row, column, "link")', target='{{ linkTarget(column) }}', ng-href='{{ getCellProperty(row, column, "link") }}') {{ getText(row, column) }}
+ a(ng-if='getCellProperty(row, column, "link")', target='{{ ::linkTarget(column) }}', ng-href='{{ ::getCellProperty(row, column, "link") }}') {{ ::getText(row, column) }}
i.fa.fa-external-link
.paging(ng-if='widget.pagination.enabled')
diff --git a/cyclotron-site/app/widgets/table/tableWidget.coffee b/cyclotron-site/app/widgets/table/tableWidget.coffee
index 9c8e802..e4e5608 100644
--- a/cyclotron-site/app/widgets/table/tableWidget.coffee
+++ b/cyclotron-site/app/widgets/table/tableWidget.coffee
@@ -28,7 +28,7 @@
# Optionally, headers can be provided by the callback as well
#
-cyclotronApp.controller 'TableWidget', ($scope, $location, dashboardService, dataService) ->
+cyclotronApp.controller 'TableWidget', ($scope, $location, dashboardService, dataService, logService) ->
$scope.loading = false
$scope.dataSourceError = false
@@ -46,8 +46,6 @@ cyclotronApp.controller 'TableWidget', ($scope, $location, dashboardService, dat
if $scope.widget.pagination?.enabled
$scope.paging.itemsPerPage = $scope.widget.pagination.itemsPerPage
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
-
$scope.linkTarget = (column) ->
if column.openLinksInNewWindow?
if column.openLinksInNewWindow == false then '_self' else '_blank'
@@ -173,7 +171,7 @@ cyclotronApp.controller 'TableWidget', ($scope, $location, dashboardService, dat
# Set matching rule properties
row.__matchingRules.push matchingRule
catch
- console.log('Table Widget: Error in rule: ' + rule.rule)
+ logService.error('Table Widget: Error in rule: ' + rule.rule)
return
# Process the rows to collect row groups
@@ -239,7 +237,7 @@ cyclotronApp.controller 'TableWidget', ($scope, $location, dashboardService, dat
try
regex = new RegExp(column.name.substring(1, column.name.length-1), 'i')
catch
- console.log('Table Widget: Error in column regex: ' + column.name)
+ logService.error('Table Widget: Error in column regex: ' + column.name)
return
remainingColumns = _.difference(headers, usedHeaders)
diff --git a/cyclotron-site/app/widgets/treemap/directives.treemap.coffee b/cyclotron-site/app/widgets/treemap/directives.treemap.coffee
index d30ed46..e98c715 100644
--- a/cyclotron-site/app/widgets/treemap/directives.treemap.coffee
+++ b/cyclotron-site/app/widgets/treemap/directives.treemap.coffee
@@ -392,19 +392,18 @@ cyclotronDirectives.directive 'treemap', ($window) ->
display(root)
# Update on window resizing
- $widgetBody.on 'resize', _.throttle(->
- scope.$apply ->
- # Recalculate dimensions
- resize()
- initialize(scope.data)
- layout(scope.data)
-
- # Remove last displayed element so it can be redrawn without duplicating
- d3.select(_.last(svgInner.selectAll('.depth')[0])).remove()
-
- # Redraw
- display(scope.data)
- , 80)
+ $widgetBody.on 'resize', _.debounce ->
+ # Recalculate dimensions
+ resize()
+ initialize(scope.data)
+ layout(scope.data)
+
+ # Remove last displayed element so it can be redrawn without duplicating
+ d3.select(_.last(svgInner.selectAll('.depth')[0])).remove()
+
+ # Redraw
+ display(scope.data)
+ , 100, { leading: false, maxWait: 300 }
#
# Cleanup
diff --git a/cyclotron-site/app/widgets/treemap/treemap.jade b/cyclotron-site/app/widgets/treemap/treemap.jade
index fc51383..0181187 100644
--- a/cyclotron-site/app/widgets/treemap/treemap.jade
+++ b/cyclotron-site/app/widgets/treemap/treemap.jade
@@ -1,6 +1,6 @@
div.treemap-widget(ng-controller='TreemapWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.widget-body
diff --git a/cyclotron-site/app/widgets/treemap/treemapWidget.coffee b/cyclotron-site/app/widgets/treemap/treemapWidget.coffee
index 782527f..c5c81a5 100644
--- a/cyclotron-site/app/widgets/treemap/treemapWidget.coffee
+++ b/cyclotron-site/app/widgets/treemap/treemapWidget.coffee
@@ -25,8 +25,6 @@ cyclotronApp.controller 'TreemapWidget', ($scope, dashboardService, dataService)
$scope.legendHeight = $scope.widget.legendHeight || 30
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
-
$scope.reload = ->
$scope.dataSource.execute(true)
diff --git a/cyclotron-site/app/widgets/youtube/youtube.jade b/cyclotron-site/app/widgets/youtube/youtube.jade
index f79917e..155238f 100644
--- a/cyclotron-site/app/widgets/youtube/youtube.jade
+++ b/cyclotron-site/app/widgets/youtube/youtube.jade
@@ -1,5 +1,5 @@
.youtube-widget(ng-controller='YoutubeWidget')
- h1.title(ng-if='widget.title') {{ widgetTitle() }}
+ h1.title(ng-if='::widget.title') {{ widgetTitle() }}
.widget-body
iframe(ng-src='{{ getUrl() }}',
diff --git a/cyclotron-site/app/widgets/youtube/youtubeWidget.coffee b/cyclotron-site/app/widgets/youtube/youtubeWidget.coffee
index 0e937cc..4f1b562 100644
--- a/cyclotron-site/app/widgets/youtube/youtubeWidget.coffee
+++ b/cyclotron-site/app/widgets/youtube/youtubeWidget.coffee
@@ -14,9 +14,7 @@
# language governing permissions and limitations under the License.
###
-cyclotronApp.controller 'YoutubeWidget', ($scope, $interval) ->
-
- $scope.widgetTitle = -> _.jsExec($scope.widget.title)
+cyclotronApp.controller 'YoutubeWidget', ($scope, logService) ->
#
# For reference: https://developers.google.com/youtube/player_parameters
@@ -64,5 +62,5 @@ cyclotronApp.controller 'YoutubeWidget', ($scope, $interval) ->
if properties.length > 0
url = url + '?' + properties.join '&'
- console.log url
+ logService.debug 'YouTube URL:', url
return $scope.$sce.trustAsResourceUrl(url)
diff --git a/cyclotron-site/bower.json b/cyclotron-site/bower.json
index d65883c..f402bb7 100644
--- a/cyclotron-site/bower.json
+++ b/cyclotron-site/bower.json
@@ -17,6 +17,7 @@
"ace-builds": "1.1.8",
"alertify.js": "0.3.11",
"angular": "1.4.9",
+ "angular-animate": "1.4.9",
"angular-bootstrap": "1.2.4",
"angular-cookies": "1.4.9",
"angular-google-chart": "angular-google-chart#9588ed2",
diff --git a/cyclotron-site/package.json b/cyclotron-site/package.json
index 6eb47b4..5666f8f 100644
--- a/cyclotron-site/package.json
+++ b/cyclotron-site/package.json
@@ -1,7 +1,7 @@
{
"name": "cyclotron-site",
"description": "Cyclotron: website",
- "version": "1.35.0",
+ "version": "1.36.0",
"author": "Dave Bauman ",
"license": "MIT",
"private": true,
diff --git a/cyclotron-svc/package.json b/cyclotron-svc/package.json
index 68aacc8..13d7dbb 100644
--- a/cyclotron-svc/package.json
+++ b/cyclotron-svc/package.json
@@ -1,7 +1,7 @@
{
"name": "cyclotron-svc",
"description": "Cyclotron: REST API",
- "version": "1.35.0",
+ "version": "1.36.0",
"author": "Dave Bauman ",
"license": "MIT",
"private": true,