4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 // NOTE: THIS FILE HAS BEEN DEPRECATED AND WILL BE REMOVED
24 import $ from 'jquery'
25 import alt
from '../alt'
26 import utils
from '../libraries/utils'
27 import RiftHeaderActions
from '../actions/RiftHeaderActions'
29 function getApiServerOrigin() {
30 return utils
.getSearchParams(window
.location
).api_port
|| ((window
.location
.protocol
== 'https:') ? 8443 : 8000);
32 function ajaxRequest(path
, catalogPackage
, resolve
, reject
, method
= 'GET') {
34 url
: '//' + window
.location
.hostname
+ ':' + window
.location
.port
+ path
,
36 beforeSend
: utils
.addAuthorizationStub
,
38 success: function(data
) {
39 if (typeof data
== 'string') {
40 data
= JSON
.parse(data
);
47 error: function(error
) {
48 if (typeof error
== 'string') {
49 error
= JSON
.parse(error
);
59 const RiftHeaderSource
= {
61 requestLaunchpadConfig: function () {
63 remote: function (state
, download
) {
64 return new Promise((resolve
, reject
) => {
65 // const path = '/launchpad/config?api_server=' + utils.getSearchParams(window.location).api_server;
66 // ajaxRequest(path, download, resolve, reject);
70 success
: RiftHeaderActions
.requestLaunchpadConfigSuccess
,
71 error
: RiftHeaderActions
.requestLaunchpadConfigError
76 export default RiftHeaderSource
;