diff --git a/htroot/Blacklist_p.html b/htroot/Blacklist_p.html index c918fef1d..525491dd4 100644 --- a/htroot/Blacklist_p.html +++ b/htroot/Blacklist_p.html @@ -14,19 +14,19 @@ You may also provide your blacklist to other peers by sharing them; in return you may collect blacklist entries from other peers.

-

Active list: #[currentBlacklist]# #(disabled)#::No blacklist selected#(/disabled)#

+

Active list: #(disabled)##[currentBlacklist]#::No blacklist selected#(/disabled)#

Select list: -
+ #(disabled)#
- -
+ + ::#(/disabled)#
New list: @@ -34,14 +34,14 @@
- +#(disabled)#
Settings for this list
- - + +
@@ -56,7 +56,7 @@ #{/currentActiveFor}# - +
@@ -78,7 +78,7 @@ #{/Itemlist}#
- +
@@ -93,20 +93,22 @@
- -

- #(status)# - :: - #[item]# was removed from blacklist - :: - #[item]# was added to the blacklist - #(/status)# -

+
- + ::#(/disabled)# +
+

+ #(status)# + :: + #[item]# was removed from blacklist + :: + #[item]# was added to the blacklist + #(/status)# +

+
+ #(disabled)#
Import blacklist items from... @@ -119,7 +121,7 @@ #{/otherHosts}# - +
@@ -129,7 +131,7 @@ URL: - + @@ -139,10 +141,10 @@ file: - + - + ::#(/disabled)# #%env/templates/footer.template%# diff --git a/htroot/Blacklist_p.java b/htroot/Blacklist_p.java index 5c47f5ddd..a7c15003b 100644 --- a/htroot/Blacklist_p.java +++ b/htroot/Blacklist_p.java @@ -66,6 +66,7 @@ import de.anomic.yacy.yacyCore; import de.anomic.yacy.yacySeed; public class Blacklist_p { + private final static String DISABLED = "disabled_"; private final static String BLACKLIST = "blackLists_"; private final static String BLACKLIST_SHARED = "BlackLists.Shared"; @@ -291,8 +292,8 @@ public class Blacklist_p { // Read the blacklist items from file - int entryCount = 0; if (blacklistToUse != null) { + int entryCount = 0; final ArrayList list = listManager.getListArray(new File(listManager.listsPath, blacklistToUse)); // sort them @@ -306,77 +307,76 @@ public class Blacklist_p { if (nextEntry.length() == 0) continue; if (nextEntry.startsWith("#")) continue; - prop.put("Itemlist_" + entryCount + "_item", nextEntry); + prop.put(DISABLED + "Itemlist_" + entryCount + "_item", de.anomic.data.wikiCode.replaceHTMLonly(nextEntry)); entryCount++; } - } - prop.put("Itemlist", entryCount); - + prop.put(DISABLED + "Itemlist", entryCount); - // List known hosts for BlackList retrieval - if (yacyCore.seedDB != null && yacyCore.seedDB.sizeConnected() > 0) { // no nullpointer error - int peerCount = 0; - try { - TreeMap hostList = new TreeMap(); - final Enumeration e = yacyCore.seedDB.seedsConnected(true, false, null, (float) 0.0); - while (e.hasMoreElements()) { - yacySeed seed = (yacySeed) e.nextElement(); - if (seed != null) hostList.put(seed.get(yacySeed.NAME, "nameless"),seed.hash); - } - String peername; - while ((peername = (String) hostList.firstKey()) != null) { - final String Hash = (String) hostList.get(peername); - prop.put("otherHosts_" + peerCount + "_hash", Hash); - prop.put("otherHosts_" + peerCount + "_name", peername); - hostList.remove(peername); - peerCount++; - } - } catch (Exception e) {/* */} - prop.put("otherHosts", peerCount); + // List known hosts for BlackList retrieval + if (yacyCore.seedDB != null && yacyCore.seedDB.sizeConnected() > 0) { // no nullpointer error + int peerCount = 0; + try { + TreeMap hostList = new TreeMap(); + final Enumeration e = yacyCore.seedDB.seedsConnected(true, false, null, (float) 0.0); + while (e.hasMoreElements()) { + yacySeed seed = (yacySeed) e.nextElement(); + if (seed != null) hostList.put(seed.get(yacySeed.NAME, "nameless"),seed.hash); + } + + String peername; + while ((peername = (String) hostList.firstKey()) != null) { + final String Hash = (String) hostList.get(peername); + prop.put(DISABLED + "otherHosts_" + peerCount + "_hash", Hash); + prop.put(DISABLED + "otherHosts_" + peerCount + "_name", peername); + hostList.remove(peername); + peerCount++; + } + } catch (Exception e) {/* */} + prop.put(DISABLED + "otherHosts", peerCount); + } } - // List BlackLists int blacklistCount = 0; if (dirlist != null) { for (int i = 0; i <= dirlist.length - 1; i++) { - prop.put(BLACKLIST + blacklistCount + "_name", dirlist[i]); - prop.put(BLACKLIST + blacklistCount + "_selected", 0); + prop.put(DISABLED + BLACKLIST + blacklistCount + "_name", de.anomic.data.wikiCode.replaceHTMLonly(dirlist[i])); + prop.put(DISABLED + BLACKLIST + blacklistCount + "_selected", 0); if (dirlist[i].equals(blacklistToUse)) { //current List - prop.put(BLACKLIST + blacklistCount + "_selected", 1); + prop.put(DISABLED + BLACKLIST + blacklistCount + "_selected", 1); for (int blTypes=0; blTypes < supportedBlacklistTypes.length; blTypes++) { - prop.put("currentActiveFor_" + blTypes + "_blTypeName",supportedBlacklistTypes[blTypes]); - prop.put("currentActiveFor_" + blTypes + "_checked", + prop.put(DISABLED + "currentActiveFor_" + blTypes + "_blTypeName",supportedBlacklistTypes[blTypes]); + prop.put(DISABLED + "currentActiveFor_" + blTypes + "_checked", listManager.ListInListslist(supportedBlacklistTypes[blTypes] + ".BlackLists",dirlist[i])?0:1); } - prop.put("currentActiveFor",supportedBlacklistTypes.length); + prop.put(DISABLED + "currentActiveFor",supportedBlacklistTypes.length); } if (listManager.ListInListslist(BLACKLIST_SHARED, dirlist[i])) { - prop.put(BLACKLIST + blacklistCount + "_shared", 1); + prop.put(DISABLED + BLACKLIST + blacklistCount + "_shared", 1); } else { - prop.put(BLACKLIST + blacklistCount + "_shared", 0); + prop.put(DISABLED + BLACKLIST + blacklistCount + "_shared", 0); } int activeCount = 0; for (int blTypes=0; blTypes < supportedBlacklistTypes.length; blTypes++) { if (listManager.ListInListslist(supportedBlacklistTypes[blTypes] + ".BlackLists",dirlist[i])) { - prop.put(BLACKLIST + blacklistCount + "_active_" + activeCount + "_blTypeName",supportedBlacklistTypes[blTypes]); + prop.put(DISABLED + BLACKLIST + blacklistCount + "_active_" + activeCount + "_blTypeName",supportedBlacklistTypes[blTypes]); activeCount++; } } - prop.put(BLACKLIST + blacklistCount + "_active",activeCount); + prop.put(DISABLED + BLACKLIST + blacklistCount + "_active",activeCount); blacklistCount++; } } - prop.put("blackLists", blacklistCount); + prop.put(DISABLED + "blackLists", blacklistCount); - prop.put("currentBlacklist", (blacklistToUse==null)?"":blacklistToUse); - prop.put("disabled", (blacklistToUse==null)?1:0); + prop.put(DISABLED + "currentBlacklist", (blacklistToUse==null)?"":blacklistToUse); + prop.put("disabled", (blacklistToUse == null) ? 1 : 0); return prop; } diff --git a/htroot/Bookmarks.html b/htroot/Bookmarks.html index abc496930..b23ca42b6 100644 --- a/htroot/Bookmarks.html +++ b/htroot/Bookmarks.html @@ -106,7 +106,7 @@ #[title]#

