Monty Taylor | 4a781a7 | 2017-07-25 07:28:04 -0400 | [diff] [blame] | 1 | /* global ZUUL_API_URL */ |
| 2 | // @licstart The following is the entire license notice for the |
| 3 | // JavaScript code in this page. |
| 4 | // |
| 5 | // Copyright 2017 Red Hat |
| 6 | // |
| 7 | // Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | // not use this file except in compliance with the License. You may obtain |
| 9 | // a copy of the License at |
| 10 | // |
| 11 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | // |
| 13 | // Unless required by applicable law or agreed to in writing, software |
| 14 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 16 | // License for the specific language governing permissions and limitations |
| 17 | // under the License. |
| 18 | // |
| 19 | // @licend The above is the entire license notice |
| 20 | // for the JavaScript code in this page. |
| 21 | |
| 22 | // TODO(mordred) This should be encapsulated in an Angular Service singleton |
| 23 | // that fetches the other things from the info endpoint. |
| 24 | export function getSourceUrl (filename, $location) { |
| 25 | if (typeof ZUUL_API_URL !== 'undefined') { |
| 26 | return ZUUL_API_URL + '/' + filename |
| 27 | } else { |
| 28 | return filename |
| 29 | } |
| 30 | } |