Skip to content

Commit 23ed4cc

Browse files
author
OpenShift Bot
authored
Merge pull request #1840 from spadgett/ios-copy
Merged by openshift-bot
2 parents e3e7ba7 + 9e326a7 commit 23ed4cc

File tree

5 files changed

+37
-27
lines changed

5 files changed

+37
-27
lines changed

app/scripts/directives/util.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ angular.module('openshiftConsole')
5757
}
5858
};
5959
})
60-
.directive('copyToClipboard', function(IS_IOS) {
60+
.directive('copyToClipboard', function() {
6161
return {
6262
restrict: 'E',
6363
scope: {
@@ -72,11 +72,6 @@ angular.module('openshiftConsole')
7272
$scope.id = _.uniqueId('clipboardJs');
7373
},
7474
link: function($scope, element) {
75-
if (IS_IOS) {
76-
$scope.hidden = true;
77-
return;
78-
}
79-
8075
var nodeElem = $('a', element);
8176
var node = nodeElem.get(0);
8277
if ($scope.inputText) {
@@ -89,7 +84,7 @@ angular.module('openshiftConsole')
8984
.attr('title', 'Copied!')
9085
.tooltip('fixTitle')
9186
.tooltip('show')
92-
.attr('title', 'Copy to clipboard')
87+
.attr('title', 'Copy to Clipboard')
9388
.tooltip('fixTitle');
9489
e.clearSelection();
9590
});
@@ -99,7 +94,7 @@ angular.module('openshiftConsole')
9994
.attr('title', fallbackMsg)
10095
.tooltip('fixTitle')
10196
.tooltip('show')
102-
.attr('title', 'Copy to clipboard')
97+
.attr('title', 'Copy to Clipboard')
10398
.tooltip('fixTitle');
10499
});
105100
element.on('$destroy', function() {

app/views/directives/_copy-to-clipboard.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,24 @@
1818
data-toggle="tooltip"
1919
data-placement="left"
2020
data-container=".middle"
21-
title="Copy to clipboard"
21+
title="Copy to Clipboard"
2222
role="button"
23-
class="btn btn-default"><i class="fa fa-clipboard"/></a>
23+
class="btn btn-default">
24+
<i class="fa fa-clipboard" aria-hidden="true"></i>
25+
<span class="sr-only">Copy to Clipboard</span>
26+
</a>
2427
<a ng-show="inputText"
2528
data-clipboard-text="{{clipboardText}}"
2629
href=""
2730
ng-disabled="isDisabled"
2831
data-toggle="tooltip"
2932
data-placement="left"
3033
data-container=".middle"
31-
title="Copy to clipboard"
34+
title="Copy to Clipboard"
3235
role="button"
33-
class="btn btn-default"><i class="fa fa-clipboard"/></a>
36+
class="btn btn-default">
37+
<i class="fa fa-clipboard" aria-hidden="true"></i>
38+
<span class="sr-only">Copy to Clipboard</span>
39+
</a>
3440
</span>
3541
</div><!-- /input-group -->

dist/scripts/scripts.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10336,7 +10336,7 @@ $(this).hide(), $(".reveal-contents", b).show();
1033610336
});
1033710337
}
1033810338
};
10339-
}).directive("copyToClipboard", [ "IS_IOS", function(a) {
10339+
}).directive("copyToClipboard", function() {
1034010340
return {
1034110341
restrict:"E",
1034210342
scope:{
@@ -10350,22 +10350,21 @@ templateUrl:"views/directives/_copy-to-clipboard.html",
1035010350
controller:[ "$scope", function(a) {
1035110351
a.id = _.uniqueId("clipboardJs");
1035210352
} ],
10353-
link:function(b, c) {
10354-
if (a) return void (b.hidden = !0);
10355-
var d = $("a", c), e = d.get(0);
10356-
b.inputText && (e = d.get(1));
10357-
var f = new Clipboard(e);
10358-
f.on("success", function(a) {
10359-
$(a.trigger).attr("title", "Copied!").tooltip("fixTitle").tooltip("show").attr("title", "Copy to clipboard").tooltip("fixTitle"), a.clearSelection();
10360-
}), f.on("error", function(a) {
10353+
link:function(a, b) {
10354+
var c = $("a", b), d = c.get(0);
10355+
a.inputText && (d = c.get(1));
10356+
var e = new Clipboard(d);
10357+
e.on("success", function(a) {
10358+
$(a.trigger).attr("title", "Copied!").tooltip("fixTitle").tooltip("show").attr("title", "Copy to Clipboard").tooltip("fixTitle"), a.clearSelection();
10359+
}), e.on("error", function(a) {
1036110360
var b = /Mac/i.test(navigator.userAgent) ? "Press ⌘C to copy" :"Press Ctrl-C to copy";
10362-
$(a.trigger).attr("title", b).tooltip("fixTitle").tooltip("show").attr("title", "Copy to clipboard").tooltip("fixTitle");
10363-
}), c.on("$destroy", function() {
10364-
f.destroy();
10361+
$(a.trigger).attr("title", b).tooltip("fixTitle").tooltip("show").attr("title", "Copy to Clipboard").tooltip("fixTitle");
10362+
}), b.on("$destroy", function() {
10363+
e.destroy();
1036510364
});
1036610365
}
1036710366
};
10368-
} ]).directive("shortId", function() {
10367+
}).directive("shortId", function() {
1036910368
return {
1037010369
restrict:"E",
1037110370
scope:{

dist/scripts/templates.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5485,8 +5485,14 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
54855485
"<input ng-if=\"!multiline\" id=\"{{id}}\" type=\"text\" class=\"form-control\" value=\"{{inputText || clipboardText}}\" ng-disabled=\"isDisabled\" ng-readonly=\"!isDisabled\" select-on-focus>\n" +
54865486
"<pre ng-if=\"multiline\" id=\"{{id}}\">{{inputText || clipboardText}}</pre>\n" +
54875487
"<span ng-class=\"{ 'input-group-btn': !multiline }\" ng-hide=\"hidden\">\n" +
5488-
"<a ng-show=\"!inputText\" data-clipboard-target=\"#{{id}}\" href=\"\" ng-disabled=\"isDisabled\" data-toggle=\"tooltip\" data-placement=\"left\" data-container=\".middle\" title=\"Copy to clipboard\" role=\"button\" class=\"btn btn-default\"><i class=\"fa fa-clipboard\"/></a>\n" +
5489-
"<a ng-show=\"inputText\" data-clipboard-text=\"{{clipboardText}}\" href=\"\" ng-disabled=\"isDisabled\" data-toggle=\"tooltip\" data-placement=\"left\" data-container=\".middle\" title=\"Copy to clipboard\" role=\"button\" class=\"btn btn-default\"><i class=\"fa fa-clipboard\"/></a>\n" +
5488+
"<a ng-show=\"!inputText\" data-clipboard-target=\"#{{id}}\" href=\"\" ng-disabled=\"isDisabled\" data-toggle=\"tooltip\" data-placement=\"left\" data-container=\".middle\" title=\"Copy to Clipboard\" role=\"button\" class=\"btn btn-default\">\n" +
5489+
"<i class=\"fa fa-clipboard\" aria-hidden=\"true\"></i>\n" +
5490+
"<span class=\"sr-only\">Copy to Clipboard</span>\n" +
5491+
"</a>\n" +
5492+
"<a ng-show=\"inputText\" data-clipboard-text=\"{{clipboardText}}\" href=\"\" ng-disabled=\"isDisabled\" data-toggle=\"tooltip\" data-placement=\"left\" data-container=\".middle\" title=\"Copy to Clipboard\" role=\"button\" class=\"btn btn-default\">\n" +
5493+
"<i class=\"fa fa-clipboard\" aria-hidden=\"true\"></i>\n" +
5494+
"<span class=\"sr-only\">Copy to Clipboard</span>\n" +
5495+
"</a>\n" +
54905496
"</span>\n" +
54915497
"</div>"
54925498
);

dist/scripts/vendor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36836,6 +36836,10 @@ if (c.color || c.backColor) {
3683636836
var d = "";
3683736837
c.color && (d += "color:" + c.color + ";"), c.backColor && (d += "background-color:" + c.backColor + ";"), b += ".node-" + this._elementId + '[data-nodeId="' + c.nodeId + '"]{' + d + "}";
3683836838
}
36839+
if (c.iconColor) {
36840+
var d = "color:" + c.iconColor + ";";
36841+
b += ".node-" + this._elementId + '[data-nodeId="' + c.nodeId + '"] .node-icon{' + d + "}";
36842+
}
3683936843
}, this)), this._css + b;
3684036844
}, g.prototype._template = {
3684136845
tree:a('<ul class="list-group"></ul>'),

0 commit comments

Comments
 (0)