| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2016 The LUCI Authors. All rights reserved. | 2 Copyright 2016 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 /** | 8 /** |
| 9 * Basic common LogDog application functionality. | 9 * Basic common LogDog application functionality. |
| 10 * | |
| 11 * @param {window} window the application window to bind to | |
| 12 */ | 10 */ |
| 13 LogDogApp = function(window) { | 11 LogDogApp = function() {} |
| 14 // Set up our default LogDog host. | |
| 15 this.host = window.location.hostname; | |
| 16 if (this.host === "localhost") { | |
| 17 // Running locally. Bind to our development instance. | |
| 18 this.host = "luci-logdog-dev.appspot.com"; | |
| 19 } | |
| 20 | |
| 21 this.production = (window.location.port === ""); | |
| 22 }; | |
| 23 | 12 |
| 24 /** | 13 /** |
| 25 * Returns an Array of values for a given query parameter. | 14 * Returns an Array of values for a given query parameter. |
| 26 * | 15 * |
| 27 * For example, if the query parameter was, "...?a=asdf&a=qwer", this would | 16 * For example, if the query parameter was, "...?a=asdf&a=qwer", this would |
| 28 * return ["asdf", "qwer"]. | 17 * return ["asdf", "qwer"]. |
| 29 * | 18 * |
| 30 * @param {string} q the query parameter text. | 19 * @param {string} q the query parameter text. |
| 31 * @param {string} key the query parameter key to extract. | 20 * @param {string} key the query parameter key to extract. |
| 32 * @returns {Array} the array of ordered query parameters for key. | 21 * @returns {Array} the array of ordered query parameters for key. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 * @param {string} v the stream path value | 60 * @param {string} v the stream path value |
| 72 * @returns {string} the fixed stream path value | 61 * @returns {string} the fixed stream path value |
| 73 */ | 62 */ |
| 74 LogDogApp.prototype.correctStreamPath = function(v) { | 63 LogDogApp.prototype.correctStreamPath = function(v) { |
| 75 return v.replace(" ", "+"); | 64 return v.replace(" ", "+"); |
| 76 }; | 65 }; |
| 77 | 66 |
| 78 /** Global LogDogApp instance bound to the current window. */ | 67 /** Global LogDogApp instance bound to the current window. */ |
| 79 var logdog = new LogDogApp(window); | 68 var logdog = new LogDogApp(window); |
| 80 </script> | 69 </script> |
| OLD | NEW |