diff options
author | BeezyT <timo@ezdesign.de> | 2012-11-12 18:37:08 +0400 |
---|---|---|
committer | BeezyT <timo@ezdesign.de> | 2012-11-12 18:37:08 +0400 |
commit | c132a94d6a429bd8c813c7e6c2d1ab50a7cbae8b (patch) | |
tree | d5de98b0a63d18335e4eccdc5b1f9f4c6cebfed6 /plugins/Overlay/templates | |
parent | f326007a58ac97da414f7e0f6995ca8bf0f929ff (diff) |
refs #2465
* when Piwik is used over SSL, load the website in the frame over SSL too
* when nothing comes back from the iframe, show an error message after a timeout (8 seconds)
* improved handling of overlayUrl a bit (though this should be obsolete soon when we only have full screen mode)
git-svn-id: http://dev.piwik.org/svn/trunk@7453 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Overlay/templates')
-rw-r--r-- | plugins/Overlay/templates/index.css | 13 | ||||
-rw-r--r-- | plugins/Overlay/templates/index.js | 16 | ||||
-rw-r--r-- | plugins/Overlay/templates/index.tpl | 16 |
3 files changed, 44 insertions, 1 deletions
diff --git a/plugins/Overlay/templates/index.css b/plugins/Overlay/templates/index.css index 1e477e6b99..2135e39015 100644 --- a/plugins/Overlay/templates/index.css +++ b/plugins/Overlay/templates/index.css @@ -141,4 +141,17 @@ body .piwik-tooltip.Overlay_Tooltip { #Overlay_NoFrame { padding: 20px 0 40px 2px +} + +#Overlay_Error_NotLoading { + float: left; + width: 190px; + position: relative; + clear: left; + display: none; +} + +#Overlay_Error_NotLoading span { + color: #E87500; + font-weight: bold; }
\ No newline at end of file diff --git a/plugins/Overlay/templates/index.js b/plugins/Overlay/templates/index.js index a9a6f0ba8d..60e3bd8441 100644 --- a/plugins/Overlay/templates/index.js +++ b/plugins/Overlay/templates/index.js @@ -1,11 +1,13 @@ var Piwik_Overlay = (function() { - var $container, $iframe, $sidebar, $main, $location, $loading; + var $container, $iframe, $sidebar, $main, $location, $loading, $errorNotLoading; var isFullScreen = false; var iframeDomain = ''; + var errorTimeout; + /** Load the sidebar for a url */ function loadSidebar(currentUrl) { $sidebar.hide(); @@ -85,9 +87,12 @@ var Piwik_Overlay = (function() { $location = $('#Overlay_Location'); $main = $('#Overlay_Main'); $loading = $('#Overlay_Loading'); + $errorNotLoading = $('#Overlay_Error_NotLoading'); adjustHeight(); + $loading.show(); + window.setTimeout(function() { // sometimes the frame is too high at first adjustHeight(); @@ -97,10 +102,19 @@ var Piwik_Overlay = (function() { $(window).resize(function() { adjustHeight(); }); + + errorTimeout = window.setTimeout(function() { + $loading.hide(); + $errorNotLoading.show(); + }, 8000); }, /** This callback is used from within the iframe */ setCurrentUrl: function(currentUrl) { + window.clearTimeout(errorTimeout); + $loading.show(); + $errorNotLoading.hide(); + // put the current iframe url in the main url to enable refresh and deep linking. // to prevent browsers from braking the encoding, we replace the % with a $. var urlValue = encodeURIComponent(currentUrl).replace(/%/g, '$'); diff --git a/plugins/Overlay/templates/index.tpl b/plugins/Overlay/templates/index.tpl index b9b6222554..d011875161 100644 --- a/plugins/Overlay/templates/index.tpl +++ b/plugins/Overlay/templates/index.tpl @@ -5,6 +5,22 @@ <div id="Overlay_Sidebar"></div> + <div id="Overlay_Error_NotLoading"> + <p> + <span>{'Overlay_ErrorNotLoading'|translate|escape:'html'}</span> + </p> + <p> + {if $ssl} + {'Overlay_ErrorNotLoadingDetailsSSL'|translate|escape:'html'} + {else} + {'Overlay_ErrorNotLoadingDetails'|translate|escape:'html'} + {/if} + </p> + <p> + <a href="#">{'Overlay_ErrorNotLoadingLink'|translate|escape:'html'}</a> + </p> + </div> + <div id="Overlay_Loading">{'General_Loading_js'|translate|escape:'html'}</div> <div id="Overlay_Main"> |