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-function-sk> |
| 8 |
| 9 To use this file import it: |
| 10 |
| 11 <link href="/res/imp/fuzzer-collapse-function-sk.html" rel="import" /> |
| 12 |
| 13 Usage: |
| 14 |
| 15 <fuzzer-collapse-function-sk></fuzzer-collapse-function-sk> |
| 16 |
| 17 Properties: |
| 18 func - The FunctionDetails object. Expected to have the following attribute
s: |
| 19 functionName: String, |
| 20 apiCount: Number, |
| 21 binaryCount: Number, |
| 22 byLineNumber: Array of Detail objects. See fuzzer-collapse-details-sk.htm
l for schema. |
| 23 |
| 24 expand: String, which should be "true" if the gui should start expanded |
| 25 |
| 26 Methods: |
| 27 setFunc(func) - Programmatically set the FunctionDetails object. |
| 28 toggleLineNumbers() - Programmtically expand/collapse the line number detail
s. |
| 29 |
| 30 Events: |
| 31 None. |
| 32 --> |
| 33 <link rel="import" href="/res/imp/bower_components/iron-collapse/iron-collapse.h
tml"> |
| 34 <link rel="import" href="fuzzer-collapse-details-sk.html"> |
| 35 <dom-module id="fuzzer-collapse-function-sk"> |
| 36 <template> |
| 37 <style> |
| 38 #wrapper { |
| 39 padding: 20px; |
| 40 border-radius: 10px; |
| 41 background-color: #E5E5E5; |
| 42 color: #000000; |
| 43 } |
| 44 |
| 45 #wrapper div { |
| 46 margin-top: 0px; |
| 47 } |
| 48 |
| 49 #indicator { |
| 50 cursor: pointer; |
| 51 margin: 1px 6px 1px 1px; |
| 52 /*Make the indicator icon a bit smaller than normal*/ |
| 53 --iron-icon-height: 20px; |
| 54 --iron-icon-width: 20px; |
| 55 } |
| 56 |
| 57 #indicator.toggled { |
| 58 transform: rotate(.25turn); |
| 59 } |
| 60 |
| 61 ul { |
| 62 list-style-type: none; |
| 63 } |
| 64 </style> |
| 65 <div id="wrapper"> |
| 66 <div> |
| 67 <iron-icon role="button" id="indicator" icon="icons:send" on-click="togg
leLineNumbers" title="Click to toggle line number view"></iron-icon> |
| 68 <span> |
| 69 Function {{func.functionName}} -- {{totalCount}} outstanding fuzze
s: |
| 70 {{func.binaryCount}} binary and {{func.apiCount}} api |
| 71 </span> |
| 72 </div> |
| 73 <iron-collapse id="lineNumbers"> |
| 74 <ul> |
| 75 <template is="dom-repeat" items="{{func.byLineNumber}}" as="lineNumber
"> |
| 76 <fuzzer-collapse-details-sk details="{{lineNumber}}"></fuzzer-collap
se-details-sk> |
| 77 </template> |
| 78 </ul> |
| 79 </iron-collapse> |
| 80 </div> |
| 81 </template> |
| 82 <script> |
| 83 Polymer({ |
| 84 is: 'fuzzer-collapse-function-sk', |
| 85 |
| 86 properties: { |
| 87 func: { //expected to be provided |
| 88 type: Object, |
| 89 value: function() { |
| 90 return {}; |
| 91 } |
| 92 }, |
| 93 totalCount: { |
| 94 type: Number, |
| 95 computed: "_getTotalCount(func)", |
| 96 }, |
| 97 expand: { |
| 98 type: String, |
| 99 value: "" |
| 100 }, |
| 101 }, |
| 102 |
| 103 ready: function() { |
| 104 if (this.expand) { |
| 105 this.$.lineNumbers.show(); |
| 106 this.$.indicator.toggleClass("toggled"); |
| 107 } |
| 108 }, |
| 109 |
| 110 setFunc: function(func){ |
| 111 this.func = func; |
| 112 }, |
| 113 |
| 114 _getTotalCount: function(func) { |
| 115 return func.binaryCount + func.apiCount; |
| 116 }, |
| 117 |
| 118 toggleLineNumbers: function() { |
| 119 this.$.lineNumbers.toggle(); |
| 120 this.$.indicator.toggleClass("toggled"); |
| 121 } |
| 122 }); |
| 123 </script> |
| 124 </dom-module> |
OLD | NEW |