diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/libtoaster.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index b899b8de4d..4983ef6f6d 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js | |||
@@ -88,10 +88,32 @@ var libtoaster = (function (){ | |||
88 | } }); | 88 | } }); |
89 | }; | 89 | }; |
90 | 90 | ||
91 | /* Get a project's configuration info */ | ||
92 | function _getProjectInfo(url, projectId, onsuccess, onfail){ | ||
93 | $.ajax({ | ||
94 | type: "POST", | ||
95 | url: url, | ||
96 | data: { project_id : projectId }, | ||
97 | headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, | ||
98 | success: function (_data) { | ||
99 | if (_data.error != "ok") { | ||
100 | console.log(_data.error); | ||
101 | } else { | ||
102 | if (onsuccess != undefined) onsuccess(_data); | ||
103 | } | ||
104 | }, | ||
105 | error: function (_data) { | ||
106 | console.log(_data); | ||
107 | if (onfail) onfail(data); | ||
108 | } | ||
109 | }); | ||
110 | }; | ||
111 | |||
91 | return { | 112 | return { |
92 | reload_params : reload_params, | 113 | reload_params : reload_params, |
93 | startABuild : _startABuild, | 114 | startABuild : _startABuild, |
94 | makeTypeahead : _makeTypeahead, | 115 | makeTypeahead : _makeTypeahead, |
116 | getProjectInfo: _getProjectInfo, | ||
95 | } | 117 | } |
96 | })(); | 118 | })(); |
97 | 119 | ||