Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
augmented browsing: ignore js and css, integrate more user interaction
cominchbc9a618e0a6c
diff --git a/htroot/interaction/Footer.html b/htroot/interaction/Footer.htmlnew file mode 100644index 000000000..23adeaa94--- /dev/null+++ b/htroot/interaction/Footer.html@@ -0,0 +1,139 @@+#(enabled)#::++<style type="text/css" >+/* Menu */++.menugroup h3 {+ -webkit-border-top-left-radius: 5px;+ -webkit-border-top-right-radius: 5px;+ -khtml-border-top-left-radius: 5px;+ -khtml-border-top-right-radius: 5px;+ -moz-border-radius-topleft: 5px;+ -moz-border-radius-topright: 5px;+ border-top-left-radius: 5px;+ border-top-right-radius: 5px;++ background-color: #[color_tableheader]#;+ color:white;+}++.SubMenugroup h3, .SubMenu h3 {+ -webkit-border-radius: 5px;+ -khtml-border-radius: 5px;+ -moz-border-radius: 5px;+ border-radius: 5px;++ background-color:#[color_tableheader]#;+ color:white;+}++a.MenuItemLink, ul.SubMenu em {+ background-color:#[color_tableitem]#;+ color:#[color_text]#;+}++a:hover.MenuItemLink {+ background-color:transparent;+ color:#[color_text]#;+}++ul.SubMenu a.MenuItemLink {+ margin-top:0;+}++a.MenuItemLink{+ display:block;+ text-decoration:none;+ margin-top:1px;+ margin-bottom:1px;+ padding:1px 10px 1px 15px;+ font-size:0.9em;+ white-space:nowrap;+}++li.menugroup a {+ white-space:normal;+}++a.MenuItemLink.lock{+ background-image:url(/env/grafics/lock.gif);+ background-position:2px center;+ background-repeat:no-repeat;+}++a:hover.MenuItemLink {+ text-decoration:none;+}++ul.SubMenu em {+ margin-top:0;+}++ul.SubMenu em.lock {+ background-image:url(/env/grafics/lock.gif);+ background-position:2px center;+ background-repeat:no-repeat;+}++ul.SubMenu em {+ display:block;+ text-decoration:none;+ margin-top:1px;+ margin-bottom:1px;+ padding:1px 10px 1px 15px;+ font-size:0.9em;+}++/* <ul>, <li> */++ul.tagList {+ list-style:none;+ padding:0;+ margin-left:0;+}++++ul.menu, ul.SubMenu {+ clear:left;+ padding:0;+ margin:0;+}++ul.menu li, ul.SubMenu li {+ list-style:none;+ margin:0;+ margin-top:1px;+ padding:0;+}++ul.SubMenu li {+ float:left;+ margin-right:1px;+ margin-top:0;+}++li.menugroup {+ margin-left:5px;+ margin-bottom:10px;+ list-style:none;+}+</style>++#(feedbackenabled)#::<!--#include virtual="/interaction/Feedback_part.html" -->#(/feedbackenabled)#+#(addcontentenabled)#::<!--#include virtual="/interaction/Suggest_part.html" -->#(/addcontentenabled)#+#(userlogonenabled)#::<!--#include virtual="/interaction/Login_part.html" -->#(/userlogonenabled)#++<!--#include virtual="/interaction/Category_part.html" -->++<div class="SubMenu" style="position: fixed; bottom: 0px; width: 100%;">++<ul class="SubMenu">+#(addcontentenabled)#::<li style="width:#[ratio]#%;"><a id="add_trigger" href="" class="MenuItemLink" style="color: #fff; background-color: #5A346E;" onclick="addclicker(); return false;">suggest a website</a></li>#(/addcontentenabled)#+#(userlogonenabled)#::<li style="width:#[ratio]#%;"><!--#include virtual="/interaction/Loginbutton_part.html" --></li>#(/userlogonenabled)#+#(feedbackenabled)#::<li style="width:#[ratio]#%;"><a id="feedback_trigger" href="" class="MenuItemLink" style="color: #fff; background-color: #5A346E;" onclick="clicker(); return false;">feedback</a></li>#(/feedbackenabled)#+</ul>++</div>++#(/enabled)#diff --git a/htroot/interaction/OverlayInteraction.html b/htroot/interaction/OverlayInteraction.htmlnew file mode 100644index 000000000..d7464b427--- /dev/null+++ b/htroot/interaction/OverlayInteraction.html@@ -0,0 +1,62 @@+#(enabled)#::++<style type="text/css" >++.sci_panel {++font: arial,helvetica,sans-serif;+font-size: 10px;+position: fixed;+top: 70px;+right: 0;+background: #610B5E;+border:1px solid #111111;+-moz-border-radius-topleft: 20px;+-webkit-border-top-left-radius: 20px;+-moz-border-radius-bottomleft: 20px;+-webkit-border-bottom-left-radius: 20px;+width: 250px;+height: auto;+padding: 30px 130px 30px 30px;+filter: alpha(opacity=80);+opacity: .80;+z-index:99998;+}++.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;+}++</style>++<div id="sidebar-source" class="sci_panel" style="">++source <img src="/currentyacypeer/env/grafics/bad.png" onclick="contribution (document.location.href, 'like source', '#[username]#'); return false">++</div>++<div id="sidebar-document" style="display: none;">++document++</div>++#(/enabled)#diff --git a/htroot/interaction/OverlayInteraction.java b/htroot/interaction/OverlayInteraction.javanew file mode 100644index 000000000..9fdffe9f6--- /dev/null+++ b/htroot/interaction/OverlayInteraction.java@@ -0,0 +1,98 @@+package interaction;++//ViewLog_p.java+//-----------------------+//part of the AnomicHTTPD caching proxy+//(C) by Michael Peter Christen; [email protected]+//first published on http://www.anomic.de+//Frankfurt, Germany, 2004+//+//This File is contributed by Alexander Schier+//last major change: 14.12.2004+//+//This program is free software; you can redistribute it and/or modify+//it under the terms of the GNU General Public License as published by+//the Free Software Foundation; either version 2 of the License, or+//(at your option) any later version.+//+//This program is distributed in the hope that it will be useful,+//but WITHOUT ANY WARRANTY; without even the implied warranty of+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+//GNU General Public License for more details.+//+//You should have received a copy of the GNU General Public License+//along with this program; if not, write to the Free Software+//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+++//You must compile this file with+//javac -classpath .:../classes ViewLog_p.java+//if the shell's current path is HTROOT++import net.yacy.cora.protocol.HeaderFramework;+import net.yacy.cora.protocol.RequestHeader;+import net.yacy.search.Switchboard;+import de.anomic.data.UserDB;+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", "1");++ UserDB.Entry entry=null;++ prop.put("enabled_username", "anonymous");++ //identified via HTTPPassword+ entry=sb.userDB.proxyAuth((header.get(RequestHeader.AUTHORIZATION, "xxxxxx")));+ if(entry != null){+ prop.put("enabled_logged-in_identified-by", "1");+ //try via cookie+ }else{+ entry=sb.userDB.cookieAuth(header.getHeaderCookies());+ prop.put("enabled_logged-in_identified-by", "2");+ //try via ip+ if(entry == null){+ entry=sb.userDB.ipAuth((header.get(HeaderFramework.CONNECTION_PROP_CLIENTIP, "xxxxxx")));+ if(entry != null){+ prop.put("enabled_logged-in_identified-by", "0");+ }+ }+ }++ //identified via userDB+ if(entry != null){+ prop.put("enabled_logged-in", "1");+ prop.put("enabled_username", entry.getUserName());+ if(entry.getTimeLimit() > 0){+ prop.put("enabled_logged-in_limit", "1");+ final long limit=entry.getTimeLimit();+ final long used=entry.getTimeUsed();+ prop.put("enabled_logged-in_limit_timelimit", limit);+ prop.put("enabled_logged-in_limit_timeused", used);+ int percent=0;+ if(limit!=0 && used != 0)+ percent=(int)((float)used/(float)limit*100);+ prop.put("enabled_logged-in_limit_percent", percent/3);+ prop.put("enabled_logged-in_limit_percent2", (100-percent)/3);+ }+ //logged in via static Password+ }else if(sb.verifyAuthentication(header)){+ prop.put("enabled_logged-in", "2");+ prop.put("enabled_username", "staticadmin");+ //identified via form-login+ //TODO: this does not work for a static admin, yet.+ }+++ return prop;+ }+}diff --git a/source/net/yacy/interaction/AugmentHtmlStream.java b/source/net/yacy/interaction/AugmentHtmlStream.javaindex 426c731c6..c5f825c3c 100644--- a/source/net/yacy/interaction/AugmentHtmlStream.java+++ b/source/net/yacy/interaction/AugmentHtmlStream.java@@ -384,7 +384,9 @@ public class AugmentHtmlStream {NodeList bodychildren = bt.getChildren();+ bodychildren.add(new org.htmlparser.nodes.TextNode(loadInternal("interaction/Footer.html", requestHeader)));+ bodychildren.add(new org.htmlparser.nodes.TextNode(loadInternal("interaction/OverlayInteraction.html", requestHeader)));// ADD AUGMENTED INFO