Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

augmented browsing modification

cominched2ea0f08ec0
diff --git a/htroot/interaction/OverlayInteraction.html b/htroot/interaction/OverlayInteraction.html
index 91623314e..5aba5f85a 100644
--- a/htroot/interaction/OverlayInteraction.html
+++ b/htroot/interaction/OverlayInteraction.html
@@ -9,17 +9,98 @@ font-size: 10px;
position: fixed;
right: 0;
background: #ffffff;
-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;
+border:1px solid #5a346e;
+
+width: 210px;
height: auto;
-padding: 30px 130px 30px 30px;
-filter: alpha(opacity=80);
-opacity: .80;
+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_tags {
+
+font: arial,helvetica,sans-serif;
+font-size: 10px;
+position: fixed;
+right: 100px;
+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: 50px;
+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{
@@ -44,22 +125,146 @@ 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: 35px;
+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="sidebar-source" class="sci_panel" style="top: 20px;">
+
+<div id="sidebar-button" class="sci_masterbutton" style="">
+<img src="/currentyacypeer/env/grafics/sciety.png" onclick="$('.sci_headerbar').toggle(); "/>
+
+</div>
+
+<div id="sci_headerbar" class="sci_headerbar">
+
+
+<div id="sidebar-bar" class="sci_bar" style="">
+
+</div>
+
+
+
+<div id="sidebar-source" class="sci_left" style="">
<!--#include virtual="/interaction/Scibutton_part.html?details=true&amp;url=#[link]#" -->
</div>
-<!-- <div id="sidebar-document" class="sci_panel" style="top: 110px;">
+<div id="sidebar-source" class="sci_tags" style="">
+
+<img id="scitag" src="/currentyacypeer/env/grafics/tag.png" width="20px" height="20px" alt="0" onclick="$('#sidebar-tags').toggle(); return false">&nbsp; <span style="font-size: x-small; position: absolute; margin-top: 4px;">tags</span>
+
+</div>
+
+<div id="sidebar-document" class="sci_right" style="">
+
+<script type="text/javascript" charset="utf-8">
-document <img src="/currentyacypeer/env/grafics/bad.png" width="16px" height="16px" onclick="contribution (document.location.href, 'like document', '#[username]#'); return false">
+ function toggleit() {
+
+ var a = $('#scilight').attr('alt');
+
+ if (a == '0') {
+
+ $('#scilight').attr('alt', "1");
+ $('#scilight').attr('src', "/currentyacypeer/env/grafics/scilight_1.png");
+ storevalue_t ('#[link]#', 'scivote', '1');
+
+ } else {
+
+ $('#scilight').attr('alt', "0");
+ $('#scilight').attr('src', "/currentyacypeer/env/grafics/scilight_0.png");
+ storevalue_t ('#[link]#', 'scivote', '0');
+
+ }
+
+ }
+
-</div> -->
-<div id="sidebar-element" class="sci_panel" style="top: 110px;">
+
+
+</script>
+
+<img id="scilight" src="/currentyacypeer/env/grafics/scilight_0.png" width="20px" height="20px" alt="0" onclick="toggleit(); return false">&nbsp; <span style="font-size: x-small; position: absolute; margin-top: 4px;">scilight</span>
+
+<script type="text/javascript" charset="utf-8">
+
+if (loadvalue_t ('#[link]#', 'scivote') == '1') {
+ $('#scilight').attr('alt', '1');
+ $('#scilight').attr('src', '/currentyacypeer/env/grafics/scilight_1.png');
+}
+
+
+
+</script>
+
+</div>
+
+
+
+<div id="sidebar-tags" class="sci_panel" style="top: 50px; display: none;">
<input type="text" name="tags" id="tags" class="bm_input" size="80" />
@@ -87,6 +292,8 @@ document <img src="/currentyacypeer/env/grafics/bad.png" width="16px" height="16
</script>
+</div>
+
</div>
#(/enabled)#
diff --git a/htroot/interaction/OverlayReview.html b/htroot/interaction/OverlayReview.html
new file mode 100644
index 000000000..9269f487b
--- /dev/null
+++ b/htroot/interaction/OverlayReview.html
@@ -0,0 +1,304 @@
+#(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_tags {
+
+font: arial,helvetica,sans-serif;
+font-size: 10px;
+position: fixed;
+right: 100px;
+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: 50px;
+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: 35px;
+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="sidebar-button" class="sci_masterbutton" style="">
+<img src="/currentyacypeer/env/grafics/sciety.png" onclick="$('.sci_headerbar').toggle(); "/>
+
+</div>
+
+<div id="sci_headerbar" class="sci_headerbar">
+
+
+<div id="sidebar-bar" class="sci_bar" style="">
+
+</div>
+
+
+
+<div id="sidebar-source" class="sci_left" style="">
+
+
+</div>
+
+<div id="sidebar-source" class="sci_tags" style="">
+
+<img id="scitag" src="/currentyacypeer/env/grafics/tag.png" width="20px" height="20px" alt="0" onclick="$('#sidebar-tags').toggle(); return false">&nbsp; <span style="font-size: x-small; position: absolute; margin-top: 4px;">tags</span>
+
+</div>
+
+<div id="sidebar-document" class="sci_right" style="">
+
+<script type="text/javascript" charset="utf-8">
+
+
+
+ function toggleit() {
+
+
+
+ thing('#[link]#', 'title');
+
+ var a = $('#scilight').attr('alt');
+
+ if (a == '0') {
+
+ $('#scilight').attr('alt', "1");
+ $('#scilight').attr('src', "/currentyacypeer/env/grafics/scilight_1.png");
+ storevalue_t ('#[link]#', 'scivote', '1');
+
+ } else {
+
+ $('#scilight').attr('alt', "0");
+ $('#scilight').attr('src', "/currentyacypeer/env/grafics/scilight_0.png");
+ storevalue_t ('#[link]#', 'scivote', '0');
+
+ }
+
+ }
+
+
+
+
+
+
+</script>
+
+<img id="scilight" src="/currentyacypeer/env/grafics/scilight_0.png" width="20px" height="20px" alt="0" onclick="toggleit(); return false">&nbsp; <span style="font-size: x-small; position: absolute; margin-top: 4px;">scilight</span>
+
+<script type="text/javascript" charset="utf-8">
+
+if (loadvalue_t ('#[link]#', 'scivote') == '1') {
+ $('#scilight').attr('alt', '1');
+ $('#scilight').attr('src', '/currentyacypeer/env/grafics/scilight_1.png');
+}
+
+
+
+</script>
+
+</div>
+
+
+
+<div id="sidebar-tags" class="sci_panel" style="top: 50px; display: none;">
+
+<input type="text" name="tags" id="tags" class="bm_input" size="80" />
+
+ <script type="text/javascript" charset="utf-8">
+
+ var oldvalue = loadvalue_t ('#[link]#', 'http://virtual.x/hastags');
+
+ document.getElementById('tags').value = oldvalue;
+
+ $('#tags').tagsInput({
+ 'height':'105px',
+ 'width':'270px',
+ 'interactive':true,
+ 'removeWithBackspace' : true,
+ 'minChars' : 0,
+ 'maxChars' : 0,
+ 'placeholderColor' : '#666666',
+ 'onChange' : function () {
+ storevalue_t ('#[link]#', 'http://virtual.x/hastags', document.getElementById('tags').value);
+ }
+ });
+
+
+
+ </script>
+
+
+</div>
+
+</div>
+
+#(/enabled)#
diff --git a/htroot/interaction/OverlayReview.java b/htroot/interaction/OverlayReview.java
new file mode 100644
index 000000000..816dd06c5
--- /dev/null
+++ b/htroot/interaction/OverlayReview.java
@@ -0,0 +1,100 @@
+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 OverlayReview {
+
+ 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.overlayreview.enabled", true) ? "1" : "0");
+
+ UserDB.Entry entry=null;
+
+ prop.put("enabled_username", "anonymous");
+
+ prop.put("enabled_link", post.get("link", ""));
+
+ //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/htroot/interaction/formdata.js b/htroot/interaction/formdata.js
new file mode 100644
index 000000000..4eabc4815
--- /dev/null
+++ b/htroot/interaction/formdata.js
@@ -0,0 +1,37 @@
+/**
+ * Emulate FormData for some browsers
+ * MIT License
+ * (c) 2010 François de Metz
+ */
+(function(w) {
+ if (w.FormData)
+ return;
+ function FormData() {
+ this.fake = true;
+ this.boundary = "--------FormData" + Math.random();
+ this._fields = [];
+ }
+ FormData.prototype.append = function(key, value) {
+ this._fields.push([key, value]);
+ }
+ FormData.prototype.toString = function() {
+ var boundary = this.boundary;
+ var body = "";
+ this._fields.forEach(function(field) {
+ body += "--" + boundary + "\r\n";
+ // file upload
+ if (field[1].name) {
+ var file = field[1];
+ body += "Content-Disposition: form-data; name=\""+ field[0] +"\"; filename=\""+ file.name +"\"\r\n";
+ body += "Content-Type: "+ file.type +"\r\n\r\n";
+ body += file.getAsBinary() + "\r\n";
+ } else {
+ body += "Content-Disposition: form-data; name=\""+ field[0] +"\";\r\n\r\n";
+ body += field[1] + "\r\n";
+ }
+ });
+ body += "--" + boundary +"--";
+ return body;
+ }
+ w.FormData = FormData;
+})(window);
diff --git a/htroot/interaction/interaction_sciety.js b/htroot/interaction/interaction_sciety.js
new file mode 100644
index 000000000..7be248e1f
--- /dev/null
+++ b/htroot/interaction/interaction_sciety.js
@@ -0,0 +1,405 @@
+function newload (name, div) {
+
+$.get(name, function(data) {
+
+$('#'+div).html(data);
+});
+
+}
+
+function xmlToString (xmlData) {
+
+ var xmlString;
+
+ if (window.ActiveXObject) {
+ xmlString = xmlData.xml;
+ }
+
+ else {
+ xmlString = (new XMLSerializer()).serializeToString(xmlData);
+ }
+
+ return xmlString;
+
+}
+
+function rdfload (datastore) {
+
+$.ajax({
+ type : "GET",
+ url: "/currentyacypeer/interaction/GetRDF.xml?global=true",
+ dataType: "xml",
+ success: function(xml) {
+ datastore.load(xml);
+
+ }
+
+
+});
+
+
+
+}
+
+
+function feedback (url, comment, from) {
+
+
+
+ $.getJSON('/currentyacypeer/interaction/Feedback.json?url='+url+'&comment='+comment+'&from='+from, function(data) {
+
+ });
+
+}
+
+function suggest (url) {
+
+ $.getJSON('/currentyacypeer/interaction/Suggest.json?url='+url, function(data) {
+
+
+ });
+
+}
+
+function contribution (url, comment, username) {
+
+ $.getJSON('/currentyacypeer/interaction/Contribution.json?url='+url+'&comment='+comment+'&from='+username, function(data) {
+
+
+ });
+
+}
+
+function triple (url, s, p, o, username) {
+
+ $.getJSON('/currentyacypeer/interaction/Triple.json?url='+url+'&s='+s+'&p='+p+'&o='+o+'&from='+username, function(data) {
+
+
+ });
+
+}
+
+function storevalue_t (s, p, o) {
+
+ $.getJSON('/currentyacypeer/interaction/Table.json?url='+s+'&s='+s+'&p='+p+'&o='+o, function(data) {
+
+
+ });
+
+}
+
+function storevalueglobal_t (s, p, o) {
+
+ $.getJSON('/currentyacypeer/interaction/Table.json?global=true&url='+s+'&s='+s+'&p='+p+'&o='+o, function(data) {
+
+
+ });
+
+}
+
+function storevalue (s, p, o) {
+
+ $.getJSON('/currentyacypeer/interaction/Triple.json?url='+s+'&s='+s+'&p='+p+'&o='+o, function(data) {
+
+
+ });
+
+}
+
+function storevalueglobal (s, p, o) {
+
+ $.getJSON('/currentyacypeer/interaction/Triple.json?global=true&url='+s+'&s='+s+'&p='+p+'&o='+o, function(data) {
+
+
+ });
+
+}
+
+function loadvalue (s, p) {
+
+ var res = {result: ""};
+
+ $.ajaxSetup({async: false});
+
+ $.getJSON('/currentyacypeer/interaction/Triple.json?s='+s+'&p='+p+'&load=true', function (data) {
+
+ res = data;
+
+ });
+
+
+ return res.result;
+
+}
+
+function loadvalue_t (s, p) {
+
+ var res = {result: ""};
+
+ $.ajaxSetup({async: false});
+
+ $.getJSON('/currentyacypeer/interaction/Table.json?s='+s+'&p='+p+'&load=true', function (data) {
+
+ res = data;
+
+ });
+
+
+ return res.result;
+
+}
+
+function loadvalueglobal_t (s, p) {
+
+ var res = {result: ""};
+
+ $.ajaxSetup({async: false});
+
+ $.getJSON('/currentyacypeer/interaction/Table.json?global=true&s='+s+'&p='+p+'&load=true', function (data) {
+
+ res = data;
+
+ });
+
+
+ return res.result;
+
+}
+
+function loadvalueglobal (s, p) {
+
+ var res = {result: ""};
+
+ $.ajaxSetup({async: false});
+
+ $.getJSON('/currentyacypeer/interaction/Triple.json?global=true&s='+s+'&p='+p+'&load=true', function (data) {
+
+ res = data;
+
+ });
+
+
+ return res.result;
+
+}
+
+function thing(url, title)
+{
+ var newItems = [];
+
+ var d = new Date();
+ var n = d.getTime();
+
+ var customItem = {
+ "itemType": "webpage",
+ "title": title,
+ "url": url
+ };
+
+
+ newItems.push(customItem);
+
+ var payload = JSON.stringify({"overall":{"item":customItem}}, null, "\t");
+
+ doAuthenticatedPost(payload, payload, function(status) {
+ if(!status) {
+ // callback(false, new Error("Save to server failed"));
+ } else {
+
+ // callback(true, newItems);
+ }
+ }, true, true);
+
+
+}
+
+
+
+function doAuthenticatedPost (body, body2, callback, docreate, dooverwrite, param, paramval) {
+
+ // process url
+ // var url = "http://wiki.sciety.org/content/Special:ECC_In";
+ // var url = "http://wiki.sciety.org/content/Special:ECC_In";
+ var url = "http://141.52.79.141/content/Special:ECC_In";
+
+
+ // do form submit
+
+ doFormSubmit(url, body, body2, function(xmlhttp) {
+
+ if([200, 201, 204].indexOf(xmlhttp.status) !== -1) {
+
+ theResult = JSON.parse(xmlhttp.responseText);
+
+ alert (theResult.username);
+
+ // document.getElementById("sciety_averagerating").value = "Average rating: " + theResult.averagerating;
+
+ // document.getElementById("sciety_username").value = "Current user: " + theResult.username;
+ // document.getElementById("sciety_uservalue").value = "Your ranking weight: " + theResult.uservalue;
+
+ // update_view();
+
+ callback(true);
+ } else {
+
+ theResult = JSON.parse(xmlhttp.responseText);
+
+ // document.getElementById("sciety_averagerating").value = "Average rating: " + theResult.averagerating;
+
+ // document.getElementById("sciety_username").value = "Current user: " + theResult.username;
+ // document.getElementById("sciety_uservalue").value = "Your ranking weight: " + theResult.uservalue;
+
+ var msg = xmlhttp.responseText;
+
+ alert (theResult.username);
+
+ // update_view();
+
+ callback(false);
+ }
+ }, false, docreate, dooverwrite, param, paramval);
+ }
+
+
+function doSubmitAdditionalElement (body, body2, callback, docreate, dooverwrite, param, paramval) {
+
+ // process url
+ // var url = "http://wiki.sciety.org/content/Special:ECC_In";
+ var url = "http://wiki.sciety.org/content/Special:ECC_Add";
+
+
+ // do form submit
+
+ doFormSubmit(url, body, body2, function(xmlhttp) {
+
+ if([200, 201, 204].indexOf(xmlhttp.status) !== -1) {
+
+ theResult = JSON.parse(xmlhttp.responseText);
+
+ update_view();
+
+ callback(true);
+ } else {
+
+ theResult = JSON.parse(xmlhttp.responseText);
+
+ var msg = xmlhttp.responseText;
+
+ update_view();
+
+ callback(false);
+ }
+ }, false, docreate, dooverwrite, param, paramval);
+ }
+
+
+function doFormSubmit (url, body, body2, onDone, headers, docreate, dooverwrite, param, paramval) {
+
+ var bodyStart = body.substr(0, 1024);
+
+ var formData = new FormData();
+
+ formData.append ("create", docreate);
+ formData.append ("overwrite", dooverwrite);
+
+ formData.append ("item", body);
+ formData.append ("data", body2);
+
+
+ if (param) {
+ formData.append(param, paramval);
+ }
+
+ var ie = false;
+
+ if (XDomainRequest) {
+ ie = true;
+
+ }
+
+
+ if (ie) {
+ var xmlhttp = new XDomainRequest();
+ }
+ else {
+ var xmlhttp = new XMLHttpRequest();
+ }
+
+ try {
+
+
+ xmlhttp.open('POST', url, true);
+
+
+ xmlhttp.onreadystatechange = function(){
+ _stateChange(xmlhttp, onDone);
+ };
+
+ // if (formData.fake)
+
+ if (!ie ) {
+ xmlhttp.setRequestHeader("Content-Type", "multipart/form-data; boundary="+formData.boundary);
+ xmlhttp.sendAsBinary(formData.toString());
+ } else {
+
+ xmlhttp.send(body);
+
+ }
+
+
+ } catch(e) {
+
+ alert (e);
+
+ if(onDone) {
+ window.setTimeout(function() {
+ try {
+ onDone({"status":0});
+ } catch(e) {
+ return;
+ }
+ }, 0);
+ }
+ }
+
+ return xmlhttp;
+ }
+
+
+
+
+ /**
+ * Handler for XMLHttpRequest state change
+ *
+ * @param {nsIXMLHttpRequest} XMLHttpRequest whose state just changed
+ * @param {Function} [onDone] Callback for request completion
+ * @param {String} [responseCharset] Character set to force on the response
+ * @private
+ */
+ function _stateChange(xmlhttp, callback) {
+ switch (xmlhttp.readyState){
+ // Request not yet made
+ case 1:
+ break;
+
+ case 2:
+ break;
+
+ // Called multiple times while downloading in progress
+ case 3:
+ break;
+
+ // Download complete
+ case 4:
+ if (callback) {
+ try {
+ callback(xmlhttp);
+ } catch(e) {
+
+ return;
+ }
+ }
+ break;
+ }
+ }
\ No newline at end of file
diff --git a/source/net/yacy/interaction/AugmentHtmlStream.java b/source/net/yacy/interaction/AugmentHtmlStream.java
index 0ebfd0b67..e5058049e 100644
--- a/source/net/yacy/interaction/AugmentHtmlStream.java
+++ b/source/net/yacy/interaction/AugmentHtmlStream.java
@@ -216,7 +216,7 @@ public class AugmentHtmlStream {
Switchboard sb = Switchboard.getSwitchboard();
boolean augmented = false;
-
+
try {
Log.logInfo("AUGMENTATION", url.getName());
} catch (IOException e1) {
@@ -369,7 +369,12 @@ public class AugmentHtmlStream {
NodeList headchildren = ht.getChildren();
- headchildren.add(new org.htmlparser.nodes.TextNode(loadInternal("interactionparts/interaction.html", requestHeader)));
+ headchildren.add(new org.htmlparser.nodes.TextNode(loadInternal("env/templates/jqueryheader.template", requestHeader)));
+ // headchildren.add(new org.htmlparser.nodes.TextNode("<script type='text/javascript'>"+loadInternal("interaction/formdata.js", requestHeader)+"</script>"));
+
+ // headchildren.add(new org.htmlparser.nodes.TextNode("<script type='text/javascript'>"+loadInternal("interaction/interaction_sciety.js", requestHeader)+"</script>"));
+
+ headchildren.add(new org.htmlparser.nodes.TextNode("<script type='text/javascript'>"+loadInternal("interaction/interaction.js", requestHeader)+"</script>"));
augmented = true;
@@ -392,9 +397,13 @@ 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?link="+url.toNormalform(true, false), requestHeader)));
+ // bodychildren.add(new org.htmlparser.nodes.TextNode(loadInternal("interaction/OverlayReview.html?link="+url.toNormalform(true, false), requestHeader)));
+
+ bodychildren.add(new org.htmlparser.nodes.TextNode(loadInternal("interaction/Overlay.html?link="+url.toNormalform(true, false), requestHeader)));
+
// ADD AUGMENTED INFO