Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: appengine/monorail/static/js/framework/project-name-check.js

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright 2016 The Chromium Authors. All Rights Reserved.
2 *
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file or at
5 * https://developers.google.com/open-source/licenses/bsd
6 */
7
8 /**
9 * @fileoverview Functions that support project name checks when
10 * creating a new project.
11 */
12
13 /**
14 * Function that communicates with the server.
15 * @param {string} projectName The proposed project name.
16 */
17 function checkProjectName(projectName) {
18 var createProjectUrl = '/hosting/createProject/checkProjectName.do';
19 var args = {
20 'project': projectName
21 };
22 CS_doPost(createProjectUrl, nameTaken, args);
23 }
24
25 /**
26 * Function that evaluates the server response and sets the error message.
27 * @param {event} event with xhr server's JSON response to the AJAX request.
28 */
29 function nameTaken(event) {
30 var xhr = event.target;
31 if (xhr.readyState != 4 || xhr.status != 200)
32 return;
33 var resp = CS_parseJSON(xhr);
34 var errorMessage = resp['error_message'];
35 document.getElementById('projectnamefeedback').innerText = errorMessage;
36 if (errorMessage != '') {
37 document.getElementById('submit_btn').disabled = 'disabled';
38 }
39 }
40
41 // Make this function globally available
42 _CP_checkProjectName = checkProjectName;
OLDNEW
« no previous file with comments | « appengine/monorail/static/js/framework/framework-stars.js ('k') | appengine/monorail/static/js/graveyard/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698