Permalink
Browse files

Adding previews to intents debugger

  • Loading branch information...
1 parent b75a0a8 commit 46ae3e7b6092b90e8241bc1e2e9ce24ea8fefbd9 Paul Kinlan committed Aug 23, 2012
Showing with 31 additions and 1 deletion.
  1. +12 −0 tools/chrome/extensions/debugger/intent.js
  2. +19 −1 tools/chrome/extensions/debugger/panel.html
@@ -14,9 +14,21 @@ window.addEventListener("load", function() {
var action = document.getElementById("action");
var type = document.getElementById("type");
var data = document.getElementById("data");
+ var majorType = data.className = result.type.substr(0, result.type.indexOf("/"));
+ var typeEl = document.getElementById("majorType");
action.textContent = result.action;
type.textContent = result.type;
data.textContent = result.data;
+
+ if(majorType == "image") {
+ majorType.src = data;
+ }
+ else if (majorType == "video") {
+ majorType.src = data;
+ }
+ else if(majorType == "audio") {
+ majorType.src = data;
+ }
}
}
);
@@ -52,6 +52,16 @@
background-color: #eee;
}
+ #image, #audio, #video {
+ display: none;
+ width: 256px;
+ }
+
+
+ #data.image, #data.audio, #data.video {
+ display: block;
+ }
+
body { margin: 0; padding: 0 }
</style>
</head>
@@ -69,7 +79,15 @@
<tbody>
<tr><td class="key">Action</td><td id="action"></td></tr>
<tr><td class="key">Type</td><td id="type"></td></tr>
- <tr><td class="key">Data</td><td id="data"></td></tr>
+ <tr>
+ <td class="key">Data</td>
+ <td id="data">
+ <span id="txt"></span>
+ <img id="image"/>
+ <video id="video"></video>
+ <audio id="audio"></audio>
+ </td>
+ </tr>
<tbody>
</table>
</body>

0 comments on commit 46ae3e7

Please sign in to comment.