text: /*
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
  This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
  The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
  Code distributed by Google as part of the polymer project is also
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
  */
  
  (function (document) {
      'use strict';
  
      // Grab a reference to our auto-binding template
      // and give it some initial binding values
      // Learn more about auto-binding templates at http://goo.gl/Dx1u2g
      var app = document.querySelector('#app');
  
      app.serviceurl = 'http://localhost:8080/swevarepository/';
      app.displayInstalledToast = function () {
          // Check to make sure caching is actually enabled—it won't be in the dev environment.
          if (!document.querySelector('platinum-sw-cache').disabled) {
              document.querySelector('#caching-complete').show();
          }
      };
  
      // Listen for template bound event to know when bindings
      // have resolved and content has been stamped to the page
      app.addEventListener('dom-change', function () {
          console.log('Our app is ready to rock!');
      });
  
      // See https://github.com/Polymer/polymer/issues/1381
      window.addEventListener('WebComponentsReady', function () {
          // imports are loaded and elements have been registered
      });
  
      // Main area's paper-scroll-header-panel custom condensing transformation of
      // the appName in the middle-container and the bottom title in the bottom-container.
      // The appName is moved to top and shrunk on condensing. The bottom sub title
      // is shrunk to nothing on condensing.
      /*addEventListener('paper-header-transform', function(e) {
        var appName = document.querySelector('#mainToolbar .app-name');
        var middleContainer = document.querySelector('#mainToolbar .middle-container');
        var bottomContainer = document.querySelector('#mainToolbar .bottom-container');
        var detail = e.detail;
        var heightDiff = detail.height - detail.condensedHeight;
        var yRatio = Math.min(1, detail.y / heightDiff);
        var maxMiddleScale = 0.50;  // appName max size when condensed. The smaller the number the smaller the condensed size.
        var scaleMiddle = Math.max(maxMiddleScale, (heightDiff - detail.y) / (heightDiff / (1-maxMiddleScale))  + maxMiddleScale);
        var scaleBottom = 1 - yRatio;
  
        // Move/translate middleContainer
        Polymer.Base.transform('translate3d(0,' + yRatio * 100 + '%,0)', middleContainer);
  
        // Scale bottomContainer and bottom sub title to nothing and back
        Polymer.Base.transform('scale(' + scaleBottom + ') translateZ(0)', bottomContainer);
  
        // Scale middleContainer appName
        Polymer.Base.transform('scale(' + scaleMiddle + ') translateZ(0)', appName);
      });*/
  
      // Close drawer after menu item is selected if drawerPanel is narrow
      app.onDataRouteClick = function () {
          var drawerPanel = document.querySelector('#paperDrawerPanel');
          if (drawerPanel.narrow) {
              drawerPanel.closeDrawer();
          }
      };
  
      // Scroll page to top and expand header
      app.scrollPageToTop = function () {
          document.getElementById('mainContainer').scrollTop = 0;
      };
      app.search = '';
      app._handleSearch = function (e) {
  
          app.search = e.detail.search;
      },
      app.params = {};
      app.params.category = 'none';
      app.params.name = 'none';
  
  
  
      app.buildCategoryUrl = function (cat) {
          return 'catalog/' + cat;
      }
  
      app.buildCategoryTitle = function (cats, name) {
          if (name) {
              for (var i = 0; i < cats.length; i++) {
                  if (cats[i].name == name) {
                      return cats[i].title;
                  }
              }
          }
          return 'SWeVA Catalog';
      }
  
      app.categories = [
  
         {
             title: 'Visualization Tools',
             name: 'tools'
         },
         {
             title: 'Web Components',
             name: 'components'
         },
         {
             title: 'Presets',
             name: 'presets'
         },
         {
             title: 'Modules',
             name: 'modules'
         },
         {
             title: 'Module Compositions',
             name: 'compositions'
         },
         {
             title: 'Data Converters',
             name: 'converters'
         },
         {
             title: 'Data Containers',
             name: 'containers'
         },
  
      ];
  })(document);