keycloak-aplcache

Details

diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js
index 5c5b40b..37fc3ed 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/js/app.js
@@ -653,6 +653,28 @@ module.directive('kcReset', function ($compile, Notifications) {
     }
 });
 
+/*
+*  Used to select the element (invoke $(elem).select()) on specified action list.
+*  Usages kc-select-action="click mouseover"
+*  When used in the textarea element, this will select/highlight the textarea content on specified action (i.e. click).
+*/
+module.directive('kcSelectAction', function ($compile, Notifications) {
+    return {
+        restrict: 'A',
+        compile: function (elem, attrs) {
+
+            var events = attrs.kcSelectAction.split(" ");
+
+            for(var i=0; i < events.length; i++){
+
+                elem.bind(events[i], function(){
+                    elem.select();
+                });
+            }
+        }
+    }
+});
+
 module.filter('remove', function() {
     return function(input, remove, attribute) {
         if (!input || !remove) {
diff --git a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html
index d15ab2b..b783bfa 100755
--- a/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html
+++ b/admin-ui/src/main/resources/META-INF/resources/admin/partials/realm-keys.html
@@ -27,7 +27,8 @@
                             <label for="publicKey">Public key</label>
 
                             <div class="controls">
-                                <textarea type="text" id="publicKey" name="publicKey" class="xlarge" rows="5">{{realm.publicKey}}</textarea>
+                                <textarea type="text" id="publicKey" name="publicKey" class="xlarge" rows="5"
+                                          kc-select-action="click" readonly>{{realm.publicKey}}</textarea>
                             </div>
                         </div>
                     </fieldset>