diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index 3ecd32707012c63838a2b6e265699c0b60d5a603..1718f240cb6131757e9af6a45c4db7005b79d5da 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -23,6 +23,7 @@ import hudson.remoting.VirtualChannel; import hudson.scm.CVSSCM; import hudson.scm.SCM; import hudson.scm.SCMS; +import hudson.scm.SCMDescriptor; import hudson.tasks.BuildStep; import hudson.tasks.BuildWrapper; import hudson.tasks.BuildWrappers; @@ -921,7 +922,7 @@ public final class Hudson extends View implements ItemGroup, Node for( Descriptor d : BuildWrappers.WRAPPERS ) result &= d.configure(req); - for( Descriptor scmd : SCMS.SCMS ) + for( SCMDescriptor scmd : SCMS.SCMS ) result &= scmd.configure(req); for( TriggerDescriptor d : Triggers.TRIGGERS ) diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index 4c8d6030107f532d62bee5fa14e079fd09502986..0dc37333fd00c46153014a9217ad28cfa4d3bfa3 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -443,34 +443,31 @@ public abstract class Job, RunT extends Run, RunT extends Run< super.doConfigSubmit(req,rsp); // make sure to reload to reflect this config change. nextUpdate = 0; + save(); } diff --git a/core/src/main/java/hudson/scm/CVSChangeLogSet.java b/core/src/main/java/hudson/scm/CVSChangeLogSet.java index 616863ba36d9a14992f329d2cf21b055ab233eac..da64520b8ae173be188e6bb425b562a9b1bbf479 100644 --- a/core/src/main/java/hudson/scm/CVSChangeLogSet.java +++ b/core/src/main/java/hudson/scm/CVSChangeLogSet.java @@ -185,10 +185,23 @@ public final class CVSChangeLogSet extends ChangeLogSet { private String prevrevision; private boolean dead; + /** + * Gets the full file name in the CVS repository, like + * "/foo/bar/zot.c" + */ public String getName() { return name; } + /** + * Gets just the last component of the path, like "zot.c" + */ + public String getSimpleName() { + int idx = name.lastIndexOf('/'); + if(idx>0) return name.substring(idx+1); + return name; + } + public void setName(String name) { this.name = name; } @@ -239,7 +252,7 @@ public final class CVSChangeLogSet extends ChangeLogSet { } public Revision(String s) { - String[] tokens = s.split("."); + String[] tokens = s.split("\\."); numbers = new int[tokens.length]; for( int i=0; i { /** * Returns a new {@link Revision} that represents the previous revision. * + * For example, "1.5"->"1.4", "1.5.2.13"->"1.5.2.12", "1.5.2.1"->"1.5" + * * @return * null if there's no previous version, meaning this is "1.1" */ diff --git a/core/src/main/java/hudson/scm/CVSRepositoryBrowser.java b/core/src/main/java/hudson/scm/CVSRepositoryBrowser.java new file mode 100644 index 0000000000000000000000000000000000000000..6b3c83dc1e30bbbbefdb9bdacbbef8d702b06ff9 --- /dev/null +++ b/core/src/main/java/hudson/scm/CVSRepositoryBrowser.java @@ -0,0 +1,29 @@ +package hudson.scm; + +import java.net.URL; +import java.io.IOException; + +/** + * {@link RepositoryBrowser} for CVS. + * + * @author Kohsuke Kawaguchi + */ +public abstract class CVSRepositoryBrowser extends RepositoryBrowser { + /** + * Determines the link to the diff between the version + * in the {@link CVSChangeLogSet.File} to its previous version. + * + * @return + * null if the browser doesn't have any URL for diff. + */ + public abstract URL getDiffLink(CVSChangeLogSet.File file) throws IOException; + + /** + * Determines the link to a single file under CVS. + * This page should display all the past revisions of this file, etc. + * + * @return + * null if the browser doesn't have any suitable URL. + */ + public abstract URL getFileLink(CVSChangeLogSet.File file) throws IOException; +} diff --git a/core/src/main/java/hudson/scm/CVSSCM.java b/core/src/main/java/hudson/scm/CVSSCM.java index 55e36ff4ca09919e059dca005a7513e4fea13f5f..55e65e69aebb071bc02c8ee1d339839f235fd957 100644 --- a/core/src/main/java/hudson/scm/CVSSCM.java +++ b/core/src/main/java/hudson/scm/CVSSCM.java @@ -11,7 +11,6 @@ import hudson.model.AbstractModelObject; import hudson.model.AbstractProject; import hudson.model.Action; import hudson.model.BuildListener; -import hudson.model.Descriptor; import hudson.model.Hudson; import hudson.model.Job; import hudson.model.LargeText; @@ -108,14 +107,23 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { */ private boolean flatten; + private CVSRepositoryBrowser repositoryBrowser; - public CVSSCM(String cvsroot, String module,String branch,String cvsRsh,boolean canUseUpdate, boolean flatten) { + /** + * @stapler-constructor + */ + public CVSSCM(String cvsroot, String module,String branch,String cvsRsh,boolean canUseUpdate, boolean legacy) { this.cvsroot = cvsroot; this.module = module.trim(); this.branch = nullify(branch); this.cvsRsh = nullify(cvsRsh); this.canUseUpdate = canUseUpdate; - this.flatten = flatten && module.indexOf(' ')==-1; + this.flatten = !legacy && module.indexOf(' ')==-1; + } + + @Override + public CVSRepositoryBrowser getBrowser() { + return repositoryBrowser; } private String compression() { @@ -697,7 +705,7 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { env.put("CVS_PASSFILE",cvspass); } - public static final class DescriptorImpl extends Descriptor implements ModelObject { + public static final class DescriptorImpl extends SCMDescriptor implements ModelObject { static final DescriptorImpl DESCRIPTOR = new DescriptorImpl(); /** @@ -710,18 +718,17 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { */ private String cvsExe; - /** - * Copy-on-write. - */ - private volatile Map browsers = new HashMap(); + // compatibility only + private transient Map browsers; + // compatibility only class RepositoryBrowser { String diffURL; String browseURL; } DescriptorImpl() { - super(CVSSCM.class); + super(CVSSCM.class,CVSRepositoryBrowser.class); load(); } @@ -733,15 +740,10 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { return "CVS"; } - public SCM newInstance(StaplerRequest req) { - return new CVSSCM( - req.getParameter("cvs_root"), - req.getParameter("cvs_module"), - req.getParameter("cvs_branch"), - req.getParameter("cvs_rsh"), - req.getParameter("cvs_use_update")!=null, - req.getParameter("cvs_legacy")==null - ); + public SCM newInstance(StaplerRequest req) throws FormException { + CVSSCM scm = req.bindParameters(CVSSCM.class, "cvs."); + scm.repositoryBrowser = RepositoryBrowsers.createInstance(CVSRepositoryBrowser.class,req,"cvs.browser"); + return scm; } public String getCvspassFile() { @@ -761,35 +763,10 @@ public class CVSSCM extends AbstractCVSFamilySCM implements Serializable { save(); } - /** - * Gets the URL that shows the diff. - */ - public String getDiffURL(String cvsRoot, String pathName, String oldRev, String newRev) { - RepositoryBrowser b = browsers.get(cvsRoot); - if(b==null) return null; - return b.diffURL.replaceAll("%%P",pathName).replace("%%r",oldRev).replace("%%R",newRev); - - } - public boolean configure( StaplerRequest req ) { cvsPassFile = fixEmpty(req.getParameter("cvs_cvspass").trim()); cvsExe = fixEmpty(req.getParameter("cvs_exe").trim()); - Map browsers = new HashMap(); - int i=0; - while(true) { - String root = req.getParameter("cvs_repobrowser_cvsroot" + i); - if(root==null) break; - - RepositoryBrowser rb = new RepositoryBrowser(); - rb.browseURL = req.getParameter("cvs_repobrowser"+i); - rb.diffURL = req.getParameter("cvs_repobrowser_diff"+i); - browsers.put(root,rb); - - i++; - } - this.browsers = browsers; - save(); return true; diff --git a/core/src/main/java/hudson/scm/NullSCM.java b/core/src/main/java/hudson/scm/NullSCM.java index 42e9a52c654b629585d3f62753d56a6092c42abc..0dd2a9e10e500a4b8973994c2d1c3531395c3e69 100644 --- a/core/src/main/java/hudson/scm/NullSCM.java +++ b/core/src/main/java/hudson/scm/NullSCM.java @@ -5,7 +5,6 @@ import hudson.Launcher; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; import hudson.model.BuildListener; -import hudson.model.Descriptor; import hudson.model.TaskListener; import org.kohsuke.stapler.StaplerRequest; @@ -32,7 +31,7 @@ public class NullSCM extends SCM { return true; } - public Descriptor getDescriptor() { + public SCMDescriptor getDescriptor() { return DESCRIPTOR; } @@ -48,7 +47,7 @@ public class NullSCM extends SCM { return new NullChangeLogParser(); } - static final Descriptor DESCRIPTOR = new Descriptor(NullSCM.class) { + static final SCMDescriptor DESCRIPTOR = new SCMDescriptor(NullSCM.class,null) { public String getDisplayName() { return "None"; } diff --git a/core/src/main/java/hudson/scm/RepositoryBrowser.java b/core/src/main/java/hudson/scm/RepositoryBrowser.java new file mode 100644 index 0000000000000000000000000000000000000000..3ada55f7188b05543d9911cb938c6def8f5894c3 --- /dev/null +++ b/core/src/main/java/hudson/scm/RepositoryBrowser.java @@ -0,0 +1,35 @@ +package hudson.scm; + +import hudson.ExtensionPoint; +import hudson.model.Describable; + +import java.io.IOException; +import java.net.URL; + +/** + * Connects Hudson to repository browsers like ViewCVS or FishEye, + * so that Hudson can generate links to them. + * + *

