Commit 0d108acd authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Remove hardcoded link to the original domain

parent 0e0e1c9b
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var gadget = this, var gadget = this,
jio_configuration_string = "https://cribjs.nexedi.net/cribjs-latest.zip"; getURL = window.location,
jio_configuration_string = getURL.protocol + "//" + getURL.host + "/cribjs-latest.zip";
return RSVP.Queue() return RSVP.Queue()
.push(function () { .push(function () {
return gadget.getDeclaredGadget('jio_configurator'); return gadget.getDeclaredGadget('jio_configurator');
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"use strict"; "use strict";
function getStorageGadget(gadget) { function getStorageGadget(gadget) {
var storage_gadget, site_editor_gadget_url; var storage_gadget, site_editor_gadget_url, getURL = window.location;
return gadget.getSetting( return gadget.getSetting(
"site_editor_gadget_url", "site_editor_gadget_url",
"https://cribjs.nexedi.net/gadget/crib-sw-storage-gadget.html" getURL.protocol + "//" + getURL.host + "/gadget/crib-sw-storage-gadget.html"
) )
.push(function (url) { .push(function (url) {
if (gadget.props.storage_gadget_url == url) { if (gadget.props.storage_gadget_url == url) {
...@@ -43,8 +43,9 @@ ...@@ -43,8 +43,9 @@
g.props = {}; g.props = {};
return g.getElement() return g.getElement()
.push(function (element) { .push(function (element) {
var getURL = window.location;
g.props.element = element; g.props.element = element;
g.props.storage_gadget_url = "https://cribjs.nexedi.net/gadget/crib-sw-storage-gadget.html"; getURL.protocol + "//" + getURL.host + "/gadget/crib-sw-storage-gadget.html"
}); });
}) })
.ready(function(gadget) { .ready(function(gadget) {
......
...@@ -15,5 +15,6 @@ ...@@ -15,5 +15,6 @@
</head> </head>
<body> <body>
Couscosu
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
// XXX Hack to not add a new service worker when one is already declared // XXX Hack to not add a new service worker when one is already declared
if (!navigator.serviceWorker.controller) { if (!navigator.serviceWorker.controller) {
return new RSVP.Promise(function(resolve, reject, notify) { return new RSVP.Promise(function(resolve, reject, notify) {
navigator.serviceWorker.register('sw.js', {scope: './'}).then( navigator.serviceWorker.register('/sw.js', {scope: '/'}).then(
function(){ function(){
if (navigator.serviceWorker.controller) { if (navigator.serviceWorker.controller) {
resolve(); resolve();
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div class="nav_content save_load container"> <div class="nav_content save_load container">
<h3>Site Editor Gadget URL</h3> <h3>Site Editor Gadget URL</h3>
<p>Enter the URL of the Crib Gadget from the site you want to edit. If you want to edit this site use: <p>Enter the URL of the Crib Gadget from the site you want to edit. If you want to edit this site use:
"https://cribjs.nexedi.net/gadget/crib-sw-storage-gadget.html"</p> "/gadget/crib-sw-storage-gadget.html"</p>
<div class="row"> <div class="row">
<table class="table"> <table class="table">
<tr> <tr>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<div class="form-group"> <div class="form-group">
<label for="url" class="col-sm-2 control-label">URL</label> <label for="url" class="col-sm-2 control-label">URL</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control url" id="url" value="https://cribjs.nexedi.net/gadget/crib-sw-storage-gadget.html"> <input type="text" class="form-control url" id="url" value="/gadget/crib-sw-storage-gadget.html">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -30,9 +30,10 @@ ...@@ -30,9 +30,10 @@
gadget.props.options = options; gadget.props.options = options;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
var getURL = window.location;
return gadget.getSetting( return gadget.getSetting(
"site_editor_gadget_url", "site_editor_gadget_url",
"https://cribjs.nexedi.net/gadget/crib-sw-storage-gadget.html" getURL.protocol + "//" + getURL.host + "/gadget/crib-sw-storage-gadget.html"
) )
}) })
.push(function (site_editor_gadget_url) { .push(function (site_editor_gadget_url) {
......
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