]> source.dussan.org Git - vaadin-core.git/commitdiff
Add index page for apidocs contained within the elements 22/head pr22/r1
authorTeemu Pöntelin <teemu@vaadin.com>
Wed, 18 Nov 2015 12:30:14 +0000 (14:30 +0200)
committerTeemu Pöntelin <teemu@vaadin.com>
Wed, 18 Nov 2015 12:44:43 +0000 (14:44 +0200)
apidoc/index.html
bower.json
ga.js [deleted file]
tasks/cdn.js

index 522a6a1eec60996ad190f2da429c4f07cca072b3..1ff94a586c2a15daa3aef4988e0a905111d1b000 100644 (file)
 <html>
 <head lang="en">
   <meta charset="UTF-8">
-  <title></title>
-
-  <script src="../ga.js"></script>
-  <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
-  <script src="../../lodash/lodash.js"></script>
-  <link rel="import" href="../../polymer/polymer.html">
-  <link rel="import" href="../../hydrolysis/hydrolysis-analyzer.html">
-  <link rel="import" href="../../iron-doc-viewer/iron-doc-viewer.html">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <title>vaadin-elements</title>
+  <style>
+    body {
+      font-family: 'Roboto', 'Noto', sans-serif;
+      font-size: 16px;
+      background: #fafafa;
+      color: #212121;
+    }
+    section {
+      width: 50%;
+      margin: 50px auto;
+      background: #fff;
+      border: 1px solid #e5e5e5;
+    }
+    @media (max-width: 700px) {
+      section {
+        width: 100%;
+      }
+    }
+    h1 {
+      font-size: 150%;
+      font-weight: 400;
+    }
+    ul {
+      padding-left: 0;
+      list-style: none;
+      border-bottom: 1px solid #e5e5e5;
+    }
+    li {
+      line-height: 1.4;
+      border-top: 1px solid #e5e5e5;
+    }
+    li p {
+      margin: 0;
+    }
+    h1,
+    li {
+      padding: 14px 24px;
+    }
+  </style>
 </head>
-<body>
-  <div id="container" style="display:none">
-    <div id="viewer" style="width: 60%;left: 20%; position: absolute;">
-      <iron-doc-viewer></iron-doc-viewer>
-    </div>
-  </div>
-  <script>
-    window.addEventListener("WebComponentsReady", function() {
-      var hyd = require('hydrolysis');
-
-      function hidePrivateToggle() {
-        document.querySelector('#togglePrivate').setAttribute('style', 'display:none');
-      }
-
-      function hideCollapsedToggle() {
-        var collapsed = document.querySelector('#toggleCollapsed');
-        if(collapsed) {
-          collapsed.setAttribute('style', 'display:none');
-        }
-      }
-
-      function getElementTag() {
-        var elementTag = window.location.search.replace('?', '');
-        if(elementTag === '') {
-          elementTag = 'vaadin-grid';
-        }
-
-        return elementTag;
-      }
-
-      function getPropertyType(type) {
-        return type.textContent.replace('Array.<', '').replace('>', '');
-      }
-
-      function createLinkElement(type) {
-        var a = document.createElement('a');
-        a.textContent = type.textContent;
-        a.setAttribute('href', '?' + getPropertyType(type));
-
-        return a;
-      }
-
-      function addLinkElementsForDocumentedTypes(result) {
-        var types = document.querySelectorAll('.type');
-
-        for(var i=0;i < types.length; i++) {
-          var type = getPropertyType(types[i]);
-
-          if(result.elementsByTagName[type] || result.behaviorsByName[type]) {
-            var a = createLinkElement(types[i]);
 
-            types[i].textContent = '';
-            types[i].appendChild(a);
-          }
-        }
-
-        return result;
-      }
-
-      function hidePropertySetterMethods() {
-        var propertyNames = _.map(document.querySelector('#properties').querySelectorAll('.name'), function(p) {
-          return p.textContent;
-        });
-
-        var methods = document.querySelector('#methods').querySelectorAll('iron-doc-property');
-
-        _.forEach(methods, function(m) {
-          if(_.contains(propertyNames, m.querySelector('.name').textContent)) {
-            m.setAttribute('style', 'display:none');
-          }
-        });
-      }
-
-      function hideDefaultValuesForNonPrimitiveTypes(result) {
-        function isPrimitiveType(t) {
-          return /^([Nn]umber|[Bb]oolean|[Ss]tring).*/.test(t);
-        }
-
-        _.forEach(document.querySelector('#properties').querySelectorAll('iron-doc-property'), function(p) {
-          if(!isPrimitiveType(p.querySelector('#type').textContent)) {
-            p.querySelector('.annotation').setAttribute('style', 'display:none');
-          }
-        });
-
-        return result;
-      }
-
-      function showDocViewer() {
-        document.querySelector('#container').setAttribute('style', 'display:block');
-      }
-
-      //*** Main script starts here. ***//
-
-      hidePrivateToggle();
-      hideCollapsedToggle();
-
-      hyd.Analyzer.analyze('../../vaadin-grid/vaadin-grid-doc.html')
-          .then(function(result) {
-            var descriptor = result.elementsByTagName[getElementTag()] || result.behaviorsByName[getElementTag()];
-            document.querySelector('iron-doc-viewer').descriptor = descriptor;
-
-            return result;
-          })
-          .then(hideDefaultValuesForNonPrimitiveTypes)
-          .then(addLinkElementsForDocumentedTypes)
-          .then(hidePropertySetterMethods)
-          .then(showDocViewer);
-    });
-</script>
+<body>
+  <section>
+    <h1>API documentation for vaadin-elements</h1>
+    <ul>
+      <li>
+        <a id="vaadin-grid" href="../../vaadin-grid/index.html">vaadin-grid</a>
+        <p>Data grid for showing large amounts of tabular data.</p>
+      </li>
+    </ul>
+  </section>
 </body>
 </html>