+ * {@link RepositoryBrowser} instance is normally created as + * a result of job configuration, and stores immutable + * configuration information (such as the URL of the FishEye site). + * + *

+ * {@link RepositoryBrowser} is persisted with {@link SCM}. + * + * @author Kohsuke Kawaguchi + * @since 1.89 + * @see RepositoryBrowsers + */ +public abstract class RepositoryBrowser implements ExtensionPoint, Describable { + /** + * Determines the link to the given change set. + * + * @return + * null if this repository browser doesn't have any meaningful + * URL for a change set (for example, ViewCVS doesn't have + * any page for a change set, whereas FishEye does.) + */ + public abstract URL getChangeSetLink(ChangeLogSet.Entry changeSet) throws IOException; +} diff --git a/core/src/main/java/hudson/scm/RepositoryBrowsers.java b/core/src/main/java/hudson/scm/RepositoryBrowsers.java new file mode 100644 index 0000000000000000000000000000000000000000..eb449ae23b8bce6b2f93f8041d48d286d8fa6db3 --- /dev/null +++ b/core/src/main/java/hudson/scm/RepositoryBrowsers.java @@ -0,0 +1,49 @@ +package hudson.scm; + +import hudson.model.Descriptor; +import hudson.model.Descriptor.FormException; +import hudson.scm.browsers.ViewCVS; + +import java.util.Arrays; +import java.util.List; +import java.util.ArrayList; + +import org.kohsuke.stapler.StaplerRequest; + +/** + * List of all installed {@link RepositoryBrowsers}. + * + * @author Kohsuke Kawaguchi + */ +public class RepositoryBrowsers { + /** + * List of all installed {@link RepositoryBrowsers}. + */ + public static final List> LIST = Arrays.asList( + ViewCVS.DESCRIPTOR + ); + + /** + * Only returns those {@link RepositoryBrowser} descriptors that extend from the given type. + */ + public static List> filter(Class t) { + List> r = new ArrayList>(); + for (Descriptor d : LIST) + if(t.isAssignableFrom(d.clazz)) + r.add(d); + return r; + } + + /** + * Creates an instance of {@link RepositoryBrowser} from a form submission. + */ + public static + T createInstance(Class type, StaplerRequest req, String fieldName) throws FormException { + List> list = filter(type); + String value = req.getParameter(fieldName); + if(value==null || value.equals("auto")) + return null; + + return type.cast(list.get(Integer.parseInt(value)).newInstance(req)); + } +} diff --git a/core/src/main/java/hudson/scm/SCM.java b/core/src/main/java/hudson/scm/SCM.java index 4af76941d4552c6a5e776f9d121e1de0f6a301d1..13ce93ec106f43d933f6a8c2c610bba3db30cbe2 100644 --- a/core/src/main/java/hudson/scm/SCM.java +++ b/core/src/main/java/hudson/scm/SCM.java @@ -10,8 +10,8 @@ import hudson.model.Describable; import hudson.model.TaskListener; import java.io.File; -import java.io.IOException; import java.io.FileWriter; +import java.io.IOException; import java.util.Map; /** @@ -25,6 +25,18 @@ import java.util.Map; */ public abstract class SCM implements Describable, ExtensionPoint { + /** + * Returns the {@link RepositoryBrowser} for files + * controlled by this {@link SCM}. + * + * @return + * null to indicate that there's no configured browser + * for this SCM instance. + */ + public RepositoryBrowser getBrowser() { + return null; + } + /** * Checks if there has been any changes to this module in the repository. * @@ -103,6 +115,8 @@ public abstract class SCM implements Describable, ExtensionPoint { */ public abstract ChangeLogParser createChangeLogParser(); + public abstract SCMDescriptor getDescriptor(); + protected final boolean createEmptyChangeLog(File changelogFile, BuildListener listener, String rootTag) { try { FileWriter w = new FileWriter(changelogFile); diff --git a/core/src/main/java/hudson/scm/SCMDescriptor.java b/core/src/main/java/hudson/scm/SCMDescriptor.java new file mode 100644 index 0000000000000000000000000000000000000000..d407cb558496132fdb83824461497be0dc3c0f65 --- /dev/null +++ b/core/src/main/java/hudson/scm/SCMDescriptor.java @@ -0,0 +1,36 @@ +package hudson.scm; + +import hudson.model.Descriptor; + +import java.util.List; +import java.util.Collections; + +/** + * {@link Descriptor} for {@link SCM}. + * + * @author Kohsuke Kawaguchi + */ +public abstract class SCMDescriptor extends Descriptor { + /** + * If this SCM has corresponding {@link RepositoryBrowser}, + * that type. Otherwise this SCM will not have any repository browser. + */ + public final Class repositoryBrowser; + + protected SCMDescriptor(Class clazz, Class repositoryBrowser) { + super(clazz); + this.repositoryBrowser = repositoryBrowser; + } + + /** + * Returns the list of {@link RepositoryBrowser} {@link Descriptor} + * that can be used with this SCM. + * + * @return + * can be empty but never null. + */ + public List> getBrowserDescriptors() { + if(repositoryBrowser==null) return Collections.emptyList(); + return RepositoryBrowsers.filter(repositoryBrowser); + } +} diff --git a/core/src/main/java/hudson/scm/SCMS.java b/core/src/main/java/hudson/scm/SCMS.java index 0b488bafc3f7f3d96cfb353590418e25f2579098..8fce96bfb6dd96a61c38f017be98e4737cce2995 100644 --- a/core/src/main/java/hudson/scm/SCMS.java +++ b/core/src/main/java/hudson/scm/SCMS.java @@ -17,7 +17,7 @@ public class SCMS { * List of all installed SCMs. */ @SuppressWarnings("unchecked") // generic array creation - public static final List> SCMS = + public static final List SCMS = Descriptor.toList( NullSCM.DESCRIPTOR, CVSSCM.DescriptorImpl.DESCRIPTOR, diff --git a/core/src/main/java/hudson/scm/SubversionChangeLogSet.java b/core/src/main/java/hudson/scm/SubversionChangeLogSet.java index 2bc05c50d07298c73e9d0dc542da5f91409767d9..a089c407284b695dfee5d8cde048282f34134b13 100644 --- a/core/src/main/java/hudson/scm/SubversionChangeLogSet.java +++ b/core/src/main/java/hudson/scm/SubversionChangeLogSet.java @@ -110,6 +110,7 @@ public final class SubversionChangeLogSet extends ChangeLogSet { } public void addPath( Path p ) { + p.entry = this; paths.add(p); } @@ -118,10 +119,18 @@ public final class SubversionChangeLogSet extends ChangeLogSet { } } + /** + * A file in a commit. + */ public static class Path { + private LogEntry entry; private char action; private String value; + public LogEntry getLogEntry() { + return entry; + } + public void setAction(String action) { this.action = action.charAt(0); } diff --git a/core/src/main/java/hudson/scm/SubversionRepositoryBrowser.java b/core/src/main/java/hudson/scm/SubversionRepositoryBrowser.java new file mode 100644 index 0000000000000000000000000000000000000000..dc12bf903050032e56d056d64a93323b358d2237 --- /dev/null +++ b/core/src/main/java/hudson/scm/SubversionRepositoryBrowser.java @@ -0,0 +1,29 @@ +package hudson.scm; + +import java.net.URL; +import java.io.IOException; + +/** + * {@link RepositoryBrowser} for Subversion. + * + * @author Kohsuke Kawaguchi + */ +public abstract class SubversionRepositoryBrowser extends RepositoryBrowser { + /** + * Determines the link to the diff between the version + * in the specified revision of {@link SubversionChangeLogSet.Path} to its previous version. + * + * @return + * null if the browser doesn't have any URL for diff. + */ + public abstract URL getDiffLink(SubversionChangeLogSet.Path path) throws IOException; + + /** + * Determines the link to a single file under Subversion. + * This page should display all the past revisions of this file, etc. + * + * @return + * null if the browser doesn't have any suitable URL. + */ + public abstract URL getFileLink(SubversionChangeLogSet.Path path) throws IOException; +} diff --git a/core/src/main/java/hudson/scm/SubversionSCM.java b/core/src/main/java/hudson/scm/SubversionSCM.java index 33f66a22a12fe350be31d32d1cc4dc4719bd752c..5e498e5d0461397a1517259c4fd6e0e459a2887f 100644 --- a/core/src/main/java/hudson/scm/SubversionSCM.java +++ b/core/src/main/java/hudson/scm/SubversionSCM.java @@ -8,7 +8,6 @@ import static hudson.Util.fixNull; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; import hudson.model.BuildListener; -import hudson.model.Descriptor; import hudson.model.Hudson; import hudson.model.TaskListener; import hudson.remoting.Channel; @@ -62,8 +61,8 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.StringTokenizer; -import java.util.logging.Logger; import java.util.logging.Level; +import java.util.logging.Logger; /** * Subversion. @@ -476,7 +475,7 @@ public class SubversionSCM extends SCM implements Serializable { return tokens[tokens.length-1]; // return the last token } - public static final class DescriptorImpl extends Descriptor { + public static final class DescriptorImpl extends SCMDescriptor { public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl(); /** @@ -559,7 +558,7 @@ public class SubversionSCM extends SCM implements Serializable { } private DescriptorImpl() { - super(SubversionSCM.class); + super(SubversionSCM.class,null); load(); } diff --git a/core/src/main/java/hudson/scm/browsers/ViewCVS.java b/core/src/main/java/hudson/scm/browsers/ViewCVS.java new file mode 100644 index 0000000000000000000000000000000000000000..e74d9b9bd9818af9bead6dc7df48a94bf28012ce --- /dev/null +++ b/core/src/main/java/hudson/scm/browsers/ViewCVS.java @@ -0,0 +1,95 @@ +package hudson.scm.browsers; + +import hudson.model.Descriptor; +import hudson.scm.CVSChangeLogSet.File; +import hudson.scm.CVSChangeLogSet.Revision; +import hudson.scm.ChangeLogSet.Entry; +import hudson.scm.RepositoryBrowser; +import hudson.scm.CVSRepositoryBrowser; +import org.kohsuke.stapler.StaplerRequest; + +import java.io.IOException; +import java.net.URL; + +/** + * {@link RepositoryBrowser} for + * @author Kohsuke Kawaguchi + */ +public final class ViewCVS extends CVSRepositoryBrowser { + /** + * The URL of the top of the site. + * + * Normalized to ends with '/', like http://isscvs.cern.ch/cgi-bin/viewcvs-all.cgi/ + * It may contain a query parameter like ?cvsroot=foobar, so relative URL + * construction needs to be done with care. + */ + public final URL url; + + /** + * @stapler-constructor + */ + public ViewCVS(URL url) { + this.url = url; + } + + public URL getFileLink(File file) throws IOException { + return new URL(url,trimHeadSlash(file.getName())+param()); + } + + public URL getDiffLink(File file) throws IOException { + Revision r = new Revision(file.getRevision()); + Revision p = r.getPrevious(); + if(p==null) return null; + + return new URL(getFileLink(file), file.getSimpleName()+".diff"+param().add("r1="+p).add("r2="+r)); + } + + /** + * No changeset support in ViewCVS. + */ + public URL getChangeSetLink(Entry changeSet) throws IOException { + return null; + } + + private String trimHeadSlash(String s) { + if(s.startsWith("/")) return s.substring(1); + return s; + } + + private QueryBuilder param() { + return new QueryBuilder(url.getQuery()); + } + + private static final class QueryBuilder { + private final StringBuilder buf = new StringBuilder(); + + public QueryBuilder(String s) { + add(s); + } + + private QueryBuilder add(String s) { + if(buf.length()==0) buf.append('?'); + else buf.append('&'); + buf.append(s); + return this; + } + + public String toString() { + return buf.toString(); + } + } + + public Descriptor getDescriptor() { + return DESCRIPTOR; + } + + public static final Descriptor DESCRIPTOR = new Descriptor(ViewCVS.class) { + public String getDisplayName() { + return "ViewCVS"; + } + + public RepositoryBrowser newInstance(StaplerRequest req) throws FormException { + return req.bindParameters(ViewCVS.class,"viewcvs."); + } + }; +} diff --git a/core/src/main/resources/hudson/scm/CVSChangeLogSet/index.jelly b/core/src/main/resources/hudson/scm/CVSChangeLogSet/index.jelly index 809f6e6e7223a5c0687836f98ade5965890b66ae..7eeb25f87ac54babbdd2516004d0b969e39f6aef 100644 --- a/core/src/main/resources/hudson/scm/CVSChangeLogSet/index.jelly +++ b/core/src/main/resources/hudson/scm/CVSChangeLogSet/index.jelly @@ -8,6 +8,9 @@

  • + + + @@ -16,6 +19,11 @@
    ${cs.author}:
    ${cs.msgAnnotated} + + + + (${browser.descriptor.displayName}) +
    @@ -23,8 +31,11 @@ - - + + diff --git a/core/src/main/resources/hudson/scm/CVSSCM/config.jelly b/core/src/main/resources/hudson/scm/CVSSCM/config.jelly index 0965622cd449c990e18de2517f842d1f712b55c0..617f11c6bd1afc695e82442ddec5fb99249106d9 100644 --- a/core/src/main/resources/hudson/scm/CVSSCM/config.jelly +++ b/core/src/main/resources/hudson/scm/CVSSCM/config.jelly @@ -1,24 +1,40 @@ - + - + - + - + - + (run CVS in a way compatible with older versions of Hudson <1.21) + + + + + + + + +
    ${f.revision}${f.name} + ${f.revision} + + ${f.name}
    + + +
    + + + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/scm/browsers/ViewCVS/config.jelly b/core/src/main/resources/hudson/scm/browsers/ViewCVS/config.jelly new file mode 100644 index 0000000000000000000000000000000000000000..a10b79b9c8cd6020962eafee6f366369ea0acaf6 --- /dev/null +++ b/core/src/main/resources/hudson/scm/browsers/ViewCVS/config.jelly @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/src/main/resources/lib/form/dropdownList.jelly b/core/src/main/resources/lib/form/dropdownList.jelly new file mode 100644 index 0000000000000000000000000000000000000000..8bf791461904ea3ca7ae5d89c7f0fdfffa9b7f9f --- /dev/null +++ b/core/src/main/resources/lib/form/dropdownList.jelly @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/main/resources/lib/form/dropdownListBlock.jelly b/core/src/main/resources/lib/form/dropdownListBlock.jelly new file mode 100644 index 0000000000000000000000000000000000000000..a51c9137507745bf7afd5104920fb9f2e4dee34e --- /dev/null +++ b/core/src/main/resources/lib/form/dropdownListBlock.jelly @@ -0,0 +1,16 @@ + + + + ${dropdownItems.add(attrs)} + ${attrs.put('body',context.getVariable('org.apache.commons.jelly.body'))} + + diff --git a/core/src/main/resources/lib/form/entry.jelly b/core/src/main/resources/lib/form/entry.jelly index 0e2297341d2a5485318aafcaed9aacb91bcf0461..b148e6bb01bdc2ba47a9280a281df2b5af2261d1 100644 --- a/core/src/main/resources/lib/form/entry.jelly +++ b/core/src/main/resources/lib/form/entry.jelly @@ -11,11 +11,11 @@ ${attrs.title} - + - + Help for feature: ${title} diff --git a/core/src/main/resources/lib/form/nested.jelly b/core/src/main/resources/lib/form/nested.jelly new file mode 100644 index 0000000000000000000000000000000000000000..69203403ed2eb8605ae468f64453cb5a77b633d2 --- /dev/null +++ b/core/src/main/resources/lib/form/nested.jelly @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/war/resources/css/style.css b/war/resources/css/style.css index 6109a7617725492758cb089f637054fa57faaef9..df1fa8fe32c0050cb22976fa12c813773e227fa1 100644 --- a/war/resources/css/style.css +++ b/war/resources/css/style.css @@ -160,12 +160,19 @@ pre.console { overflow: auto; } +.setting-leftspace { + width: 2em; +} + .setting-name { white-space: nowrap; } -.setting-leftspace { - width: 2em; +.setting-main { + width: 100%; /* try to make this column as big as possible. */ +} +.setting-help { + width: 16px; } .setting-input { @@ -316,6 +323,7 @@ th.pane { border: 1px solid #ccb; background: #eed; padding: 4px; + white-space: normal; } .error { diff --git a/war/resources/scripts/hudson-behavior.js b/war/resources/scripts/hudson-behavior.js index ab66f0aff175be134abcbc01a3dff6b2da7504b1..4b14b428c4be641ec9e1edd6f0fedec828b53c72 100644 --- a/war/resources/scripts/hudson-behavior.js +++ b/war/resources/scripts/hudson-behavior.js @@ -386,3 +386,17 @@ Form.findMatchingInput = function(base, name) { return null; // not found } +// used witih and to control visibility +function updateDropDownList(sel) { + // alert('Yay! '+sel.value+' '+sel.selectedIndex); + for (var i = 0; i < sel.forms.length; i++) { + var show = sel.selectedIndex == i; + var f = sel.forms[i]; + var td = f.start; + while (true) { + td.style.display = (show ? "" : "none"); + if (td == f.end) break; + td = td.nextSibling; + } + } +} \ No newline at end of file