Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
| 3 | ~ Copyright 2015 Open Networking Laboratory |
| 4 | ~ |
| 5 | ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ~ you may not use this file except in compliance with the License. |
| 7 | ~ You may obtain a copy of the License at |
| 8 | ~ |
| 9 | ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ~ |
| 11 | ~ Unless required by applicable law or agreed to in writing, software |
| 12 | ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ~ See the License for the specific language governing permissions and |
| 15 | ~ limitations under the License. |
| 16 | --> |
| 17 | |
| 18 | <!-- |
| 19 | ONOS -- Embedded icon test page |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 20 | --> |
| 21 | <html> |
| 22 | <head> |
| 23 | <meta charset="utf-8"> |
| 24 | <title>Embedded Icons</title> |
| 25 | |
| 26 | <script src="../tp/d3.js"></script> |
| 27 | |
| 28 | <link rel="stylesheet" href="../app/common.css"> |
| 29 | |
| 30 | <style> |
| 31 | html, |
| 32 | body { |
| 33 | background-color: #fff; |
| 34 | font-family: Arial, Helvetica, sans-serif; |
| 35 | font-size: 9pt; |
| 36 | } |
| 37 | |
| 38 | svg .icon .glyph { |
| 39 | stroke: none; |
| 40 | fill: white; |
| 41 | fill-rule: evenodd; |
| 42 | } |
| 43 | |
Bri Prebilic Cole | ab582b8 | 2015-04-14 15:08:22 -0700 | [diff] [blame] | 44 | svg .icon.active { |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 45 | fill: green; |
| 46 | } |
| 47 | |
Bri Prebilic Cole | ab582b8 | 2015-04-14 15:08:22 -0700 | [diff] [blame] | 48 | svg .icon.inactive { |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 49 | fill: darkred; |
| 50 | } |
| 51 | |
| 52 | svg .icon rect { |
| 53 | stroke: black; |
| 54 | stroke-width: 1px; |
| 55 | } |
| 56 | |
| 57 | </style> |
| 58 | </head> |
| 59 | <body class="light"> |
| 60 | <!-- minimal framework to access glyphs library module --> |
| 61 | <script> |
| 62 | var libs = {}; |
| 63 | var ONOS = { ui: { addLib: function (id, things) { libs[id] = things; }}}; |
| 64 | |
| 65 | |
| 66 | </script> |
| 67 | |
| 68 | <!-- Test HTML --> |
| 69 | |
| 70 | <div> |
| 71 | <table class="summary-list"> |
Simon Hunt | 7f172cc | 2015-01-16 17:43:00 -0800 | [diff] [blame] | 72 | <tr> <th></th> <th>Two</th> <th>Three</th> </tr> |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 73 | <tr> |
| 74 | <td> |
Bri Prebilic Cole | ab582b8 | 2015-04-14 15:08:22 -0700 | [diff] [blame] | 75 | <div icon icon-id="active"> |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 76 | |
| 77 | <!-- icon directive needs to inject the following structure --> |
| 78 | <!-- ------------------------------------------------ --> |
| 79 | <svg width="20" height="20" viewBox="0 0 50 50"> |
Bri Prebilic Cole | ab582b8 | 2015-04-14 15:08:22 -0700 | [diff] [blame] | 80 | <g class="icon active"> |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 81 | <rect width="50" height="50" rx="4"></rect> |
| 82 | <use class="glyph" xlink:href="#ui" width="50" height="50"></use> |
| 83 | </g> |
| 84 | </svg> |
| 85 | <!-- ------------------------------------------------ --> |
| 86 | |
| 87 | </div> |
| 88 | </td> |
| 89 | <td>Some text</td> |
| 90 | <td>Some text</td> |
| 91 | </tr> |
| 92 | <tr> |
| 93 | <td> |
Bri Prebilic Cole | ab582b8 | 2015-04-14 15:08:22 -0700 | [diff] [blame] | 94 | <div icon icon-id="inactive"> |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 95 | |
| 96 | <!-- icon directive needs to inject the following structure --> |
| 97 | <!-- ------------------------------------------------ --> |
| 98 | <svg width="20" height="20" viewBox="0 0 50 50"> |
Bri Prebilic Cole | ab582b8 | 2015-04-14 15:08:22 -0700 | [diff] [blame] | 99 | <g class="icon inactive"> |
Simon Hunt | 58f23bb | 2015-01-16 16:32:24 -0800 | [diff] [blame] | 100 | <rect width="50" height="50" rx="4"></rect> |
| 101 | <use class="glyph" xlink:href="#ui" width="50" height="50"></use> |
| 102 | </g> |
| 103 | </svg> |
| 104 | <!-- ------------------------------------------------ --> |
| 105 | |
| 106 | |
| 107 | </div> |
| 108 | </td> |
| 109 | <td>Some text</td> |
| 110 | <td>Some Other text</td> |
| 111 | </tr> |
| 112 | </table> |
| 113 | </div> |
| 114 | |
| 115 | <!-- common definitions for other SVG elements to use --> |
| 116 | <svg width="0" height="0"> |
| 117 | <defs> |
| 118 | <symbol id="ui" viewBox="0 0 10 10"> |
| 119 | <path d="M2,2.5a.5,.5,0,0,1,.5-.5h5 |
| 120 | a.5,.5,0,0,1,.5,.5v3a.5,.5,0,0,1-.5,.5h-5a.5, |
| 121 | .5,0,0,1-.5-.5zM2.5,2.8a.3,.3,0,0,1,.3-.3 |
| 122 | h4.4a.3,.3,0,0,1,.3,.3v2.4a.3,.3,0,0,1-.3, |
| 123 | .3h-4.4a.3,.3,0,0,1-.3-.3zM2,6.55h6l1,1.45h-8z"> |
| 124 | </path> |
| 125 | </symbol> |
| 126 | </defs> |
| 127 | </svg> |
| 128 | |
| 129 | </body> |
| 130 | </html> |