#[description]#

-

Tagged with | #{tags}##[tag]# | #{/tags}#

+

Tagged with | #{tags}##[tag]# | #{/tags}#

Edit / Delete diff --git a/htroot/Bookmarks.java b/htroot/Bookmarks.java index a84fd7a22..d96d29d19 100644 --- a/htroot/Bookmarks.java +++ b/htroot/Bookmarks.java @@ -242,7 +242,7 @@ public class Bookmarks { while(count#[url]#

#[info]# - HTTP Header +

HTTP Header

#(header)#- no header in header cache -::#{line}# @@ -28,70 +28,70 @@ #(type)# - TITLE:
- #[title]#
-
+

+ TITLE: #[title]# +

- SECTION HEADLINES:
+

SECTION HEADLINES:


- HREF:
+ #(use.links)#::

HREF:

#[property]#
#{links}# #{/links}# -
#[name]# #[link]#
+ #(/use.links)# - IMAGE:
+ #(use.images)#::

IMAGE:

#{images}# #{/images}# -
#[name]# #[link]#
+ #(/use.images)# - AUDIO:
+ #(use.audio)#::

AUDIO:

#{audio}# #{/audio}# -
#[name]# #[link]#
+ #(/use.audio)# - VIDEO:
+ #(use.video)#::

VIDEO:

#{video}# #{/video}# -
#[name]# #[link]#
+ #(/use.video)# - APPS:
+ #(use.apps)#::

APPS:

#{apps}# #{/apps}# -
#[name]# #[link]#
+ #(/use.apps)# - EMAIL:
+ #(use.email)#::

EMAIL:

#{email}# #{/email}# -
#[name]# #[link]#
+ #(/use.email)# - TEXT:
+

TEXT:

#[text]# - LINES:
+

LINES:

#{lines}# #[line]##{/lines}# diff --git a/htroot/CacheAdmin_p.java b/htroot/CacheAdmin_p.java index 75de476b0..c2faa2e31 100644 --- a/htroot/CacheAdmin_p.java +++ b/htroot/CacheAdmin_p.java @@ -148,7 +148,8 @@ public class CacheAdmin_p { String[] t = document.getSectionTitles(); prop.put("info_type_headlines", t.length); for (i = 0; i < t.length; i++) - prop.put("info_type_headlines_" + i + "_headline", t[i].replaceAll("\n", "").trim()); + prop.put("info_type_headlines_" + i + "_headline", + de.anomic.data.wikiCode.replaceHTMLonly(t[i].replaceAll("\n", "").trim())); formatAnchor(prop, document.getHyperlinks(), "links"); formatImageAnchor(prop, document.getImages()); @@ -157,13 +158,15 @@ public class CacheAdmin_p { formatAnchor(prop, document.getApplinks(), "apps"); formatAnchor(prop, document.getEmaillinks(), "email"); - prop.put("info_type_text", new String(scraper.getText())); + prop.put("info_type_text", + de.anomic.data.wikiCode.replaceHTMLonly(new String(scraper.getText()))); i = 0; final Iterator sentences = document.getSentences(false); if (sentences != null) while (sentences.hasNext()) { - prop.put("info_type_lines_" + i + "_line", sentences.next().toString().replaceAll("\n", "").trim()); + prop.put("info_type_lines_" + i + "_line", + de.anomic.data.wikiCode.replaceHTMLonly(sentences.next().toString().replaceAll("\n", "").trim())); i++; } prop.put("info_type_lines", i); @@ -257,29 +260,34 @@ public class CacheAdmin_p { final Iterator iter = anchor.entrySet().iterator(); String descr; Map.Entry entry; - prop.put("info_type_" + extension, anchor.size()); + prop.put("info_type_use." + extension + "_" + extension, anchor.size()); int i = 0; while (iter.hasNext()) { entry = (Map.Entry) iter.next(); descr = ((String) entry.getValue()).trim(); if (descr.length() == 0) { descr = "-"; } - prop.put("info_type_" + extension + "_" + i + "_name", descr.replaceAll("\n", "").trim()); - prop.put("info_type_" + extension + "_" + i + "_link", entry.getKey()); + prop.put("info_type_use." + extension + "_" + extension + "_" + i + "_name", + de.anomic.data.wikiCode.replaceHTMLonly(descr.replaceAll("\n", "").trim())); + prop.put("info_type_use." + extension + "_" + extension + "_" + i + "_link", + de.anomic.data.wikiCode.replaceHTMLonly(entry.getKey().toString())); i++; } + prop.put("info_type_use." + extension, (i == 0) ? 0 : 1); } private static void formatImageAnchor(serverObjects prop, TreeSet anchor) { final Iterator iter = anchor.iterator(); htmlFilterImageEntry ie; - prop.put("info_type_images", anchor.size()); + prop.put("info_type_use.images_images", anchor.size()); int i = 0; while (iter.hasNext()) { ie = (htmlFilterImageEntry) iter.next(); - prop.put("info_type_images_" + i + "_name", ie.alt().replaceAll("\n", "").trim()); - prop.put("info_type_images_" + i + "_link", ie.url().toNormalform()); + prop.put("info_type_use.images_images_" + i + "_name", ie.alt().replaceAll("\n", "").trim()); + prop.put("info_type_use.images_images_" + i + "_link", + de.anomic.data.wikiCode.replaceHTMLonly(ie.url().toNormalform())); i++; } + prop.put("info_type_use.images", (i == 0) ? 0 : 1); } private static void linkPathString(serverObjects prop, String path, boolean dir) {