Skip to content

Commit 3e04ce9

Browse files
author
=
committed
Added a bookmarklet
1 parent d63e1da commit 3e04ce9

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

htmlpreview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var HTMLPreview = {
4040
}
4141
}
4242
}
43-
frame = [].slice.call(document.getElementsByTagName('iframe')).concat([].slice.call(document.getElementsByTagName('frame')));
43+
frame = [].concat.apply([].concat.apply([], document.getElementsByTagName("iframe")), document.getElementsByTagName("frame"));
4444
for(i = 0; i < frame.length; ++i) {
4545
if(frame[i].src) {
4646
src = frame[i].src; //Get absolute URL

htmlpreview.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
text-align: center;
2020
}
2121
strong {
22+
color: #333;
2223
background-color: #FAFFA6;
2324
padding: 0.1em;
2425
}
@@ -33,7 +34,8 @@
3334
<form id="previewform" action="">
3435
<h1>GitHub &amp; BitBucket HTML Preview</h1>
3536
<p>Enter the HTML file to preview: <input type="url" id="file" value="" placeholder="e.g. https://github.com/user/repo/blob/master/index.html" size="70"> <input type="submit" value="&raquo;"></p>
36-
<p>or prepend to the URL: <strong>http://htmlpreview.github.com/?</strong>https://github.com/twitter/bootstrap/blob/master/docs/index.html</p>
37+
<p>or prepend to the URL: <strong>http://htmlpreview.github.io/?</strong>https://github.com/twitter/bootstrap/blob/master/docs/index.html</p>
38+
<p>or use this bookmarklet while browsing GitHub or BitBucket: <a href="javascript:void('http://htmlpreview.github.io/'==window.location?alert('Drag me to your bookmarks bar!'):window.location='http://htmlpreview.github.io/?'+window.location)"><strong>HTMLPreview</strong></a></p>
3739
<p id="footer">Developed by <a href="https://github.com/niutech">niu tech</a> | Contribute on <a href="https://github.com/htmlpreview/htmlpreview.github.com">GitHub</a></p>
3840
</form>
3941
<script src="/htmlpreview.min.js"></script>

0 commit comments

Comments
 (0)