diff --git a/plugins/Overlay/Controller.php b/plugins/Overlay/Controller.php index 0c10d1e230029699d9e9cc1558e0098f2561ae52..ecb5192108a769dac53dd92f082dedc40562d696 100644 --- a/plugins/Overlay/Controller.php +++ b/plugins/Overlay/Controller.php @@ -112,6 +112,8 @@ class Piwik_Overlay_Controller extends Piwik_Controller $view = Piwik_View::factory('sidebar'); $view->data = $data; $view->location = $page; + $view->normalizedUrl = $normalizedCurrentUrl; + $view->label = $label; $view->idSite = $idSite; $view->period = $period; $view->date = $date; diff --git a/plugins/Overlay/templates/index.css b/plugins/Overlay/templates/index.css index d142c7f8b46596814023018a9321f665a84bf2e0..42efdcf0dd52075f35375e2c1cc728c415222cb3 100644 --- a/plugins/Overlay/templates/index.css +++ b/plugins/Overlay/templates/index.css @@ -1,4 +1,15 @@ +html { + width: 100%; + height: 100%; +} + +body { + width: 100%; + height: 100%; + overflow: hidden; +} + body #header { margin-left: -12px; } @@ -48,18 +59,35 @@ body h1 { color: #255792; } -a#Overlay_FullScreen { +a#Overlay_FullScreen, +a#Overlay_RowEvolution, +a#Overlay_Transitions { display: block; color: #255792; font-size: 13px; line-height: 15px; - margin: 20px 0 0 5px; - padding: 8px 0 3px 22px; - background: url(../../../themes/default/images/fullscreen.png) no-repeat 0 8px; + margin: 0 0 0 5px; + padding: 8px 0 3px 25px; text-decoration: none; } -a#Overlay_FullScreen:hover { +a#Overlay_RowEvolution { + margin-top: 20px; + background: url(../../../themes/default/images/row_evolution_hover.png) no-repeat 0 7px; +} + +a#Overlay_Transitions { + background: url(../../Transitions/templates/transitions_icon_hover.png) no-repeat 0 6px; +} + +a#Overlay_FullScreen { + margin-top: 20px; + background: url(../../../themes/default/images/fullscreen.png) no-repeat 3px 8px; +} + +a#Overlay_FullScreen:hover, +a#Overlay_RowEvolution:hover, +a#Overlay_Transitions:hover { color: #E87500; } diff --git a/plugins/Overlay/templates/index.js b/plugins/Overlay/templates/index.js index 02521af8dd9f80229c7ef54f5a750504f84d7815..42116e62e6587468fd49dcbc0e4111f9f4d3f5c2 100644 --- a/plugins/Overlay/templates/index.js +++ b/plugins/Overlay/templates/index.js @@ -7,7 +7,8 @@ var Piwik_Overlay = (function() { - var $body, $iframe, $sidebar, $main, $location, $loading, $errorNotLoading, $fullScreenLink; + var $body, $iframe, $sidebar, $main, $location, $loading, $errorNotLoading; + var $rowEvolutionLink, $transitionsLink, $fullScreenLink; var idSite, period, date; @@ -16,6 +17,8 @@ var Piwik_Overlay = (function() { var iframeSrcBase; var iframeDomain = ''; var iframeCurrentPage = ''; + var iframeCurrentPageNormalized = ''; + var iframeCurrentActionLabel = ''; var updateComesFromInsideFrame = false; @@ -38,6 +41,8 @@ var Piwik_Overlay = (function() { var $responseLocation = $response.find('.Overlay_Location'); var $url = $responseLocation.find('span'); + iframeCurrentPageNormalized = $url.data('normalizedUrl'); + iframeCurrentActionLabel = $url.data('label'); $url.html(piwikHelper.addBreakpointsToUrl($url.text())); $location.html($responseLocation.html()).show(); $responseLocation.remove(); @@ -53,13 +58,18 @@ var Piwik_Overlay = (function() { }); $sidebar.empty().append($response).show(); + + if ($sidebar.find('.Overlay_NoData').size() == 0) { + $rowEvolutionLink.show(); + $transitionsLink.show() + } }, 'html'); } /** Adjust the dimensions of the iframe */ function adjustDimensions() { $iframe.height($(window).height()); - $iframe.width($body.width() - $iframe.offset().left - 2); + $iframe.width($body.width() - $iframe.offset().left - 2); // -2 because of 2px border } /** Display the loading message and hide other containers */ @@ -68,7 +78,11 @@ var Piwik_Overlay = (function() { $sidebar.hide(); $location.hide(); + $fullScreenLink.hide(); + $rowEvolutionLink.hide(); + $transitionsLink.hide(); + $errorNotLoading.hide(); // Start a timeout that shows an error when nothing is loaded @@ -123,6 +137,9 @@ var Piwik_Overlay = (function() { $main = $('#Overlay_Main'); $loading = $('#Overlay_Loading'); $errorNotLoading = $('#Overlay_Error_NotLoading'); + + $rowEvolutionLink = $('#Overlay_RowEvolution'); + $transitionsLink = $('#Overlay_Transitions'); $fullScreenLink = $('#Overlay_FullScreen'); adjustDimensions(); @@ -164,6 +181,20 @@ var Piwik_Overlay = (function() { $select.prepend('<option selected="selected">'); } + // handle transitions link + $transitionsLink.click(function() { + var transitions = new Piwik_Transitions('url', iframeCurrentPageNormalized, null); + transitions.showPopover(); + return false; + }); + + // handle row evolution link + $rowEvolutionLink.click(function() { + var rowEvolution = new DataTable_RowActions_RowEvolution(null); + rowEvolution.showRowEvolution('Actions.getPageUrls', iframeCurrentActionLabel, '0'); + return false; + }); + // handle full screen link $fullScreenLink.click(function() { var href = iframeSrcBase; diff --git a/plugins/Overlay/templates/index.tpl b/plugins/Overlay/templates/index.tpl index 192416287a3e134a9779b39f63852375355cf2d3..cd03e8d018065d7a509b129b12f8c581054d5780 100644 --- a/plugins/Overlay/templates/index.tpl +++ b/plugins/Overlay/templates/index.tpl @@ -33,6 +33,9 @@ <div id="Overlay_Sidebar"></div> +<a id="Overlay_RowEvolution">{'CoreHome_RowEvolutionRowActionTooltipTitle_js'|translate|escape:'html'}</a> +<a id="Overlay_Transitions">{'CoreHome_TransitionsRowActionTooltipTitle_js'|translate|escape:'html'}</a> + <a id="Overlay_FullScreen" href="#"> {'Overlay_OpenFullScreen'|translate|escape:'html'} </a> diff --git a/plugins/Overlay/templates/rowaction.js b/plugins/Overlay/templates/rowaction.js index 24ccb803503ddadc07d1ef71cdf625fd8c71b828..9adc0fbb2db74609175dace90f0197fc0a735871 100644 --- a/plugins/Overlay/templates/rowaction.js +++ b/plugins/Overlay/templates/rowaction.js @@ -24,8 +24,7 @@ DataTable_RowActions_Overlay.prototype.onClick = function(actionA, tr, e) { actionA.attr({ target: '_blank', - href: Overlay_Helper.getOverlayLink(this.dataTable.param.idSite, this.dataTable.param.period, - this.dataTable.param.date, link) + href: Overlay_Helper.getOverlayLink(this.dataTable.param.idSite, 'month', 'today', link) }); } diff --git a/plugins/Overlay/templates/sidebar.tpl b/plugins/Overlay/templates/sidebar.tpl index 9f3f4ca7e0d2eb716bfafa63f9524703edc627c7..2421fe979191cf8170729bd55c861cc2aff7109e 100644 --- a/plugins/Overlay/templates/sidebar.tpl +++ b/plugins/Overlay/templates/sidebar.tpl @@ -3,7 +3,9 @@ <!-- This div is removed by JS and the content is put in the location div --> <div class="Overlay_Location"> <b>{'Overlay_Location'|translate|escape:'html'}:</b> - <span>{$location|escape:'html'}</span> + <span data-normalized-url="{$normalizedUrl|escape:'html'}" data-label="{$label|escape:'html'}"> + {$location|escape:'html'} + </span> </div> {if count($data)} @@ -14,6 +16,7 @@ </div> {/foreach} {else} + <!-- note: the class Overlay_NoData is used in index.js --> <div class="Overlay_NoData">{'Overlay_NoData'|translate|escape:'html'}</div> {/if} diff --git a/plugins/Transitions/templates/transitions.js b/plugins/Transitions/templates/transitions.js index 6ceb292f69d48dd94cac4dea9ec12344a22c2559..2dec90d31e11c3c87acc947cf8a8f5fc1d6e5bd1 100644 --- a/plugins/Transitions/templates/transitions.js +++ b/plugins/Transitions/templates/transitions.js @@ -620,7 +620,12 @@ Piwik_Transitions.prototype.renderClosedGroup = function(groupName, side, onlyBg /** Reload the entire popover for a different URL */ Piwik_Transitions.prototype.reloadPopover = function(url) { - this.rowAction.openPopover(this.actionType + ':' + url); + if (this.rowAction) { + this.rowAction.openPopover(this.actionType + ':' + url); + } else { + this.reset(this.actionType, url); + this.showPopover(); + } }; /** Redraw the left or right sides with a different group opened */