index 86ba57176cd75694151c9cc9529b59d20ad3d4f8..338c4ad5efc4c80adde605ca5f66f79e1dab94cc 100644 (file)
     "**/tests"
   ],
   "dependencies": {
-    "vaadin-grid": "vaadin/vaadin-grid#0.9.0-beta5",
-    "elements-demo-resources": "vaadin/elements-demo-resources#master"
+    "vaadin-grid": "vaadin/vaadin-grid#0.9.0-beta5"
   },
   "devDependencies": {
-    "iron-doc-viewer": "polymerelements/iron-doc-viewer#~1.0.3",
-    "hydrolysis": "polymer/hydrolysis#~1.15.1",
-    "lodash": "~3.9.3"
+    "iron-component-page": "polymerelements/iron-component-page#~1.1.0",
+    "elements-demo-resources": "vaadin/elements-demo-resources#master"
   },
   "resolutions": {
     "polymer": "v1.1.1"
diff --git a/ga.js b/ga.js
deleted file mode 100644 (file)
index 51577de..0000000
--- a/ga.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Analytics for Vaadin Elements
-
-(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-ga('create', 'UA-658457-6', 'auto');
-
-function locationHashChanged() {
-  if(/vaadin/.test(window.location.hostname)) {
-    var pageViewUrl = (window.location.pathname + window.location.hash)
-      .replace(/vaadin-elements\/latest\/(.+)\/demo/, 'components-examples/$1')
-      .replace('#', '/');
-    ga('send', 'pageview', pageViewUrl)
-  }
-}
-
-window.onhashchange = locationHashChanged;
-locationHashChanged();
index 9ff994af82fbe7412eab4a813dde25ce5bf1a050..d6ea3c7ad579c7977f19f03a240431df66a91d48 100644 (file)
@@ -33,11 +33,11 @@ gulp.task('cdn:stage-bower_components', function() {
 });
 
 gulp.task('cdn:stage-vaadin-elements', function() {
-  return gulp.src(['LICENSE.html', 'README.md', 'ga.js', 'vaadin-elements.html', 'demo/*', 'apidoc/*'], {base:"."})
+  return gulp.src(['LICENSE.html', 'README.md', 'vaadin-elements.html', 'demo/*', 'apidoc/*'], {base:"."})
     .pipe(modify({
         fileModifier: function(file, contents) {
           if (/README.md/.test(file.path)) {
-            contents = contents.replace(/\/latest\//mg, '/' + version + '/')
+            contents = contents.replace(/\/latest\//mg, '/' + version + '/');
           } else {
             contents.replace('https://cdn.vaadin.com/vaadin-elements/latest/', '../../');
           }
@@ -133,5 +133,5 @@ gulp.task('verify:cdn', ['cdn-test:stage'], function(done) {
           done(err);
         });
 
-      }, done)});
+      }, done);});
 });