diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 73d60c9c8f..119e845c4e 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -170,6 +170,12 @@ public class Functions { return null; } + public static String getCookie(HttpServletRequest req,String name, String defaultValue) { + Cookie c = getCookie(req, name); + if(c==null || c.getValue()==null) return defaultValue; + return c.getValue(); + } + /** * Creates a sub map by using the given range (both ends inclusive). */ diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index f450c4fc70..fc05ab8f4c 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -30,6 +30,7 @@ import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import javax.servlet.http.Cookie; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; @@ -1045,6 +1046,14 @@ public final class Hudson extends JobCollection implements Node { req.getView(this,"_script.jelly").forward(req,rsp); } + /** + * Changes the icon size by changing the cookie + */ + public void doIconSize( StaplerRequest req, StaplerResponse rsp ) throws IOException { + rsp.addCookie(new Cookie("iconSize",req.getQueryString())); + rsp.sendRedirect2("."); + } + public void doFingerprintCleanup( StaplerRequest req, StaplerResponse rsp ) throws IOException { FingerprintCleanupThread.invoke(); rsp.setStatus(HttpServletResponse.SC_OK); diff --git a/core/src/main/resources/lib/hudson/projectView.jelly b/core/src/main/resources/lib/hudson/projectView.jelly index b5f0f98b35..fb58223b2e 100644 --- a/core/src/main/resources/lib/hudson/projectView.jelly +++ b/core/src/main/resources/lib/hudson/projectView.jelly @@ -3,6 +3,14 @@ <%@ attribute name="showViewTabs" required="true" type="java.lang.Boolean" %> --> + + + +
@@ -38,7 +46,7 @@ - + @@ -86,14 +94,39 @@ - + + - + + + + + + + + ${title} + + + ${title} + + + + + + + +
Icon: + + + + + +
\ No newline at end of file