OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 The common.js file must be included before this file. |
| 3 |
| 4 This in an HTML Import-able file that contains the definition |
| 5 of the following elements: |
| 6 |
| 7 <fuzzer-collapse-file-sk> |
| 8 |
| 9 This element will poll /json/list |
| 10 |
| 11 To use this file import it: |
| 12 |
| 13 <link href="/res/imp/fuzzer-collapse-file-sk.html" rel="import" /> |
| 14 |
| 15 Usage: |
| 16 |
| 17 <fuzzer-collapse-file-sk></fuzzer-collapse-file-sk> |
| 18 |
| 19 Properties: |
| 20 file - The FileDetails object. Expected to have the following attributes: |
| 21 fileName: String, |
| 22 apiCount: Number, |
| 23 binaryCount: Number, |
| 24 byFunction: Array of FunctionDetail objects. See fuzzer-collapse-function
-sk.html for schema. |
| 25 |
| 26 expand: String, which should be "true" if the element and any children shoul
d start expanded. |
| 27 Methods: |
| 28 setFile(file) - Programmatically set the FileDetails object. |
| 29 toggleLineNumbers() - Programmtically expand/collapse the function details. |
| 30 |
| 31 Events: |
| 32 None. |
| 33 --> |
| 34 <link rel="import" href="/res/imp/bower_components/iron-collapse/iron-collapse.h
tml"> |
| 35 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html"> |
| 36 <link rel="import" href="fuzzer-collapse-function-sk.html" /> |
| 37 <dom-module id="fuzzer-collapse-file-sk"> |
| 38 <template> |
| 39 <style> |
| 40 #wrapper { |
| 41 padding: 20px; |
| 42 margin: 10px; |
| 43 border-radius: 10px; |
| 44 background-color: #F5F5F5; |
| 45 color: #000000; |
| 46 } |
| 47 |
| 48 div.message { |
| 49 overflow-wrap: word-break; |
| 50 overflow: hidden; |
| 51 text-overflow: ellipsis; |
| 52 } |
| 53 |
| 54 h3 { |
| 55 margin-top: 0px; |
| 56 } |
| 57 |
| 58 #indicator { |
| 59 cursor: pointer; |
| 60 margin: 1px 6px 1px 1px; |
| 61 } |
| 62 |
| 63 #indicator.toggled { |
| 64 transform: rotate(.25turn); |
| 65 } |
| 66 </style> |
| 67 <div id="wrapper"> |
| 68 <div class="message"> |
| 69 <h3> |
| 70 <iron-icon role="button" id="indicator" icon="icons:send" on-click="to
ggleFunctions" title="Click to toggle function view"></iron-icon> |
| 71 {{file.fileName}} -- {{totalCount}} outstanding fuzzes: {{file.binaryC
ount}} binary and {{file.apiCount}} api |
| 72 </h3> |
| 73 </div> |
| 74 <iron-collapse id="functions"> |
| 75 <template is="dom-repeat" items="{{file.byFunction}}" as="function"> |
| 76 <fuzzer-collapse-function-sk func="{{function}}" expand="{{expand}}"><
/fuzzer-collapse-function-sk> |
| 77 </template> |
| 78 </iron-collapse> |
| 79 </div> |
| 80 </template> |
| 81 <script> |
| 82 Polymer({ |
| 83 is: 'fuzzer-collapse-file-sk', |
| 84 |
| 85 properties: { |
| 86 file: { //expected to be provided |
| 87 type: Object, |
| 88 value: function() { |
| 89 return {}; |
| 90 } |
| 91 }, |
| 92 totalCount: { |
| 93 type: Number, |
| 94 computed: "_getTotalCount(file)" |
| 95 }, |
| 96 expand: { |
| 97 type: String, |
| 98 value: "" |
| 99 }, |
| 100 }, |
| 101 |
| 102 ready: function() { |
| 103 if (this.expand) { |
| 104 this.$.functions.show(); |
| 105 this.$.indicator.toggleClass("toggled"); |
| 106 } |
| 107 }, |
| 108 |
| 109 setFile: function(file) { |
| 110 this.file = file; |
| 111 }, |
| 112 |
| 113 _getTotalCount: function(file) { |
| 114 return file.binaryCount + file.apiCount; |
| 115 }, |
| 116 |
| 117 toggleFunctions: function() { |
| 118 this.$.functions.toggle(); |
| 119 this.$.indicator.toggleClass("toggled"); |
| 120 } |
| 121 }); |
| 122 </script> |
| 123 </dom-module> |
OLD | NEW |