lib/thoth/public/js/admin/name.js
/**
   * Handles Ajax check_name responses.
   *
   * @method handleCheckResponse
   * @param {Object} response response object
   * @private
   */
Handles Ajax check_name responses.
@method handleCheckResponse
@param {Object} response response object
@private
Handles Ajax check_name responses . @method handleCheckResponse @param { Object } response response object @private
function handleCheckResponse(response) {
    var data
    try {
      data = Y.lang.JSON.parse(response.responseText);
    } catch (e) {
      return;
    }
    if (!data.valid) {
      showError(response.argument, 'Names may only contain letters, numbers, ' +
          'underscores, and dashes, and may not be entirely numeric.');
    } else if (!data.unique && response.argument.value !== originalName) {
      showError(response.argument, 'This name is already taken.');
    } else {
      hideError(response.argument);
    }
  }
function handleCheckResponse ( response ) { var data try { data = Y . lang . JSON . parse ( response . responseText ) ; } catch ( e ) { return ; } if ( ! data . valid ) { showError ( response . argument , 'Names may only contain letters, numbers, ' + 'underscores, and dashes, and may not be entirely numeric.' ) ; } else if ( ! data . unique && response . argument . value !== originalName ) { showError ( response . argument , 'This name is already taken.' ) ; } else { hideError ( response . argument ) ; } }
Handles Ajax check_name responses.
Handles Ajax check_name responses .