aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/coffee/api-documentation/app.coffee
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-04-20 17:31:42 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-04-21 15:40:34 +0200
commite2d3ac164a708d812f54d577592d9745d78f696c (patch)
tree85d49d6ecdd4aa4e681565214e0d540c77d2be25 /server/sonar-web/src/main/coffee/api-documentation/app.coffee
parent9f71c4524a534a1e3307d8863b5874d10fc71a00 (diff)
downloadsonarqube-e2d3ac164a708d812f54d577592d9745d78f696c.tar.gz
sonarqube-e2d3ac164a708d812f54d577592d9745d78f696c.zip
refactor "Web Service API" page
Diffstat (limited to 'server/sonar-web/src/main/coffee/api-documentation/app.coffee')
-rw-r--r--server/sonar-web/src/main/coffee/api-documentation/app.coffee83
1 files changed, 0 insertions, 83 deletions
diff --git a/server/sonar-web/src/main/coffee/api-documentation/app.coffee b/server/sonar-web/src/main/coffee/api-documentation/app.coffee
deleted file mode 100644
index ec6713598e1..00000000000
--- a/server/sonar-web/src/main/coffee/api-documentation/app.coffee
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2014 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-requirejs.config
- baseUrl: "#{baseUrl}/js"
-
-requirejs [
- 'api-documentation/collections/web-services',
- 'api-documentation/views/api-documentation-list-view',
- 'api-documentation/router',
- 'api-documentation/layout'
-], (
- WebServices,
- ApiDocumentationListView,
- ApiDocumentationRouter,
- ApiDocumentationLayout
-) ->
-
- # Create a Quality Gate Application
- App = new Marionette.Application
-
- App.webServices = new WebServices
-
- App.openFirstWebService = ->
- if @webServices.length > 0
- @router.navigate "#{@webServices.models[0].get('path')}", trigger: true
- else
- App.layout.detailsRegion.reset()
-
- App.refresh = ->
- App.apiDocumentationListView = new ApiDocumentationListView
- collection: App.webServices
- app: App
- App.layout.resultsRegion.show App.apiDocumentationListView
- if (Backbone.history.fragment)
- App.router.show Backbone.history.fragment, trigger: true
-
- # Construct layout
- App.addInitializer ->
- @layout = new ApiDocumentationLayout app: App
- jQuery('#api-documentation').append @layout.render().el
- jQuery('#footer').addClass 'search-navigator-footer'
-
- # Construct sidebar
- App.addInitializer ->
- App.refresh()
-
- # Start router
- App.addInitializer ->
- @router = new ApiDocumentationRouter app: @
- Backbone.history.start()
-
- # Open first Web Service when page is opened
- App.addInitializer ->
- initial = Backbone.history.fragment == ''
- App.openFirstWebService() if initial
-
- webServicesXHR = App.webServices.fetch()
-
- jQuery.when(webServicesXHR)
- .done ->
- # Remove the initial spinner
- jQuery('#api-documentation-page-loader').remove()
-
- # Start the application
- App.start()