<script>
- var sonarRecentHistory = new Sonar.RecentHistory('<%= ApplicationController.root_context -%>')
- .addTranslation('clear', '<%= message('layout.recent_history.clear') -%>')
- .addTranslation('no_history_yet', '<%= message('layout.recent_history.no_history_yet') -%>');
-
- sonarRecentHistory.add('<%= @resource ? @resource.key : "" -%>',
- '<%= @resource ? @resource.name : "" -%>',
- '<%= @resource ? @resource.qualifier : "" -%>');
+ if (supports_html5_storage()) {
+ var sonarRecentHistory = new Sonar.RecentHistory('<%= ApplicationController.root_context -%>')
+ .addTranslation('clear', '<%= message('layout.recent_history.clear') -%>')
+ .addTranslation('no_history_yet', '<%= message('layout.recent_history.no_history_yet') -%>');
+ }
</script>
-<div class="dropdown">
+<div class="dropdown" id="sonar_recent_history_div">
<a href="#" class="link-more" onclick="sonarRecentHistory.populateRecentHistoryDropDown(); $('sonar_recent_history_dropdown').toggle();return false;"><%= message('layout.recent_history.link') -%></a>
<ul style="display: none" class="dropdown-menu" id="sonar_recent_history_dropdown" onmouseout="this.hide();" onmouseover="this.show();">
</ul>
-
-</div>
\ No newline at end of file
+</div>
+
+<script>
+ if (sonarRecentHistory == null) {
+ $j('#sonar_recent_history_div').detach();
+ } else {
+ sonarRecentHistory.add('<%= @resource ? @resource.key : "" -%>',
+ '<%= @resource ? @resource.name(true) : "" -%>',
+ '<%= @resource ? @resource.qualifier : "" -%>');
+ }
+</script>
\ No newline at end of file
<script>
- sonarRecentHistory.add('<%= @resource.key -%>',
- '<%= @resource.name -%>',
- '<%= @resource.qualifier -%>');
+ if (sonarRecentHistory != null) {
+ sonarRecentHistory.add('<%= @resource.key -%>',
+ '<%= @resource.name(true) -%>',
+ '<%= @resource.qualifier -%>');
+ }
</script>
<%= render :partial => 'tabs' -%>