Commit 40204fbf authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Pages: Use subdomain instead of the current scope

Scope is too long and too similar.
It is easier to only display the current subdomain
which should come from the app id. It is an hackish way to
hide scopes while making it look like an app.
parent c819309f
...@@ -96,7 +96,8 @@ ...@@ -96,7 +96,8 @@
if (gadget.stats.scope) { if (gadget.stats.scope) {
scope_link = gadget.props.element.querySelector(".crib-scope"); scope_link = gadget.props.element.querySelector(".crib-scope");
scope_link.href = gadget.stats.scope; scope_link.href = gadget.stats.scope;
scope_link.innerHTML = "Site: " + gadget.stats.scope; scope_link.innerHTML = "App: " +
gadget.stats.scope.split("//")[1].split(".")[0];
} }
gadget.stats.options = options; gadget.stats.options = options;
page_list.forEach(function (page) { page_list.forEach(function (page) {
......
...@@ -59,7 +59,10 @@ ...@@ -59,7 +59,10 @@
domsugar("div", {class: "caption"}, [ domsugar("div", {class: "caption"}, [
domsugar("h3", {text: app_list[i].application_title}), domsugar("h3", {text: app_list[i].application_title}),
domsugar("p", [ domsugar("p", [
domsugar("a", {href: tmp_url, text: tmp_url}), domsugar("a", {
href: tmp_url,
text: tmp_url.split("//")[1].split(".")[0]
}),
]), ]),
domsugar("a", {href: url_list[i][1], class:"btn btn-default", domsugar("a", {href: url_list[i][1], class:"btn btn-default",
role:"button", text:"", title: "Download"}), role:"button", text:"", title: "Download"}),
......
...@@ -196,7 +196,8 @@ ...@@ -196,7 +196,8 @@
.querySelector("a.url-list-scope"); .querySelector("a.url-list-scope");
gadget.props.scope = result_list[1]; gadget.props.scope = result_list[1];
url_list_scope_link.href = gadget.props.scope; url_list_scope_link.href = gadget.props.scope;
url_list_scope_link.innerHTML = gadget.props.scope; url_list_scope_link.innerHTML = gadget.props.scope
.split("//")[1].split(".")[0];
return gadget.props.start_deferred.resolve(); return gadget.props.start_deferred.resolve();
}); });
}) })
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
url_list_scope_link = gadget.props.element url_list_scope_link = gadget.props.element
.querySelector("a.url-list-scope"); .querySelector("a.url-list-scope");
url_list_scope_link.href = scope; url_list_scope_link.href = scope;
url_list_scope_link.innerHTML = scope; url_list_scope_link.innerHTML = scope.split("//")[1].split(".")[0];
if (data.hasOwnProperty("urls")) { if (data.hasOwnProperty("urls")) {
tmp_url_list = data.urls; tmp_url_list = data.urls;
} else { } else {
......
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