diff --git a/core/src/main/java/hudson/AboutJenkins.java b/core/src/main/java/hudson/AboutJenkins.java index 46c91f796064..cf51bf96f9a9 100644 --- a/core/src/main/java/hudson/AboutJenkins.java +++ b/core/src/main/java/hudson/AboutJenkins.java @@ -18,7 +18,7 @@ public class AboutJenkins extends ManagementLink { @Override public String getIconFileName() { - return "help.svg"; + return "symbol-help-circle"; } @Override diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 5c690f7637f1..b9d66b694bb9 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -161,6 +161,7 @@ import org.apache.commons.jexl.parser.ASTSizeFunction; import org.apache.commons.jexl.util.Introspector; import org.apache.commons.lang.StringUtils; +import org.jenkins.ui.icon.Icon; import org.jenkins.ui.icon.IconSet; import org.jvnet.tiger_types.Types; import org.kohsuke.accmod.Restricted; @@ -2290,6 +2291,68 @@ public static boolean isContextMenuVisible(Action a) { } } + @Restricted(NoExternalUse.class) + public static Icon tryGetIcon(String iconGuess) { + // Jenkins Symbols don't have metadata so return null + if (iconGuess == null || iconGuess.startsWith("symbol-")) { + return null; + } + + StaplerRequest currentRequest = Stapler.getCurrentRequest(); + currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); + Icon iconMetadata = IconSet.icons.getIconByClassSpec(iconGuess); + + if (iconMetadata == null) { + // Icon could be provided as a simple iconFileName e.g. "settings.png" + iconMetadata = IconSet.icons.getIconByClassSpec(IconSet.toNormalizedIconNameClass(iconGuess) + " icon-md"); + } + + if (iconMetadata == null) { + // Icon could be provided as an absolute iconFileName e.g. "/plugin/foo/abc.png" + iconMetadata = IconSet.icons.getIconByUrl(iconGuess); + } + + return iconMetadata; + } + + @Restricted(NoExternalUse.class) + public static String tryGetIconPath(String iconGuess, JellyContext context) { + if (iconGuess == null) { + return null; + } + + if (iconGuess.startsWith("symbol-")) { + return iconGuess; + } + + StaplerRequest currentRequest = Stapler.getCurrentRequest(); + currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); + String rootURL = currentRequest.getContextPath(); + Icon iconMetadata = tryGetIcon(iconGuess); + String iconSource = null; + + if (iconMetadata != null) { + iconSource = iconMetadata.getQualifiedUrl(context); + } + + if (iconMetadata == null) { + if (!iconGuess.startsWith("/")) { + iconGuess = "/" + iconGuess; + } + + iconSource = rootURL + (iconGuess.startsWith("/images/") || iconGuess.startsWith("/plugin/") ? getResourcePath() : "") + iconGuess; + } + + if (iconMetadata != null && iconMetadata.getClassSpec() != null) { + String translatedIcon = IconSet.tryTranslateTangoIconToSymbol(iconMetadata.getClassSpec()); + if (translatedIcon != null) { + return translatedIcon; + } + } + + return iconSource; + } + @SuppressFBWarnings(value = "PREDICTABLE_RANDOM", justification = "True randomness isn't necessary for form item IDs") @Restricted(NoExternalUse.class) public static String generateItemId() { diff --git a/core/src/main/java/hudson/model/Action.java b/core/src/main/java/hudson/model/Action.java index 08addd77361e..17b21a2ca7c9 100644 --- a/core/src/main/java/hudson/model/Action.java +++ b/core/src/main/java/hudson/model/Action.java @@ -78,15 +78,18 @@ */ public interface Action extends ModelObject { /** - * Gets the file name of the icon. + * Gets the name of the icon. * * @return + * If the icon name is prefixed with "symbol-", a Jenkins Symbol + * will be used. + *

* If just a file name (like "abc.gif") is returned, it will be * interpreted as a file name inside {@code /images/24x24}. * This is useful for using one of the stock images. *

* If an absolute file name that starts from '/' is returned (like - * "/plugin/foo/abc.gif'), then it will be interpreted as a path + * "/plugin/foo/abc.gif"), then it will be interpreted as a path * from the context root of Jenkins. This is useful to pick up * image files from a plugin. *

@@ -94,6 +97,7 @@ public interface Action extends ModelObject { * but this can be used for actions that only contribute {@code floatBox.jelly} * and no task list item. The other case where this is useful is * to avoid showing links that require a privilege when the user is anonymous. + * @see Jenkins Symbols * @see Functions#isAnonymous() * @see Functions#getIconFilePath(Action) */ diff --git a/core/src/main/java/hudson/model/ManageJenkinsAction.java b/core/src/main/java/hudson/model/ManageJenkinsAction.java index caf33d077eca..605801c42e1d 100644 --- a/core/src/main/java/hudson/model/ManageJenkinsAction.java +++ b/core/src/main/java/hudson/model/ManageJenkinsAction.java @@ -38,7 +38,7 @@ public class ManageJenkinsAction implements RootAction { @Override public String getIconFileName() { if (Jenkins.get().hasAnyPermission(Jenkins.MANAGE, Jenkins.SYSTEM_READ)) - return "gear.png"; + return "symbol-settings"; else return null; } diff --git a/core/src/main/java/jenkins/management/ConfigureLink.java b/core/src/main/java/jenkins/management/ConfigureLink.java index 785e838a4ca0..5f34e75ec5c1 100644 --- a/core/src/main/java/jenkins/management/ConfigureLink.java +++ b/core/src/main/java/jenkins/management/ConfigureLink.java @@ -39,7 +39,7 @@ public class ConfigureLink extends ManagementLink { @Override public String getIconFileName() { - return "gear.svg"; + return "symbol-settings"; } @Override diff --git a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java index 7f2bddda2224..f6cae43f50e6 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java @@ -133,6 +133,18 @@ public ContextMenu add(String url, String icon, String text, boolean post, boole return this; } + /** @since TODO */ + public ContextMenu add(String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation) { + if (text != null && icon != null && url != null) { + MenuItem item = new MenuItem(url, icon, text); + item.iconXml = iconXml; + item.post = post; + item.requiresConfirmation = requiresConfirmation; + items.add(item); + } + return this; + } + /** * Add a header row (no icon, no URL, rendered in header style). * @@ -268,6 +280,11 @@ class MenuItem { @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler") public String icon; + /** + * Optional icon XML, if set it's used instead of @icon for the menu item + */ + private String iconXml; + /** * True to make a POST request rather than GET. * @since 1.504 @@ -300,6 +317,11 @@ class MenuItem { @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler") public ContextMenu subMenu; + @Exported + public String getIconXml() { + return iconXml; + } + public MenuItem(String url, String icon, String displayName) { withUrl(url).withIcon(icon).withDisplayName(displayName); } diff --git a/core/src/main/java/org/jenkins/ui/icon/IconSet.java b/core/src/main/java/org/jenkins/ui/icon/IconSet.java index 273964ea2cc7..21ae91c641cd 100644 --- a/core/src/main/java/org/jenkins/ui/icon/IconSet.java +++ b/core/src/main/java/org/jenkins/ui/icon/IconSet.java @@ -35,6 +35,8 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.jelly.JellyContext; import org.apache.commons.lang.StringUtils; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; /** * An icon set. @@ -45,7 +47,7 @@ public class IconSet { public static final IconSet icons = new IconSet(); - private static final Map IONICONS = new ConcurrentHashMap<>(); + private static final Map SYMBOLS = new ConcurrentHashMap<>(); private Map iconsByCSSSelector = new ConcurrentHashMap<>(); private Map iconsByUrl = new ConcurrentHashMap<>(); @@ -73,34 +75,40 @@ private static String prependTitleIfRequired(String icon, String title) { return icon; } - public static String getIonicon(String name, String title) { - if (IONICONS.containsKey(name)) { - String icon = IONICONS.get(name); - return prependTitleIfRequired(icon, title); + // for Jelly + @Restricted(NoExternalUse.class) + public static String getSymbol(String name, String title, String classes) { + if (SYMBOLS.containsKey(name)) { + String symbol = SYMBOLS.get(name); + symbol = symbol.replaceAll("(class=\")[^&]*?(\")", "$1$2"); + symbol = symbol.replaceAll(")[^&]*()", "$1$2"); - ionicon = ionicon.replaceAll(")[^&]*()", "$1$2"); + symbol = symbol.replaceAll("(class=\")[^&]*?(\")", "$1$2"); + symbol = symbol.replaceAll(" materialIcons = new HashMap<>(); - materialIcons.put("help", "svg-sprite-action-symbol.svg#ic_help_24px"); - for (Map.Entry size : sizes.entrySet()) { for (String image : images) { icons.addIcon(new Icon("icon-" + image + " " + size.getKey(), "svgs/" + image + ".svg", size.getValue())); } + } + } - for (Map.Entry imageEntry : materialIcons.entrySet()) { - icons.addIcon(new Icon( - "icon-" + imageEntry.getKey() + " " + size.getKey(), - "material-icons/" + imageEntry.getValue(), - size.getValue(), - IconFormat.EXTERNAL_SVG_SPRITE - ) - ); - } + /** + * This is a temporary function to replace Tango icons across Jenkins and plugins with + * appropriate Jenkins Symbols + * + * @param tangoIcon A tango icon in the format 'icon-* size-*', e.g. 'icon-gear icon-lg' + * @return a Jenkins Symbol (if one exists) otherwise null + */ + @Restricted(NoExternalUse.class) + public static String tryTranslateTangoIconToSymbol(String tangoIcon) { + if (tangoIcon != null) { + tangoIcon = tangoIcon.split(" ")[0]; } + + Map translations = new HashMap<>(); + translations.put("icon-clock", "symbol-play"); + translations.put("icon-edit-delete", "symbol-trash"); + translations.put("icon-gear", "symbol-settings"); + translations.put("icon-gear2", "symbol-settings"); + translations.put("icon-plugin", "symbol-plugins"); + + return translations.getOrDefault(tangoIcon, null); } } diff --git a/core/src/main/resources/hudson/PluginManager/available.jelly b/core/src/main/resources/hudson/PluginManager/available.jelly index e22f2f833cc2..019a606fe19e 100644 --- a/core/src/main/resources/hudson/PluginManager/available.jelly +++ b/core/src/main/resources/hudson/PluginManager/available.jelly @@ -39,7 +39,7 @@ THE SOFTWARE. value="${request.getParameter('filter')}" placeholder="${%Search}"/>

- +
diff --git a/core/src/main/resources/hudson/PluginManager/installed.jelly b/core/src/main/resources/hudson/PluginManager/installed.jelly index a2ca8a67ef02..e7be559785a8 100644 --- a/core/src/main/resources/hudson/PluginManager/installed.jelly +++ b/core/src/main/resources/hudson/PluginManager/installed.jelly @@ -39,7 +39,7 @@ THE SOFTWARE. value="${request.getParameter('filter')}" placeholder="${filtered == 'true' ? '%Search' : '%Filter'}"/>
- +
@@ -180,7 +180,7 @@ THE SOFTWARE.
diff --git a/core/src/main/resources/hudson/PluginManager/sidepanel.groovy b/core/src/main/resources/hudson/PluginManager/sidepanel.groovy index 728dda7e09fc..328452420adf 100644 --- a/core/src/main/resources/hudson/PluginManager/sidepanel.groovy +++ b/core/src/main/resources/hudson/PluginManager/sidepanel.groovy @@ -28,7 +28,7 @@ l.header() l.side_panel { l.tasks { l.task(icon:"icon-up icon-md", href:rootURL+'/', title:_("Back to Dashboard")) - l.task(icon:"icon-gear icon-md", href:"${rootURL}/manage", title:_("Manage Jenkins")) + l.task(icon:"symbol-settings", href:"${rootURL}/manage", title:_("Manage Jenkins")) if (!app.updateCenter.jobs.isEmpty()) { l.task(icon:"icon-plugin icon-md", href:"${rootURL}/updateCenter/", title:_("Update Center")) } diff --git a/core/src/main/resources/hudson/PluginManager/table.jelly b/core/src/main/resources/hudson/PluginManager/table.jelly index 9ae7349d4266..3657fac64ae9 100644 --- a/core/src/main/resources/hudson/PluginManager/table.jelly +++ b/core/src/main/resources/hudson/PluginManager/table.jelly @@ -46,7 +46,7 @@ THE SOFTWARE. value="${request.getParameter('filter')}" placeholder="${filtered == 'true' ? '%Search' : '%Filter'}"/>
- +
diff --git a/core/src/main/resources/hudson/logging/LogRecorder/sidepanel.jelly b/core/src/main/resources/hudson/logging/LogRecorder/sidepanel.jelly index e515b5b65776..35605d5a7cd7 100644 --- a/core/src/main/resources/hudson/logging/LogRecorder/sidepanel.jelly +++ b/core/src/main/resources/hudson/logging/LogRecorder/sidepanel.jelly @@ -33,9 +33,9 @@ THE SOFTWARE. - + - \ No newline at end of file + diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly b/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly index 30238f1fb53b..7d3ee4e022fb 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/index.jelly @@ -64,7 +64,7 @@ THE SOFTWARE. diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel.jelly b/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel.jelly index 3343b76f177a..1fe04c8eb476 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel.jelly +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/sidepanel.jelly @@ -31,14 +31,14 @@ THE SOFTWARE. - + - + diff --git a/core/src/main/resources/hudson/model/AbstractBuild/tasks.jelly b/core/src/main/resources/hudson/model/AbstractBuild/tasks.jelly index 5431e64918f9..f3a6157e79a3 100644 --- a/core/src/main/resources/hudson/model/AbstractBuild/tasks.jelly +++ b/core/src/main/resources/hudson/model/AbstractBuild/tasks.jelly @@ -31,5 +31,5 @@ THE SOFTWARE. - - \ No newline at end of file + + diff --git a/core/src/main/resources/hudson/model/ComputerSet/index.jelly b/core/src/main/resources/hudson/model/ComputerSet/index.jelly index 928da57f62f3..14b602b20eb0 100644 --- a/core/src/main/resources/hudson/model/ComputerSet/index.jelly +++ b/core/src/main/resources/hudson/model/ComputerSet/index.jelly @@ -85,7 +85,7 @@ THE SOFTWARE. diff --git a/core/src/main/resources/hudson/model/ComputerSet/sidepanel.jelly b/core/src/main/resources/hudson/model/ComputerSet/sidepanel.jelly index d26786989fa7..25aef0fb978b 100644 --- a/core/src/main/resources/hudson/model/ComputerSet/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/ComputerSet/sidepanel.jelly @@ -32,11 +32,11 @@ THE SOFTWARE. - + - + diff --git a/core/src/main/resources/hudson/model/Label/sidepanel.jelly b/core/src/main/resources/hudson/model/Label/sidepanel.jelly index 5b4608c846d6..123e50bb3d31 100644 --- a/core/src/main/resources/hudson/model/Label/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/Label/sidepanel.jelly @@ -34,10 +34,10 @@ THE SOFTWARE. - + - \ No newline at end of file + diff --git a/core/src/main/resources/hudson/model/UpdateCenter/sidepanel.jelly b/core/src/main/resources/hudson/model/UpdateCenter/sidepanel.jelly index 5f62d3458376..a3e3c7b87893 100644 --- a/core/src/main/resources/hudson/model/UpdateCenter/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/UpdateCenter/sidepanel.jelly @@ -31,7 +31,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/model/User/sidepanel.jelly b/core/src/main/resources/hudson/model/User/sidepanel.jelly index 40d91da48b7a..c2910e39bbd4 100644 --- a/core/src/main/resources/hudson/model/User/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/User/sidepanel.jelly @@ -34,7 +34,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly b/core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly index e61154061292..ef6d4bc68850 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/index.jelly @@ -43,11 +43,11 @@ THE SOFTWARE. - - + + - +
diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js b/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js index 880d302694f3..742edca86429 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js @@ -1,5 +1,6 @@ function display(data) { var p = document.getElementById('people'); + p.show(); var rootURL = document.head.getAttribute('data-rooturl'); for (var x = 0; data.length > x; x++) { var e = data[x]; @@ -19,7 +20,7 @@ function display(data) { var wrapper = document.createElement('div'); wrapper.className = 'jenkins-table__cell__button-wrapper'; d.className = 'jenkins-table__cell--tight jenkins-table__icon'; - var icon = document.getElementById('person-circle-outline') + var icon = document.getElementById('person-circle') wrapper.innerHTML = icon.children[0].outerHTML; d.appendChild(wrapper); r.appendChild(d); diff --git a/core/src/main/resources/hudson/model/View/sidepanel.jelly b/core/src/main/resources/hudson/model/View/sidepanel.jelly index a8d1b128ddf5..8b87279dc7e3 100644 --- a/core/src/main/resources/hudson/model/View/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/View/sidepanel.jelly @@ -54,7 +54,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly index c2bb1da166b3..281baae4ed81 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly @@ -63,7 +63,7 @@ THE SOFTWARE. @@ -71,7 +71,7 @@ THE SOFTWARE. diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/sidepanel.jelly b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/sidepanel.jelly index bff0f693ff32..0a04842c07c8 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/sidepanel.jelly +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/sidepanel.jelly @@ -28,7 +28,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/views/BuildButtonColumn/column.jelly b/core/src/main/resources/hudson/views/BuildButtonColumn/column.jelly index d9d44ea921ff..2d0506240aab 100644 --- a/core/src/main/resources/hudson/views/BuildButtonColumn/column.jelly +++ b/core/src/main/resources/hudson/views/BuildButtonColumn/column.jelly @@ -39,7 +39,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly index 536c3947ffcc..ef0e71d94b72 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly @@ -78,7 +78,7 @@ THE SOFTWARE.
diff --git a/core/src/main/resources/jenkins/management/ShutdownLink/index.groovy b/core/src/main/resources/jenkins/management/ShutdownLink/index.groovy index 8e0637886007..a5849945f0ba 100644 --- a/core/src/main/resources/jenkins/management/ShutdownLink/index.groovy +++ b/core/src/main/resources/jenkins/management/ShutdownLink/index.groovy @@ -10,7 +10,7 @@ l.layout(norefresh: true, permission: app.MANAGE, title: my.displayName) { l.side_panel { l.tasks { l.task(icon: "icon-up icon-md", href: rootURL + '/', title: _("Back to Dashboard")) - l.task(icon: "icon-gear icon-md", href: "${rootURL}/manage", title: _("Manage Jenkins")) + l.task(icon: "symbol-settings", href: "${rootURL}/manage", title: _("Manage Jenkins")) } } l.main_panel { diff --git a/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy b/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy index 3d3bb7f6be76..c9bee447f53a 100644 --- a/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy +++ b/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy @@ -13,7 +13,7 @@ l.layout(norefresh:true, permission:app.SYSTEM_READ, title:my.displayName) { l.side_panel { l.tasks { l.task(icon:"icon-up icon-md", href:rootURL+'/', title:_("Back to Dashboard")) - l.task(icon:"icon-gear icon-md", href:"${rootURL}/computer/", title:_("Manage Nodes")) + l.task(icon:"symbol-settings", href:"${rootURL}/computer/", title:_("Manage Nodes")) } } l.app_bar(title: my.displayName) diff --git a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly index 8bf0c69ed277..6a7df03b820d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly @@ -54,34 +54,18 @@ THE SOFTWARE. ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.addHeader(category.key.label) : null}
- - - - - - - - - - - +
- - ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(m.urlName, iconUrl, m.displayName, m.requiresPOST, m.requiresConfirmation) : null} + + + + + ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(m.urlName, iconSrc, iconXml, m.displayName, m.requiresPOST, m.requiresConfirmation) : null} - - - - - - - - +
${m.displayName}
@@ -91,17 +75,7 @@ THE SOFTWARE. - - - - - - - - +
${m.displayName}
@@ -111,17 +85,7 @@ THE SOFTWARE. - - - - - - - - +
${m.displayName}
diff --git a/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy b/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy index dcac38139ac9..3b638fb66f5f 100644 --- a/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy +++ b/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy @@ -11,7 +11,7 @@ l.layout(permission:app.SYSTEM_READ, title:my.displayName) { l.side_panel { l.tasks { l.task(icon:"icon-up icon-md", href:rootURL+'/', title:_("Back to Dashboard")) - l.task(icon:"icon-gear icon-md", href:"${rootURL}/manage", title:_("Manage Jenkins")) + l.task(icon:"symbol-settings", href:"${rootURL}/manage", title:_("Manage Jenkins")) } } l.app_bar(title: my.displayName) diff --git a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly index d18b31052824..773c3dadbacd 100644 --- a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly +++ b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly @@ -27,10 +27,10 @@ - +
- +
diff --git a/core/src/main/resources/lib/form/repeatableDeleteButton.jelly b/core/src/main/resources/lib/form/repeatableDeleteButton.jelly index 8c5c0ba73bd5..e00c346a1810 100644 --- a/core/src/main/resources/lib/form/repeatableDeleteButton.jelly +++ b/core/src/main/resources/lib/form/repeatableDeleteButton.jelly @@ -33,6 +33,6 @@ THE SOFTWARE. diff --git a/core/src/main/resources/lib/hudson/actions.jelly b/core/src/main/resources/lib/hudson/actions.jelly index 1a50cfc43ec1..3661fabcdf09 100644 --- a/core/src/main/resources/lib/hudson/actions.jelly +++ b/core/src/main/resources/lib/hudson/actions.jelly @@ -44,4 +44,4 @@ THE SOFTWARE. - \ No newline at end of file + diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index 0329a3c99377..6561b4f10688 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -56,7 +56,7 @@ THE SOFTWARE. tr.insert(new Element('td', {class: 'jenkins-table__cell--tight'}). insert(new Element('div', {class: 'jenkins-table__cell__button-wrapper'}). insert(new Element('a', {class: 'jenkins-table__button', href: '${rootURL}/' + e.url + 'console'}). - insert(``)))); + insert(``)))); p.insert(tr); Behaviour.applySubtree(tr); } diff --git a/core/src/main/resources/lib/hudson/newFromList/form.jelly b/core/src/main/resources/lib/hudson/newFromList/form.jelly index 76df8c810b45..2f0c87de4bdb 100644 --- a/core/src/main/resources/lib/hudson/newFromList/form.jelly +++ b/core/src/main/resources/lib/hudson/newFromList/form.jelly @@ -94,7 +94,7 @@ THE SOFTWARE.
diff --git a/core/src/main/resources/lib/hudson/project/configurable.jelly b/core/src/main/resources/lib/hudson/project/configurable.jelly index eacf85006e08..229385112ec8 100644 --- a/core/src/main/resources/lib/hudson/project/configurable.jelly +++ b/core/src/main/resources/lib/hudson/project/configurable.jelly @@ -38,10 +38,10 @@ THE SOFTWARE. - + - + diff --git a/core/src/main/resources/lib/hudson/summary.jelly b/core/src/main/resources/lib/hudson/summary.jelly index b4fc33c17656..8f6f63cdc2ac 100644 --- a/core/src/main/resources/lib/hudson/summary.jelly +++ b/core/src/main/resources/lib/hudson/summary.jelly @@ -28,11 +28,9 @@ THE SOFTWARE. Displays a link with a large icon. Used in the project top page. - The icon class name e.g. 'icon-folder'. - - On older versions of Jenkins, this attribute value used to be a link to the raw icon image, where relative - paths were resolved against images/48x48 and absolute paths (that start with '/') were resolved against - the context root of Hudson. + Supports Jenkins Symbols (e.g. 'symbol-search') + Supports path to bitmap image (e.g. '/plugin/foo/abc.gif') + Supports icon class specification (e.g. 'icon-help icon-sm', 'icon-blue icon-md', 'icon-blue-anime icon-xlg') where the summary icon links to. @@ -48,49 +46,16 @@ THE SOFTWARE.
@@ -109,4 +74,4 @@ THE SOFTWARE. - \ No newline at end of file + diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index 98aba574d07f..f84037ae9722 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -23,8 +23,13 @@ var breadcrumbs = (function() { var logger = function() {}; // logger = function() { console.log.apply(console,arguments) }; // uncomment this line to enable logging - function makeMenuHtml(icon,displayName) { + function makeMenuHtml(icon, iconXml, displayName) { var displaynameSpan = '' + displayName + ''; + + if (iconXml != null) { + return iconXml + displaynameSpan; + } + if (icon === null) return "" + displaynameSpan; // TODO: move this to the API response in a clean way @@ -213,9 +218,9 @@ var breadcrumbs = (function() { var a = x.responseText.evalJSON().items; function fillMenuItem(e) { if (e.header) { - e.text = makeMenuHtml(e.icon, "" + e.displayName + ""); + e.text = makeMenuHtml(e.icon, e.iconXml, "" + e.displayName + ""); } else { - e.text = makeMenuHtml(e.icon, e.displayName); + e.text = makeMenuHtml(e.icon, e.iconXml, e.displayName); } if (e.subMenu!=null) e.subMenu = {id:"submenu"+(iota++), itemdata:e.subMenu.items.each(fillMenuItem)}; @@ -287,7 +292,7 @@ var breadcrumbs = (function() { * @return {breadcrumbs.MenuItem} */ "add" : function (url,icon,displayName) { - this.items.push({ url:url, text:makeMenuHtml(icon,displayName) }); + this.items.push({ url:url, text:makeMenuHtml(icon, null, displayName) }); return this; } }; diff --git a/core/src/main/resources/lib/layout/icon.jelly b/core/src/main/resources/lib/layout/icon.jelly index e4b4c47b2ea7..e0eb926f1d61 100644 --- a/core/src/main/resources/lib/layout/icon.jelly +++ b/core/src/main/resources/lib/layout/icon.jelly @@ -26,7 +26,15 @@ THE SOFTWARE. @since 1.576 - + + + Icon source + Supports Jenkins Symbols (e.g. 'symbol-search') + Supports path to bitmap image + Only relevant if the 'class' attribute is NOT specified. + + + The icon class specification e.g. 'icon-help icon-sm', 'icon-blue icon-md', 'icon-blue-anime icon-xlg'. @@ -34,56 +42,57 @@ THE SOFTWARE. ID of the icon element. Since TODO. - - Icon source raw URL. Only relevant if the 'class' attribute is NOT specified. - - onclick handler. Deprecated; assign an ID and look up the element that way to attach event handlers. - title + title, deprecated use tooltip instead style tooltip alt - + + - - - - - - - - - - + + + + - - - + + + + + + + + + + + + - - - + + + + + - - - + - - - + + + - - ${attrs.alt} + + ${attrs.alt} + + - diff --git a/core/src/main/resources/lib/layout/ionicon.jelly b/core/src/main/resources/lib/layout/ionicon.jelly deleted file mode 100644 index 15a711019744..000000000000 --- a/core/src/main/resources/lib/layout/ionicon.jelly +++ /dev/null @@ -1,18 +0,0 @@ - - - - Provides ionicon icons - - The name of the icon - - - Title to use for the icon - - - - - - - - - diff --git a/core/src/main/resources/lib/layout/task.jelly b/core/src/main/resources/lib/layout/task.jelly index b130b15cfc3d..bba181408104 100644 --- a/core/src/main/resources/lib/layout/task.jelly +++ b/core/src/main/resources/lib/layout/task.jelly @@ -37,6 +37,7 @@ THE SOFTWARE. Common values include: + # "symbol-search" / "symbol-terminal" / "symbol-settings" - use a Jenkins Symbol as the icon for your task # "icon-folder icon-md" is an example of using a class spec for a medium folder icon # "images/24x24/..." then points to the stock icon resources # "plugin/foobar/abc/def.png" that points to "src/main/webapp/abc/def.png" in your plugin resources @@ -56,7 +57,7 @@ THE SOFTWARE. This is useful for showing links to restricted pages, as showing them to unprivileged users don't make sense. - + If both permission and permissions is set, then permissions will be used @@ -113,6 +114,10 @@ THE SOFTWARE. + + + + - - - - - - - - - - - - - -
- ${title} @@ -153,15 +144,11 @@ THE SOFTWARE.
- - - ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href, iconMetadata.getQualifiedUrl(context), title, post == 'true', requiresConfirmation == 'true') : null} - - - ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href, icon, title, post == 'true', requiresConfirmation == 'true') : null} - - - + + + + + ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href, iconSrc, iconXml, title, post == 'true', requiresConfirmation == 'true') : null}