Sha256: c0fa4d752f95bf09a82d046464b3bbbbef0a9fc237108f590a3fa0114ef8a51a

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

<!--
    @license
    Copyright (c) 2014 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
-->
<script src="context-free-parser.js"></script>
<link rel="import" href="../core-ajax/core-ajax.html">

<!--
Scrapes source documentation data from input text or url.

@class context-free-parser
-->
<polymer-element name="context-free-parser" attributes="url text data">
<template>

  <core-ajax url="{{url}}" response="{{text}}" auto></core-ajax>

</template>
<script>

  Polymer('context-free-parser', {

    text: null,

    textChanged: function() {
      if (this.text) {
        var entities = ContextFreeParser.parse(this.text);
        if (!entities || entities.length === 0) {
          entities = [
            {name: this.url.split('/').pop(), description: '**Undocumented**'}
          ];
        }
        this.data = { classes: entities };
      }
    },

    dataChanged: function() {
      this.fire('data-ready');
    }

  });

</script>
</polymer-element>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polymer-core-rails-0.2.6 app/assets/components/context-free-parser/context-free-parser.html
polymer-core-rails-0.2.5 app/assets/components/context-free-parser/context-free-parser.html
polymer-core-rails-0.2.0 app/assets/components/context-free-parser/context-free-parser.html