2013-12-31 13:37:43 -06:00
|
|
|
<!DOCTYPE html>
|
2017-05-08 12:00:15 -05:00
|
|
|
<html<%= raw @embeddable_css_class -%>>
|
2013-12-31 13:37:43 -06:00
|
|
|
<head>
|
2015-09-18 15:12:41 -05:00
|
|
|
<meta charset="utf-8">
|
|
|
|
|
2017-04-13 14:22:39 -05:00
|
|
|
<%= discourse_stylesheet_link_tag 'embed', theme_key: nil %>
|
2015-08-06 16:18:00 -05:00
|
|
|
<%- unless customization_disabled? %>
|
2017-04-13 21:44:22 -05:00
|
|
|
<%= discourse_stylesheet_link_tag :embedded_theme %>
|
2015-08-06 16:18:00 -05:00
|
|
|
<%- end %>
|
2017-04-17 10:52:43 -05:00
|
|
|
<%= preload_script 'break_string' %>
|
2013-12-31 13:37:43 -06:00
|
|
|
|
2015-09-18 15:12:41 -05:00
|
|
|
<%- if @topic_view && @topic_view.page_title.present? %>
|
|
|
|
<title><%= @topic_view.page_title %> - <%= SiteSetting.title %></title>
|
|
|
|
<%- end %>
|
|
|
|
|
2013-12-31 13:37:43 -06:00
|
|
|
<script>
|
|
|
|
(function() {
|
2014-01-03 13:45:22 -06:00
|
|
|
|
|
|
|
function postUp(msg) {
|
2013-12-31 13:37:43 -06:00
|
|
|
if (parent) {
|
2014-01-03 13:45:22 -06:00
|
|
|
parent.postMessage(msg, '<%= request.referer %>');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function clickPostLink(e) {
|
|
|
|
var postId = e.target.getAttribute('data-link-to-post');
|
|
|
|
if (postId) {
|
|
|
|
var postElement = document.getElementById('post-' + postId);
|
|
|
|
if (postElement) {
|
|
|
|
var rect = postElement.getBoundingClientRect();
|
|
|
|
if (rect && rect.top) {
|
|
|
|
postUp({type: 'discourse-scroll', top: rect.top});
|
|
|
|
e.preventDefault();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2013-12-31 13:37:43 -06:00
|
|
|
}
|
|
|
|
}
|
2014-01-03 13:45:22 -06:00
|
|
|
|
|
|
|
window.onload = function() {
|
|
|
|
// Send a post message with our loaded height
|
|
|
|
postUp({type: 'discourse-resize', height: document['body'].offsetHeight});
|
|
|
|
|
2014-03-20 09:57:18 -05:00
|
|
|
var postLinks = document.querySelectorAll("a[data-link-to-post]"),
|
|
|
|
i;
|
|
|
|
|
|
|
|
for (i=0; i<postLinks.length; i++) {
|
2014-01-03 13:45:22 -06:00
|
|
|
postLinks[i].onclick = clickPostLink;
|
|
|
|
}
|
2014-03-20 09:57:18 -05:00
|
|
|
|
|
|
|
// Make sure all links in the iframe point to _blank
|
|
|
|
var cookedLinks = document.querySelectorAll('.cooked a');
|
|
|
|
for (i=0; i<cookedLinks.length; i++) {
|
|
|
|
cookedLinks[i].target = "_blank";
|
|
|
|
}
|
2014-03-20 13:34:51 -05:00
|
|
|
|
|
|
|
// Adjust all names
|
2014-03-20 15:04:50 -05:00
|
|
|
var names = document.querySelectorAll('.username a');
|
2014-03-20 13:34:51 -05:00
|
|
|
for (i=0; i<names.length; i++) {
|
|
|
|
var username = names[i].innerHTML;
|
|
|
|
if (username) {
|
|
|
|
names[i].innerHTML = new BreakString(username).break();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-03 13:45:22 -06:00
|
|
|
};
|
|
|
|
|
2013-12-31 13:37:43 -06:00
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<%= yield %>
|
|
|
|
</body>
|
2014-03-20 09:57:18 -05:00
|
|
|
</html>
|