Skip to content

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

add missing files for tag display

cominchbddac2839e4f
diff --git a/htroot/env/templates/interactionheader.template b/htroot/env/templates/interactionheader.template
new file mode 100644
index 000000000..dc1fd9b03
--- /dev/null
+++ b/htroot/env/templates/interactionheader.template
@@ -0,0 +1,3 @@
+<!-- interaction header /env/interactionheader.template -->
+ <script src="/currentyacypeer/interaction_elements/interaction.js" type="text/javascript"></script>
+<!-- END interaction header -->
diff --git a/htroot/interaction_elements/Tag_part.html b/htroot/interaction_elements/Tag_part.html
new file mode 100644
index 000000000..8b970035e
--- /dev/null
+++ b/htroot/interaction_elements/Tag_part.html
@@ -0,0 +1,93 @@
+<span id="sci_tags_#[hash]#" class="sci_tag" style="display: none;">
+
+<img id="sci_tags_#[hash]#_img" src="/currentyacypeer/interaction_elements/tag.png" width="16px" height="16px" alt="0" onclick="/* $('#sci_tags_#[hash]#_box').toggle();*/ return false">&nbsp; <span style="font-size: x-small; position: absolute; margin-top: 4px;"><span id="sci_tags_#[hash]#_tags"></span></span>
+
+</span>
+
+<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_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;
+
+}
+
+
+</style>
+
+<div id="sci_tags_#[hash]#_box" class="sci_panel" style="top: 50px; display: none;">
+
+ <input type="text" id="tags_#[hash]#" name="tags_#[hash]#" class="bm_input" size="80" />
+
+ <script type="text/javascript" charset="utf-8">
+
+ var vocabularies_string = '#[vocabularies]#';
+
+ var vocs = vocabularies_string.split (",");
+
+ var existingtags = "";
+
+ vocs.forEach (function(voc) {
+
+ var currenttags = triple_get_prefix ('http://yacy.net/url', '#[hash]#', 'http://yacy.net/autotagging', voc);
+ if (existingtags != "" && currenttags != "") existingtags += " - ";
+ if (currenttags != "") existingtags += voc+":"+ currenttags;
+ });
+
+
+ if (existingtags != "") {
+ document.getElementById('sci_tags_#[hash]#').style.display = "";
+ document.getElementById('sci_tags_#[hash]#_tags').innerHTML = existingtags;
+ }
+
+
+
+ /* document.getElementById('tags_#[hash]#').value = existingtags;
+
+ $('#tags_#[hash]#').tagsInput({
+ 'height':'105px',
+ 'width':'270px',
+ 'interactive':true,
+ 'removeWithBackspace' : true,
+ 'minChars' : 0,
+ 'maxChars' : 0,
+ 'placeholderColor' : '#666666',
+ 'onChange' : function () {
+ storevalue_t ('http://yacy.net/url#[hash]#', 'http://yacy.net/autotagging#manual', document.getElementById('tags_#[hash]#').value);
+ }
+ }); */
+ </script>
+
+</div>
diff --git a/htroot/interaction_elements/Tag_part.java b/htroot/interaction_elements/Tag_part.java
new file mode 100644
index 000000000..fd4154eb5
--- /dev/null
+++ b/htroot/interaction_elements/Tag_part.java
@@ -0,0 +1,39 @@
+package interaction_elements;
+
+
+import java.util.Collection;
+
+import net.yacy.cora.lod.vocabulary.Tagging;
+import net.yacy.cora.protocol.HeaderFramework;
+import net.yacy.cora.protocol.RequestHeader;
+import net.yacy.document.LibraryProvider;
+import net.yacy.search.Switchboard;
+import de.anomic.data.UserDB;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+
+public class Tag_part {
+
+ 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("hash", post.get("hash", ""));
+
+ String vocabularies = "";
+
+ Collection<Tagging> vocs = LibraryProvider.autotagging.getVocabularies();
+
+ for (Tagging v: vocs) {
+ vocabularies += v.getName()+",";
+ }
+
+ vocabularies += "manual";
+
+ prop.put("vocabularies", vocabularies);
+
+ return prop;
+ }
+}
diff --git a/htroot/interaction_elements/tag.png b/htroot/interaction_elements/tag.png
new file mode 100644
index 000000000..1ff3a8013
Binary files /dev/null and b/htroot/interaction_elements/tag.png differ