diff --git a/gerrit-gwtexpui/BUCK b/gerrit-gwtexpui/BUCK index 189445a859..4b2cb0352f 100644 --- a/gerrit-gwtexpui/BUCK +++ b/gerrit-gwtexpui/BUCK @@ -7,6 +7,7 @@ gwt_module( resources = [ SRC + 'clippy/client/clippy.css', SRC + 'clippy/client/clippy.swf', + SRC + 'clippy/client/clipboard-16.png', SRC + 'clippy/client/CopyableLabelText.properties', ], provided_deps = ['//lib/gwt:user'], @@ -14,6 +15,7 @@ gwt_module( ':SafeHtml', ':UserAgent', '//lib:LICENSE-clippy', + '//lib:LICENSE-drifty', ], visibility = ['PUBLIC'], ) diff --git a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/ClippyResources.java b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/ClippyResources.java index dfa7679a97..dd3cc18cad 100644 --- a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/ClippyResources.java +++ b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/ClippyResources.java @@ -18,6 +18,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.DataResource; import com.google.gwt.resources.client.DataResource.DoNotEmbed; +import com.google.gwt.resources.client.ImageResource; public interface ClippyResources extends ClientBundle { public static final ClippyResources I = GWT.create(ClippyResources.class); @@ -28,4 +29,7 @@ public interface ClippyResources extends ClientBundle { @Source("clippy.swf") @DoNotEmbed DataResource swf(); + + @Source("clipboard-16.png") + ImageResource clipboard(); } diff --git a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java index 4b6e7e4339..8d54b2f991 100644 --- a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java +++ b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/CopyableLabel.java @@ -119,7 +119,12 @@ public class CopyableLabel extends Composite implements HasText { } if (UserAgent.hasJavaScriptClipboard()) { - copier = new Button("📋"); // CLIPBOARD + copier = new Button(new SafeHtmlBuilder() + .openElement("img") + .setAttribute("src", ClippyResources.I.clipboard().getSafeUri().asString()) + .setWidth(14) + .setHeight(14) + .closeSelf()); copier.setStyleName(ClippyResources.I.css().copier()); Tooltip.addStyle(copier); Tooltip.setLabel(copier, CopyableLabelText.I.tooltip()); diff --git a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/clipboard-16.png b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/clipboard-16.png new file mode 100644 index 0000000000..9c6e10a347 Binary files /dev/null and b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/clippy/client/clipboard-16.png differ diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/UserPopupPanel.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/UserPopupPanel.java index 00036a808b..092479675e 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/UserPopupPanel.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/UserPopupPanel.java @@ -54,7 +54,7 @@ public class UserPopupPanel extends PopupPanel { switchAccount.setHref(Gerrit.info().auth().switchAccountUrl()); } else if (Gerrit.info().auth().isDev() || Gerrit.info().auth().isOpenId()) { - switchAccount.setHref(Gerrit.selfRedirect("/login/")); + switchAccount.setHref(Gerrit.selfRedirect("/login")); } else { switchAccount.removeFromParent(); switchAccount = null; diff --git a/lib/BUCK b/lib/BUCK index 73983daac7..a92f910117 100644 --- a/lib/BUCK +++ b/lib/BUCK @@ -12,6 +12,7 @@ define_license(name = 'bouncycastle') define_license(name = 'clippy') define_license(name = 'codemirror') define_license(name = 'diffy') +define_license(name = 'drifty') define_license(name = 'freebie_application_icon_set') define_license(name = 'h2') define_license(name = 'jgit') diff --git a/lib/LICENSE-drifty b/lib/LICENSE-drifty new file mode 100644 index 0000000000..18ab118e71 --- /dev/null +++ b/lib/LICENSE-drifty @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Drifty (http://drifty.com/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.