Merge branch 'stable-2.11' into stable-2.12

* stable-2.11:
  Fix double slash on URL when switching account.
  Use image instead of Unicode Character for Copy Button

Change-Id: I6474cf80326eb80e42505c050f9ed42a16af43c3
This commit is contained in:
David Pursehouse
2015-11-10 23:56:02 -08:00
7 changed files with 35 additions and 2 deletions

View File

@@ -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'],
)

View File

@@ -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();
}

View File

@@ -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());

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

View File

@@ -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;

View File

@@ -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')

21
lib/LICENSE-drifty Normal file
View File

@@ -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.