Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[webdoc] Add a "open in native browser" button

  • Loading branch information...
commit ca3b6ece191bffb09555ea6826735e08f22de28d 1 parent 09c0957
Jérémie Laval garuma authored

Showing 2 changed files with 33 additions and 0 deletions. Show diff stats Hide diff stats

  1. +21 0 webdoc/common.css
  2. +12 0 webdoc/index.aspx
21 webdoc/common.css
@@ -182,3 +182,24 @@ div.related ul {
182 182 padding-left: 1em;
183 183 }
184 184
  185 +.native-browser {
  186 + display: inline-block;
  187 + color: #333 !important;
  188 + text-decoration:none !important;
  189 + font-size: 88%;
  190 + padding: 4px 10px 4px 10px;
  191 + border: 1px solid silver;
  192 + border-bottom-color: #bcbcbc;
  193 + border-radius: 3px;
  194 + background: #f2f2f2;
  195 +}
  196 +
  197 +.native-browser:hover {
  198 + background: #ddd;
  199 + color: black;
  200 +}
  201 +
  202 +.native-browser img {
  203 + vertical-align: center;
  204 + margin-right: 3px;
  205 +}
12 webdoc/index.aspx
@@ -106,7 +106,19 @@ update_tree = function () {
106 106 }
107 107 };
108 108 update_tree ();
  109 +add_native_browser_link = function () {
  110 + var contentDiv = $('#content_frame').contents ().find ('div[class=Content]').first ();
  111 + if (contentDiv.length > 0) {
  112 + var id = contentDiv.attr ('id').replace (':Summary', '');
  113 + var h2 = contentDiv.children ('h2').first ();
  114 + if (h2.prev ().attr ('class') != 'native-browser')
  115 + h2.before ('<a class="native-browser" href="mdoc://' + encodeURIComponent (id) + '"><span class="native-icon"><img src="images/native-browser-icon.png" /></span>Open in Native Browser</a>');
  116 + }
  117 +};
  118 +add_native_browser_link ();
  119 +
109 120 content_frame.load (update_tree);
  121 +content_frame.load (add_native_browser_link);
110 122 </script>
111 123 <% = Global.IncludeExternalHeader (Global.ExternalResourceType.Javascript) %>
112 124 <% = Global.IncludeExternalFooter (Global.ExternalResourceType.Javascript) %>

0 comments on commit ca3b6ec

Please sign in to comment.
Something went wrong with that request. Please try again.