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
|
new_ele = nil
|
||||||
|
|
||||||
if uri.match /^\//
|
if uri.match(/^\w+:\/\/|^\/\//i)
|
||||||
new_ele = ele.gsub(uri, "#{$config['surf_proxy_uri']}/surf/proxy/#{site.username}#{uri}")
|
if ele.match(/^href/i)
|
||||||
elsif !uri.match /^\w+:\/\//
|
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}")
|
new_ele = ele.gsub(uri, "#{$config['surf_proxy_uri']}/surf/proxy/#{site.username}/#{uri}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
html {
|
html {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
}
|
}
|
||||||
#top-bar li {
|
#top-bar li {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
#top-bar a {
|
#top-bar a {
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
#followLink .following {
|
#followLink .following {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#followLink .unfollow {
|
#followLink .unfollow {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#followLink.is-following {
|
#followLink.is-following {
|
||||||
|
@ -153,19 +153,19 @@
|
||||||
#followLink.is-following .follow {
|
#followLink.is-following .follow {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#followLink.is-following .following {
|
#followLink.is-following .following {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
#followLink.is-following .unfollow {
|
#followLink.is-following .unfollow {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#followLink.is-following.unfollow .follow {
|
#followLink.is-following.unfollow .follow {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#followLink.is-following.unfollow .following {
|
#followLink.is-following.unfollow .following {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#followLink.is-following.unfollow .unfollow {
|
#followLink.is-following.unfollow .unfollow {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -235,9 +235,9 @@
|
||||||
<a class="close" href="//<%= @site.host %>" alt="close" title="close"></a>
|
<a class="close" href="//<%= @site.host %>" alt="close" title="close"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</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/jquery-1.11.0.min.js"></script>
|
||||||
<script src="/js/bootstrap.min.js"></script>
|
<script src="/js/bootstrap.min.js"></script>
|
||||||
|
@ -267,7 +267,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
var link = $('a#followLink');
|
var link = $('a#followLink');
|
||||||
|
|
||||||
function toggleFollow(id) {
|
function toggleFollow(id) {
|
||||||
$.post('/site/'+id+'/toggle_follow', {csrf_token: '<%= csrf_token %>'}, function(res) {
|
$.post('/site/'+id+'/toggle_follow', {csrf_token: '<%= csrf_token %>'}, function(res) {
|
||||||
if(res.result == 'followed')
|
if(res.result == 'followed')
|
||||||
|
@ -287,4 +287,4 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue