Augmented browsing: Add overlay bar which shows the vocabulary tags

pull/1/head
cominch 13 years ago
parent bddac2839e
commit 2ac7a5c1f2

@ -0,0 +1,193 @@
#(enabled)#::
<style type="text/css" >
.sci_panel {
font: arial,helvetica,sans-serif;
font-size: 10px;
position: fixed;
right: 0;
background: #ffffff;
border:1px solid #5a346e;
width: 210px;
height: auto;
padding: 30px 110px 30px 30px;
z-index:99998;
color: #5a346e;
}
.sci_right {
font: arial,helvetica,sans-serif;
font-size: 10px;
position: fixed;
right: 10px;
top: 0;
background: #ffffff;
border:0px;
width: 65px;
height: 20px;
padding: 5px 5px 5px 5px;
z-index:99998;
color: #5a346e;
}
.sci_hide {
font: arial,helvetica,sans-serif;
font-size: 10px;
position: fixed;
right: 0px;
top: 0;
background: #ffffff;
border:0px;
width: 30px;
height: 20px;
padding: 5px 5px 5px 5px;
z-index:99998;
color: #5a346e;
}
.sci_left {
font: arial,helvetica,sans-serif;
font-size: 10px;
position: fixed;
left: 10px;
top: 0;
margin-top: 1px;
padding-left: 50px;
background: #ffffff;
border:0px;
width: 250px;
height: 19px;
padding: 9px 5px 5px 5px;
z-index:99998;
color: #5a346e;
}
.sci_panel p{
margin: 0 0 15px 0;
padding: 0;
color: #cccccc;
}
.sci_panel a, .sci_panel a:visited{
margin: 0;
padding: 0;
color: #9FC54E;
text-decoration: none;
border-bottom: 1px solid #9FC54E;
}
.sci_panel a:hover, .sci_panel a:visited:hover{
margin: 0;
padding: 0;
color: #ffffff;
text-decoration: none;
border-bottom: 1px solid #ffffff;
}
.sci_headerbar {
font: arial,helvetica,sans-serif;
font-size: 10px;
position: fixed;
left: 0;
top: 0px;;
width: 100%;
height: 40px;
border:0px;
background: #ffffff;
padding: 0px 0px 0px 0px;
z-index:99998;
}
.sci_bar {
font: arial,helvetica,sans-serif;
font-size: 10px;
position: fixed;
left: 0;
top: 35px;;
width: 100%;
height: 2px;
background: #ffffff;
border:0px;
background: #5a346e;
padding: 0px 0px 0px 0px;
z-index:99998;
}
.sci_masterbutton {
font: arial,helvetica,sans-serif;
font-size: 10px;
position: fixed;
left: 0px;
top: -15px;
width: 0px;
height: 65px;
background: #ffffff;
border:0px;
background: #5a346e;
padding: 0px 0px 0px 0px;
z-index:99999;
}
}
</style>
<div id="sci_headerbar" class="sci_headerbar">
<div id="sidebar-bar" class="sci_bar" style="">
</div>
<div id="sidebar-logo" class="sci_left" style="">
<img src="/currentyacypeer/env/grafics/yacy.png" height="20px" width="36px"/>
<!--#include virtual="/currentyacypeer/interaction_elements/Tag_part.html?hash=#[urlhash]#" -->
</div>
<div id="sidebar-tags" class="sci_right" style="">
</div>
</div>
#(/enabled)#

@ -0,0 +1,24 @@
package interaction_elements;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.search.Switchboard;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
public class OverlayInteraction {
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects();
prop.put("enabled", env.getConfigBool("interaction.overlayinteraction.enabled", false) ? "1" : "0");
prop.put("enabled_url", post.get("url", ""));
prop.put("enabled_urlhash", post.get("urlhash", ""));
return prop;
}
}

@ -12,6 +12,7 @@ import java.net.URLEncoder;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import net.yacy.yacy; import net.yacy.yacy;
import net.yacy.cora.document.ASCII;
import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.http.HTTPClient; import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.document.Document; import net.yacy.document.Document;
@ -377,6 +378,8 @@ public class AugmentHtmlStream {
NodeList bodychildren = bt.getChildren(); NodeList bodychildren = bt.getChildren();
bodychildren.add(new org.htmlparser.nodes.TextNode(loadInternal("interaction_elements/OverlayInteraction.html?urlhash="+ ASCII.String(url.hash()) +"&url="+url.toNormalform(false, true), requestHeader)));
bt.setChildren(bodychildren); bt.setChildren(bodychildren);
augmented = true; augmented = true;

Loading…
Cancel
Save