Commit 770b1c0c authored by Alain Takoudjou's avatar Alain Takoudjou

erp5_web_mynij_search: Remove cors-anywhere proxy which is only for testing

parent 50535538
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80*/
/*global window, RSVP, rJS, document*/
(function (window, document, rJS, RSVP) {
var gadget;
var gadget,
proxies = [
"https://softinst116265.host.vifib.net/erp5/ERP5Site_getHTTPResource",
"https://softinst116446.host.vifib.net/erp5/ERP5Site_getHTTPResource"
];
rJS(window)
.setState({
model_gadget : null,
......@@ -175,9 +179,12 @@
return new RSVP.Queue()
.push(function () {
var rng = Math.floor(Math.random() * Math.floor(proxies.length)),
proxy = proxies[rng],
query = encodeURI(key);
return jIO.util.ajax({
url : "https://cors-anywhere.herokuapp.com/search.disroot.org/?q=" +
key + "&category_general=on&theme=oscar"
url : proxy + "?url=https%3A%2F%2Fsoftinst141674.host.vifib.net%2Fsearch%3Fq%3D" +
query + "%26category_general%3Don%26theme%3Doscar"
});
})
.push(undefined, function () {
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>988.5449.4324.54169</string> </value>
<value> <string>990.12602.3691.30958</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1605886140.65</float>
<float>1614017833.95</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -48,6 +48,9 @@
list = document.getElementById("mynij-results");
list_item = document.createElement("li");
list_item.id = Math.random().toString(36) + '-' + Date.now();
if (item.link.startsWith("?url=")) {
item.link = item.link.substring(5);
}
return gadget.cut_link(item.link)
.push(function (cut_link) {
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.10151.37063.11315</string> </value>
<value> <string>990.3487.35664.34628</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1613470052.64</float>
<float>1613572333.62</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment