+2010-12-15 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ size status bubble to it's contents on the code review page
+ https://bugs.webkit.org/show_bug.cgi?id=51142
+
+ * PrettyPatch/PrettyPatch.rb:
+ * code-review.js:
+
2010-12-15 Ojan Vafai <ojan@chromium.org>
Reviewed by Adam Barth.
}
.statusBubble {
- margin-top: 2px;
- /* FIXME: Size the statusBubble via postMessage so it sizes to it's content. */
- width: 300px;
- height: 20px;
+ margin: 2px 2px 0 0;
border: none;
vertical-align: middle;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
-<script src="code-review.js?version=15"></script>
+<script src="code-review.js?version=16"></script>
EOF
def self.revisionOrDescription(string)
});
}
+ window.addEventListener('message', function(e) {
+ if (e.origin != 'https://webkit-commit-queue.appspot.com')
+ return;
+
+ $('.statusBubble')[0].style.height = e.data.height;
+ $('.statusBubble')[0].style.width = e.data.width;
+ });
+
+ function handleStatusBubbleLoad(e) {
+ e.target.contentWindow.postMessage('containerMetrics', 'https://webkit-commit-queue.appspot.com');
+ }
+
function fetchHistory() {
$.get('attachment.cgi?id=' + attachment_id + '&action=edit', function(data) {
var bug_id = /Attachment \d+ Details for Bug (\d+)/.exec(data)[1];
var details = $(data);
addFlagsForAttachment(details);
- $('#statusBubbleContainer').append($('<iframe style="margin-top:2px;" class="statusBubble" src="https://webkit-commit-queue.appspot.com/status-bubble/' + attachment_id + '" scrolling="no"></iframe>'));
+
+ var statusBubble = document.createElement('iframe');
+ statusBubble.className = 'statusBubble';
+ statusBubble.src = 'https://webkit-commit-queue.appspot.com/status-bubble/' + attachment_id;
+ statusBubble.scrolling = 'no';
+ // Can't append the HTML because we need to set the onload handler before appending the iframe to the DOM.
+ statusBubble.onload = handleStatusBubbleLoad;
+ $('#statusBubbleContainer').append(statusBubble);
+
$('#toolbar .bugLink').html('<a href="/show_bug.cgi?id=' + bug_id + '" target="_blank">Bug ' + bug_id + '</a>');
});
}