<commit_before>goog.provide 'wzk.ui.form.RemoteButton'

goog.require 'goog.ui.Button'

###*
  A button that allows an Ajax call.
###
class wzk.ui.form.RemoteButton extends goog.ui.Button

  ###*
    @constructor
    @extends {goog.ui.Button}
    @param {goog.ui.ControlContent=} content
    @param {goog.ui.ButtonRenderer=} renderer
    @param {goog.dom.DomHelper=} dom
  ###
  constructor: (content, renderer, dom) ->
    super content, renderer, dom
    @url = null
    @method = null
    @addClassName 'remote-button'

  ###*
    Sends a request on a given model with a given method

    @param {wzk.resource.Client} client
    @param {string} url
    @param {string} method
    @param {Object|null|string=} content
  ###
  call: (client, url, method, content) ->
    @setEnabled false
    client.request url, method, content, ->
      @setEnabled true
<commit_msg>Fixed setEnabled on RemoteButton #49<commit_after>goog.provide 'wzk.ui.form.RemoteButton'

goog.require 'goog.ui.Button'

###*
  A button that allows an Ajax call.
###
class wzk.ui.form.RemoteButton extends goog.ui.Button

  ###*
    @constructor
    @extends {goog.ui.Button}
    @param {goog.ui.ControlContent=} content
    @param {goog.ui.ButtonRenderer=} renderer
    @param {goog.dom.DomHelper=} dom
  ###
  constructor: (content, renderer, dom) ->
    super content, renderer, dom
    @url = null
    @method = null
    @addClassName 'remote-button'

  ###*
    Sends a request on a given model with a given method

    @param {wzk.resource.Client} client
    @param {string} url
    @param {string} method
    @param {Object|null|string=} content
  ###
  call: (client, url, method, content) ->
    @setEnabled false
    client.request url, method, content, =>
      @setEnabled true

{'fraction_non_alphanumeric': 0.1313246162592382, 'fraction_numerical': 0.0011370096645821489, 'mean_word_length': 3.251207729468599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '223190', 'n_tokens_mistral': 591, 'n_tokens_neox': 565, 'n_words': 158}