name: 'drilldown/app'
out: '<%= pkg.assets %>build/js/drilldown/app.js'
+ dashboardFile: options:
+ name: 'dashboard/file-app'
+ out: '<%= pkg.assets %>build/js/dashboard/file-app.js'
+
handlebars:
options:
--- /dev/null
+requirejs.config
+ baseUrl: "#{baseUrl}/js"
+
+ paths:
+ 'backbone': 'third-party/backbone'
+ 'backbone.marionette': 'third-party/backbone.marionette'
+ 'handlebars': 'third-party/handlebars'
+ 'jquery.mockjax': 'third-party/jquery.mockjax'
+
+ shim:
+ 'backbone.marionette':
+ deps: ['backbone']
+ exports: 'Marionette'
+ 'backbone':
+ exports: 'Backbone'
+ 'handlebars':
+ exports: 'Handlebars'
+
+
+requirejs [
+ 'backbone.marionette'
+ 'component-viewer/main'
+], (
+ Marionette
+ ComponentViewer
+) ->
+
+ $ = jQuery
+ App = new Marionette.Application()
+
+
+ App.addRegions
+ viewerRegion: '#accordion-panel'
+
+
+ App.requestComponentViewer = ->
+ unless App.componentViewer?
+ App.componentViewer = new ComponentViewer()
+ App.viewerRegion.show App.componentViewer
+ App.componentViewer
+
+
+
+ App.addInitializer ->
+ viewer = App.requestComponentViewer()
+ viewer.open(window.fileKey).done -> viewer.showAllLines()
+
+
+ # Message bundles
+ l10nXHR = window.requestMessages()
+
+
+ $.when(l10nXHR).done ->
+ # Start the application
+ App.start()
$.when(l10nXHR).done ->
- # Remove the initial spinner
- $('#coding-rules-page-loader').remove()
-
# Start the application
App.start()
+<% content_for :script do %>
+ <script data-main="<%= ApplicationController.root_context -%>/js/dashboard/file-app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+<% end %>
+
<%= render :partial => 'gwt/base', :locals => {:resource => nil, :popup => false, :metric => nil} -%>
<%= render :partial => 'gwt/resource_viewers' -%>
+<div class="marginbottom10"></div>
<div id="accordion-panel"></div>
<script type="text/javascript">
anchor = stripped_url[1];
}
- openAccordionItem('<%= url_for(params.merge({:controller => 'resource', :action => :index, :id => @file.id, :display_title => 'false', :popup => 'false'})) -%>', this, false)
- .done(function () {
- if (anchor != null) {
- window.location.hash = anchor;
- }
- });
+ window.fileKey = '<%= @file.key -%>';
// refresh page after issues bulk change
function onBulkIssues(){