mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
improvements to surf mode
This commit is contained in:
parent
3a157b697f
commit
2c3441d791
2 changed files with 18 additions and 14 deletions
10
app/surf.rb
10
app/surf.rb
|
@ -44,9 +44,13 @@ get %r{\/surf\/proxy\/([\w-]+)\/(.+)|\/surf\/proxy\/([\w-]+)\/?} do
|
|||
|
||||
new_ele = nil
|
||||
|
||||
if uri.match /^\//
|
||||
new_ele = ele.gsub(uri, "#{$config['surf_proxy_uri']}/surf/proxy/#{site.username}#{uri}")
|
||||
elsif !uri.match /^\w+:\/\//
|
||||
if uri.match(/^\w+:\/\/|^\/\//i)
|
||||
if ele.match(/^href/i)
|
||||
new_ele = ele + ' target="_blank"'
|
||||
else
|
||||
new_ele = ele
|
||||
end
|
||||
else
|
||||
new_ele = ele.gsub(uri, "#{$config['surf_proxy_uri']}/surf/proxy/#{site.username}/#{uri}")
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
padding: 0;
|
||||
}
|
||||
html {
|
||||
height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
height: 100%;
|
||||
|
@ -50,7 +50,7 @@
|
|||
}
|
||||
#top-bar li {
|
||||
float: left;
|
||||
margin-left: 20px;
|
||||
margin-left: 20px;
|
||||
line-height: normal;
|
||||
}
|
||||
#top-bar a {
|
||||
|
@ -143,7 +143,7 @@
|
|||
#followLink .following {
|
||||
display: none;
|
||||
}
|
||||
#followLink .unfollow {
|
||||
#followLink .unfollow {
|
||||
display: none;
|
||||
}
|
||||
#followLink.is-following {
|
||||
|
@ -153,19 +153,19 @@
|
|||
#followLink.is-following .follow {
|
||||
display: none;
|
||||
}
|
||||
#followLink.is-following .following {
|
||||
#followLink.is-following .following {
|
||||
display: inline;
|
||||
}
|
||||
#followLink.is-following .unfollow {
|
||||
#followLink.is-following .unfollow {
|
||||
display: none;
|
||||
}
|
||||
#followLink.is-following.unfollow .follow {
|
||||
display: none;
|
||||
}
|
||||
#followLink.is-following.unfollow .following {
|
||||
#followLink.is-following.unfollow .following {
|
||||
display: none;
|
||||
}
|
||||
#followLink.is-following.unfollow .unfollow {
|
||||
#followLink.is-following.unfollow .unfollow {
|
||||
display: inline;
|
||||
}
|
||||
</style>
|
||||
|
@ -235,9 +235,9 @@
|
|||
<a class="close" href="//<%= @site.host %>" alt="close" title="close"></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
<iframe src="//<%= @site.host %>" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" id="website-frame" name="website-frame"></iframe>
|
||||
<iframe src="<%= "#{$config['surf_proxy_uri']}/surf/proxy/#{@site.username}" %>" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" id="website-frame" name="website-frame"></iframe>
|
||||
|
||||
<script src="/js/jquery-1.11.0.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
@ -267,7 +267,7 @@
|
|||
})
|
||||
|
||||
var link = $('a#followLink');
|
||||
|
||||
|
||||
function toggleFollow(id) {
|
||||
$.post('/site/'+id+'/toggle_follow', {csrf_token: '<%= csrf_token %>'}, function(res) {
|
||||
if(res.result == 'followed')
|
||||
|
@ -287,4 +287,4 @@
|
|||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue