(function(){"use strict";RB.OAuthClientSecretView=Backbone.View.extend({events:{"click .copyable-text-input-link":"_onCopyClicked","click .regenerate-secret-button":"_onRegenerateClicked"},initialize:function initialize(options){this._apiURL=options.apiURL},render:function render(){this._$input=this.$("input");this._$regen=this.$(".regenerate-secret-button");return this},_onCopyClicked:function _onCopyClicked(e){e.preventDefault();e.stopPropagation();this._$input.focus().select();document.execCommand("copy")},_onRegenerateClicked:function _onRegenerateClicked(e){var _this=this;e.preventDefault();e.stopPropagation();this._$regen.prop("disabled",true);RB.apiCall({url:this._apiURL,method:"PUT",data:{regenerate_client_secret:1},success:function success(rsp){_this._$input.val(rsp.oauth_app.client_secret);_this._$regen.prop("disabled",false)},error:function error(xhr){if(xhr.errorText){alert(xhr.errorText)}_this._$regen.prop("disabled",false)}})}})}).call(this);
