r70 - in trunk/src/main: java/org/chorem/bow webapp webapp/css
Author: bbrossaud Date: 2010-06-09 11:48:30 +0200 (Wed, 09 Jun 2010) New Revision: 70 Url: http://chorem.org/repositories/revision/bow/70 Log: cut the home jsp and search jsp Added: trunk/src/main/webapp/bookmark.jsp trunk/src/main/webapp/tagsCloud.jsp Modified: trunk/src/main/java/org/chorem/bow/BookmarkActions.java trunk/src/main/webapp/bookmarkHome.jsp trunk/src/main/webapp/bookmarkSearch.jsp trunk/src/main/webapp/css/bookmark.css Modified: trunk/src/main/java/org/chorem/bow/BookmarkActions.java =================================================================== --- trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-06-08 15:12:08 UTC (rev 69) +++ trunk/src/main/java/org/chorem/bow/BookmarkActions.java 2010-06-09 09:48:30 UTC (rev 70) @@ -413,7 +413,7 @@ public int getFont(int ti) { int font = 1; if (tmax > tmin) { - font = (50 * (ti - tmin)) / (tmax - tmin); // get the font size for a tag frequency + font = (30 * (ti - tmin)) / (tmax - tmin); // get the font size for a tag frequency } if (font < 10) { font = 10; Added: trunk/src/main/webapp/bookmark.jsp =================================================================== --- trunk/src/main/webapp/bookmark.jsp (rev 0) +++ trunk/src/main/webapp/bookmark.jsp 2010-06-09 09:48:30 UTC (rev 70) @@ -0,0 +1,70 @@ +<%@page import="org.chorem.bow.Bookmark" %> +<%@page import="java.text.SimpleDateFormat" %> +<%@page import="org.chorem.bow.BookmarkActions" %> +<%@page import="java.util.Set" %> + +<% + Bookmark bookmark = (Bookmark) request.getAttribute("bookmark"); + BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); + SimpleDateFormat sdf = (SimpleDateFormat) request.getAttribute("sdf"); + String url = (String) request.getAttribute("bowUrl"); + String search = ""; + String searchLine = request.getParameter("searchLine"); + if (searchLine != null) { + search += "&searchLine=" + searchLine; + } + String fullTextLine = request.getParameter("fullTextLine"); + if (fullTextLine != null) { + search += "&fullTextLine=" + fullTextLine; + } + if (url != null && bookmark != null && sdf != null && bookmarkActions != null) { + String formBookmarkId = (String) request.getAttribute("formBookmarkId"); + String link = bookmark.getLink(); + link = link.replace("'", "\\'"); +%> + + +<div class="bookmark"> + <div class="bookmarkhead clearfix"> + <img src="./img/ptit-livre.jpg" alt="web site logo" /> + <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank"> + <%=bookmark.getAlias()%> + </a> + <span> (<%=sdf.format(bookmark.getDate())%>)</span> + <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>', '<%=bookmark.getWikittyId()%>');"></a> + <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%><%=search%>"></a> + </div> + <div class="bookmarkcontenu clearfix"> + <div class="screenshot"></div> + <div class="description"> + <h3>Description :</h3> + <p> + <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a> + </p> + <p class="tags"> + <strong>Tags :</strong> + <% + Set<String> tagList = bookmark.getTags(); + if (tagList != null && !tagList.isEmpty()) { + for (String tag : tagList) { + if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) { + %> + <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%><%=search%>" > + <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> + </a> + <%} else {%> + <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%><%=search%>" > + <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> + </a> + <%}%> + <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a> + <% + } + } + %> + </p> + </div> + <div class="click"><%=bookmark.getClick()%></div> + </div> +</div> +<%}%> Modified: trunk/src/main/webapp/bookmarkHome.jsp =================================================================== --- trunk/src/main/webapp/bookmarkHome.jsp 2010-06-08 15:12:08 UTC (rev 69) +++ trunk/src/main/webapp/bookmarkHome.jsp 2010-06-09 09:48:30 UTC (rev 70) @@ -29,9 +29,9 @@ nbTags = preference.getTags(); } } + request.setAttribute("nbTags", nbTags); String formLink = (String) request.getAttribute("link"); String formName = (String) request.getAttribute("name"); - String formBookmarkId = (String) request.getAttribute("bookmarkId"); String formTags = (String) request.getAttribute("tags"); String formAlias = (String) request.getAttribute("alias"); String formAction = (String) request.getAttribute("action"); @@ -81,51 +81,10 @@ if (!bookmarkList.isEmpty()) { int count = 0; for (Bookmark bookmark : bookmarkList) { - String link = bookmark.getLink(); - link = link.replace("'", "\\'"); + request.setAttribute("bookmark", bookmark); + request.setAttribute("sdf", sdf); %> - <div class="bookmark"> - <div class="bookmarkhead clearfix"> - <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank"> - <%=bookmark.getAlias()%> - </a> - <span> (<%=sdf.format(bookmark.getDate())%>)</span> - <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');"></a> - <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>"></a> - </div> - <div class="bookmarkcontenu clearfix"> - <div class="screenshot"></div> - <div class="description"> - <h3>Description :</h3> - <p> - <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a> - </p> - <p class="tags"> - <strong>Tags :</strong> - <% - Set<String> tagList = bookmark.getTags(); - if (tagList != null && !tagList.isEmpty()) { - for (String tag : tagList) { - if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) { - %> - <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" > - <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> - </a> - <%} else {%> - <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" > - <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> - </a> - <%}%> - <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a> - <% - } - } - %> - </p> - </div> - <div class="click"><%=bookmark.getClick()%></div> - </div> - </div> + <jsp:include page="bookmark.jsp" flush="true" /> <% ++count; if (count >= nbBookmarks) { @@ -148,52 +107,10 @@ if (!lastBookmarks.isEmpty()) { int count = 0; for (Bookmark bookmark : lastBookmarks) { - String link = bookmark.getLink(); - link = link.replace("'", "\\'"); + request.setAttribute("bookmark", bookmark); + request.setAttribute("sdf", sdf); %> - <div class="bookmark"> - <div class="bookmarkhead clearfix"> - <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank"> - <%=bookmark.getAlias()%> - </a> - <span> (<%=sdf.format(bookmark.getDate())%>)</span> - <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');"></a> - <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>"></a> - </div> - <div class="bookmarkcontenu clearfix"> - <div class="screenshot"></div> - <div class="description"> - <h3>Description :</h3> - <p> - <a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a> - </p> - <p class="tags"> - <strong>Tags :</strong> - <% - Set<String> tagList = bookmark.getTags(); - if (tagList != null && !tagList.isEmpty()) { - for (String tag : tagList) { - if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) { - %> - <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" > - <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> - </a> - <%} else {%> - <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>" > - <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> - </a> - <%}%> - <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none"><%=tag%></a> - <% - } - } - %> - </p> - </div> - <div class="click"><%=bookmark.getClick()%></div> - </div> - </div> - + <jsp:include page="bookmark.jsp" flush="true" /> <% ++count; if (count >= nbBookmarks) { @@ -215,23 +132,7 @@ <li><a href="bow?action=generateToken">Regenerate permanent token</a></li> </ul> <div id="nuage"> - <% if (bookmarkActions != null) { - List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud(); - int count = 0; - for (FacetTopic tag : tagCloud) { - int value = tag.getCount(); - String tagName = tag.getTopicName(); - int font = bookmarkActions.getFont(value); - %> - <a href="bow?action=search&addTag=<%=tagName%>" title="<%=value%> results" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a> - <% - ++count; - if (count >= nbTags) { - break; - } - } - } - %> + <jsp:include page="tagsCloud.jsp" flush="true" /> </div> <div id="recherche"> <h2>Research</h2> @@ -255,8 +156,9 @@ <h2>Import Bookmarks</h2> <form method="POST" action="bow?action=importBookmarks" enctype="multipart/form-data"> <div class="input"> - <input type="file" name="upfile" /> - <button>Parcourir</button> + <input type="file" name="upfile" size="15%"/> + <br/> + <button type="submit">Import</button> </div> </form> <a href="bow?action=exportBookmarks">Export bookmarks</a> Modified: trunk/src/main/webapp/bookmarkSearch.jsp =================================================================== --- trunk/src/main/webapp/bookmarkSearch.jsp 2010-06-08 15:12:08 UTC (rev 69) +++ trunk/src/main/webapp/bookmarkSearch.jsp 2010-06-09 09:48:30 UTC (rev 70) @@ -27,9 +27,9 @@ nbTags = preference.getTags(); } } + request.setAttribute("nbTags", nbTags); String formLink = (String) request.getAttribute("link"); String formName = (String) request.getAttribute("name"); - String formBookmarkId = (String) request.getAttribute("bookmarkId"); String formTags = (String) request.getAttribute("tags"); String formAlias = (String) request.getAttribute("alias"); String formAction = (String) request.getAttribute("action"); @@ -90,48 +90,13 @@ if (!bookmarkList.isEmpty()) { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); for (Bookmark bookmark : bookmarkList) { - String link = bookmark.getLink(); - link = link.replace("'", "\\'"); + request.setAttribute("bookmark", bookmark); + request.setAttribute("sdf", sdf); %> - <div class="bookmark"> - <div class="bookmarkhead clearfix"> - <a href="<%=url + bookmark.getAlias()%>" title="<%=url + bookmark.getAlias()%>" target="_blank"> - <%=bookmark.getAlias()%> - </a> - <span> (<%=sdf.format(bookmark.getDate())%>)</span> - <a class="edit" href="bow?action=editBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" onclick="return modify('<%=bookmark.getDescription()%>', '<%=bookmark.getAlias()%>', '<%=BookmarkActions.getBookmarkTagsString(bookmark)%>', '<%=link%>', 'bow?action=modifyBookmark&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>&bookmarkId=<%=bookmark.getWikittyId()%>', '<%=bookmark.getWikittyId()%>');"></a> - <a class="supprim" href="bow?action=removeBookmark&bookmarkId=<%=bookmark.getWikittyId()%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>"></a> - </div> - <div class="bookmarkcontenu clearfix"> - <div class="screenshot"></div> - <div class="description"> - <h3>Description :</h3> - <p><a title ="<%=bookmark.getLink()%>" href="bow?action=addClick&bookmarkId=<%=bookmark.getWikittyId()%>" target="_blank"><%=bookmark.getDescription()%></a></p> - <p class="tags"><strong>Tags :</strong> - <% - Set<String> tagList = bookmark.getTags(); - if (tagList != null && !tagList.isEmpty()) { - for (String tag : tagList) { - if (formBookmarkId != null && formBookmarkId.equals(bookmark.getWikittyId())) { - %> - <a style="text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" > - <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> - </a> - <%} else {%> - <a name="<%=bookmark.getWikittyId()%>" style="display:none; text-decoration: none;" href="bow?action=deleteTag&bookmarkId=<%=bookmark.getWikittyId()%>&deleteTag=<%=tag%>&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" > - <img style="border:none;" SRC="img/delete.png" ALT="Delete tag" TITLE="Delete" /> - </a> - <%}%> - <a href="bow?action=search&searchLine=<%=tag%>" style="text-decoration: none;"><%=tag%></a> - <% - } - } - %> - </p> - </div> - <div class="click"><%=bookmark.getClick()%></div> - </div> - </div> + <jsp:include page="bookmark.jsp" flush="true"> + <jsp:param name="searchLine" value="<%=searchLine%>" /> + <jsp:param name="fullTextLine" value="<%=fullText%>" /> + </jsp:include> <% } } else { @@ -149,23 +114,9 @@ <li><a href="bow?action=generateToken&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>">Regenerate permanent token</a></li> </ul> <div id="nuage"> - <% if (bookmarkActions != null) { - List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud(); - int count = 0; - for (FacetTopic tag : tagCloud) { - int value = tag.getCount(); - String tagName = tag.getTopicName(); - int font = bookmarkActions.getFont(value); - %> - <a href="bow?action=search&addTag=<%=tagName%>&searchLine=<%=searchLine%>" title="<%=value%> results" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a> - <% - ++count; - if (count >= nbTags) { - break; - } - } - } - %> + <jsp:include page="tagsCloud.jsp" flush="true"> + <jsp:param name="searchLine" value="<%=searchLine%>" /> + </jsp:include> </div> <div id="recherche"> <h2>Research</h2> @@ -189,7 +140,7 @@ <h2>Import Bookmarks</h2> <form method="post" action="bow?action=importBookmarks&searchLine=<%=searchLine%>&fullTextLine=<%=fullText%>" enctype="multipart/form-data"> <div class="input"> - <input type="file" name="upfile" /> + <input type="file" name="upfile" size="15%"/> <br/> <button type="submit">Import</button> </div> Modified: trunk/src/main/webapp/css/bookmark.css =================================================================== --- trunk/src/main/webapp/css/bookmark.css 2010-06-08 15:12:08 UTC (rev 69) +++ trunk/src/main/webapp/css/bookmark.css 2010-06-09 09:48:30 UTC (rev 70) @@ -7,9 +7,9 @@ /*.clearfix { height:1%; -}*/ +} -.clearfix:after { +*/.clearfix:after { content:"."; height:0; line-height:0; @@ -165,10 +165,10 @@ text-decoration:underline; } -#colonneD #add, #colonneD #nuage, #colonneD #recherche, -#colonneD #import{ +#colonneD #import, +#colonneD #add{ padding: 10px 20px; border-bottom:2px solid #9edcf8; } @@ -211,7 +211,7 @@ height:100px; } -#colonneD #import{ +#colonneD #add{ border-bottom:none; } @@ -259,9 +259,7 @@ font-size:14px; line-height:32px; padding-left:40px; - background:url(/bow/img/ptit-livre.jpg) no-repeat; height:32px; - display:block; text-decoration:none; } Added: trunk/src/main/webapp/tagsCloud.jsp =================================================================== --- trunk/src/main/webapp/tagsCloud.jsp (rev 0) +++ trunk/src/main/webapp/tagsCloud.jsp 2010-06-09 09:48:30 UTC (rev 70) @@ -0,0 +1,29 @@ +<%@page import="org.chorem.bow.BookmarkActions" %> +<%@page import="java.util.List" %> +<%@page import="org.nuiton.wikitty.FacetTopic" %> + +<% + BookmarkActions bookmarkActions = (BookmarkActions) request.getAttribute("bookmarkActions"); + int nbTags = (Integer) request.getAttribute("nbTags"); + String search = ""; + String searchLine = request.getParameter("searchLine"); + if (searchLine != null) { + search += "&searchLine=" + searchLine; + } + if (bookmarkActions != null) { + List<FacetTopic> tagCloud = bookmarkActions.getTagsCloud(); + int count = 0; + for (FacetTopic tag : tagCloud) { + int value = tag.getCount(); + String tagName = tag.getTopicName(); + int font = bookmarkActions.getFont(value); +%> +<a href="bow?action=search&addTag=<%=tagName%><%=search%>" title="<%=value%> results" class="tag" style="font-size: <%=font%>px;"><%=tagName%></a> +<% + ++count; + if (count >= nbTags) { + break; + } + } + } +%> \ No newline at end of file
participants (1)
-
bbrossaudï¼ users.chorem.org