You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2016/12/06 06:27:39 UTC

[11/12] incubator-guacamole-client git commit: GUACAMOLE-136: Use $element to retrieve field elements rather than straight jQuery.

GUACAMOLE-136: Use $element to retrieve field elements rather than straight jQuery.

Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/a0f9bf54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/a0f9bf54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/a0f9bf54

Branch: refs/heads/master
Commit: a0f9bf541feee5cd65bc866723637bfb65555abb
Parents: e6f0b7d
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 5 22:08:49 2016 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Mon Dec 5 22:20:24 2016 -0800

----------------------------------------------------------------------
 .../controllers/duoSignedResponseController.js      | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/a0f9bf54/extensions/guacamole-auth-duo/src/main/resources/controllers/duoSignedResponseController.js
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-duo/src/main/resources/controllers/duoSignedResponseController.js b/extensions/guacamole-auth-duo/src/main/resources/controllers/duoSignedResponseController.js
index f683698..b4ca4f3 100644
--- a/extensions/guacamole-auth-duo/src/main/resources/controllers/duoSignedResponseController.js
+++ b/extensions/guacamole-auth-duo/src/main/resources/controllers/duoSignedResponseController.js
@@ -22,15 +22,23 @@
  * API to prompt the user for additional credentials, ultimately receiving a
  * signed response from the Duo service.
  */
-angular.module('guacDuo').controller('duoSignedResponseController', ['$scope',
-    function duoSignedResponseController($scope) {
+angular.module('guacDuo').controller('duoSignedResponseController', ['$scope', '$element',
+    function duoSignedResponseController($scope, $element) {
 
     /**
      * The iframe which contains the Duo authentication interface.
      *
      * @type HTMLIFrameElement
      */
-    var iframe = $('.duo-signature-response-field iframe')[0];
+    var iframe = $element.find('iframe')[0];
+
+    /**
+     * The submit button which should be used to submit the login form once
+     * the Duo response has been received.
+     *
+     * @type HTMLInputElement
+     */
+    var submit = $element.find('input[type="submit"]')[0];
 
     /**
      * Whether the Duo interface has finished loading within the iframe.
@@ -56,7 +64,7 @@ angular.module('guacDuo').controller('duoSignedResponseController', ['$scope',
         });
 
         // Submit updated credentials
-        $('.duo-signature-response-field input[type="submit"]').click();
+        submit.click();
 
     };