add missing files for tag display

This commit is contained in:
cominch 2012-06-15 10:46:19 +02:00
parent 441430f507
commit bddac2839e
4 changed files with 135 additions and 0 deletions

View File

@ -0,0 +1,3 @@
<!-- interaction header /env/interactionheader.template -->
<script src="/currentyacypeer/interaction_elements/interaction.js" type="text/javascript"></script>
<!-- END interaction header -->

View File

@ -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>

View File

@ -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;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB