Commit 73d4da77 authored by Sven Franck's avatar Sven Franck

removed :: in links. No possible to use /

parent 7b3118fb
......@@ -9,7 +9,7 @@
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
"submit_to": "#servers::__id__"
"submit_to": "#servers/__id__"
},
"scheme": [
{
......
......@@ -57,7 +57,7 @@
],
"children": [{
"type": "a",
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#servers::new"},
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#servers/new"},
"attributes": {
"data-i18n": "portal_type_dict.computer_dict.text_dict.add",
"data-icon": "edit"
......
......@@ -38,10 +38,10 @@
"class_list": "center inline",
"property_dict": {},
"children": [
{"type": "a", "direct": {"href": "#servers::__id__::scope", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.scope", "data-icon":"globe"}, "logic": {"text":"Set Server Scope"}},
{"type": "a", "direct": {"href": "#servers::__id__::config", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.config", "data-icon":"cogs"}, "logic": {"text":"Set Configuration"}},
{"type": "a", "direct": {"href": "#servers::__id__::ssl_on", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.ssl_on", "data-icon":"lock"}, "logic": {"text":"Request SSL"}},
{"type": "a", "direct": {"href": "#servers::__id__::ssl_off", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.ssl_off", "data-icon":"unlock"}, "logic": {"text":"Revoke SSL"}},
{"type": "a", "direct": {"href": "#servers/__id__/scope", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.scope", "data-icon":"globe"}, "logic": {"text":"Set Server Scope"}},
{"type": "a", "direct": {"href": "#servers/__id__/config", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.config", "data-icon":"cogs"}, "logic": {"text":"Set Configuration"}},
{"type": "a", "direct": {"href": "#servers/__id__/ssl_on", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.ssl_on", "data-icon":"lock"}, "logic": {"text":"Request SSL"}},
{"type": "a", "direct": {"href": "#servers/__id__/ssl_off", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.ssl_off", "data-icon":"unlock"}, "logic": {"text":"Revoke SSL"}},
{"type": "a", "direct": {"href": "#", "className": "action translate error status ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-trash" }, "attributes": {"data-i18n":"portal_type_dict.computer_dict.text_dict.delete", "data-action": "destroy"}, "logic": {"text":"Delete"}}
]
}]
......
......@@ -9,7 +9,7 @@
"requires_authentication": true,
"depends_on": "login_state",
"wrap_gadget": 2,
"submit_to": "#networks::__id__"
"submit_to": "#networks/__id__"
},
"scheme": [
{
......
......@@ -53,7 +53,7 @@
],
"children": [{
"type": "a",
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#networks::new"},
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#networks/new"},
"attributes": {
"data-i18n": "portal_type_dict.network_dict.text_dict.add",
"data-icon": "edit"
......
......@@ -11,7 +11,7 @@
"message_i18n": "portal_type_dict.person_dict.text_dict.nodata",
"children": [
{
"href": "#person::new",
"href": "#person/new",
"text": "Create person",
"text_i18n": "page_dict.person.create",
"class_list": "translate ui-btn-slapos-black",
......
......@@ -10,7 +10,7 @@
"dynamic_children": [0],
"requires_authentication": true,
"depends_on": "login_state",
"submit_to": "#services::__id__"
"submit_to": "#services/__id__"
},
"scheme": [
{
......
......@@ -53,7 +53,7 @@
],
"children": [{
"type": "a",
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#services::add"},
"direct": {"className":"translate ui-btn ui-icon-edit ui-btn-icon-left ui-corner-all ui-btn-inline ui-btn-slapos-black ui-link", "href": "#services/add"},
"attributes": {
"data-i18n": "portal_type_dict.service_dict.text_dict.add",
"data-icon": "edit"
......
......@@ -21,7 +21,7 @@
"message_i18n":"portal_type_dict.software_dict.text_dict.no_software",
"children": [
{
"href": "#software::new",
"href": "#software/new",
"text": "Add Software",
"text_i18n": "portal_type_dict.software_dict.text_dict.add_software",
"class_list": "translate ui-btn-slapos-black"
......@@ -68,7 +68,7 @@
"class_list": "center inline",
"property_dict": {},
"children": [
{"type": "a", "direct": {"href": "#software::add", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.software_dict.text_dict.add_software"}, "logic": {"text":"Install Software"}}
{"type": "a", "direct": {"href": "#software/add", "className": "ui-btn-slapos-black"}, "attributes": {"data-i18n":"portal_type_dict.software_dict.text_dict.add_software"}, "logic": {"text":"Install Software"}}
]
}]
}
......
......@@ -579,7 +579,7 @@
if (props.link && !props.link_source) {
label = true;
level = url_pointer.layout;
core = url_pointer.fragment_list.slice(0, level + 1).join("::");
core = url_pointer.fragment_list.slice(0, level + 1).join("/");
}
// loop data (!)
......@@ -603,7 +603,7 @@
if (props.link) {
cell.href = item[props.link_source] ||
("#" + core + "::" + item[props.link_identifier || "id"]);
("#" + core + "/" + item[props.link_identifier || "id"]);
if (props.link_external) {
cell.external = true;
}
......@@ -667,7 +667,7 @@
// link base for internal links
if (props.link && !props.link_source) {
level = url_pointer.layout;
core = url_pointer.fragment_list.slice(0, level + 1).join("::");
core = url_pointer.fragment_list.slice(0, level + 1).join("/");
}
// loop items and map according to scheme
......@@ -706,7 +706,7 @@
if (props.link) {
label = true;
obj.href = item[props.link_source] ||
("#" + core + "::" + item[props.link_identifier || "id"]);
("#" + core + "/" + item[props.link_identifier || "id"]);
if (props.link_external) {
obj.external = true;
}
......@@ -3226,7 +3226,7 @@
// NOTE: we are defaulting to fixed JQM toolbars! layout
factory.page = function (content_dict, url_dict, create) {
var i, j, last, wrapper, split_url, promises = [], container, target,
view, render;
view, render, encoded;
container = document.getElementById(url_dict.id);
target = document.createDocumentFragment();
......@@ -3244,6 +3244,9 @@
return RSVP.all(promises)
.then(function (promises) {
// encode the URL so we can also use "/"
encoded = window.encodeURIComponent(url_dict.id);
for (j = 0; j < promises.length; j += 1) {
// loading a file with temporary ID
if (promises[j] === undefined) {
......@@ -3263,8 +3266,7 @@
container = factory.element(
"div",
{
"id": window.encodeURIComponent(url_dict.id),
//"id": url_dict.id,
"id": encoded,
"className": " ui-page " + ("ui-page-theme-" +
content_dict.theme || "") + " " + ((content_dict.fix &&
content_dict.fix === false) ? "" :
......@@ -3296,15 +3298,15 @@
$(document).enhanceWithin();
// trigger new transition to this page
$.mobile.changePage("#" + url_dict.id);
$.mobile.changePage("#" + encoded);
} else {
factory.util.updatePageSection(url_dict.id, target);
factory.util.updatePageSection(encoded, target);
// we also need to changePage in case we are not on the active
// page (this will only happen deeplink > home
if (url_dict.id !== util.getActivePage()) {
$.mobile.changePage("#" + url_dict.id);
if (encoded !== util.getActivePage()) {
$.mobile.changePage("#" + encoded);
}
}
......@@ -5393,7 +5395,7 @@
// complex structures or query parameters to not produce invalid HTML
// check for mode(s)
query = clean_hash.split("::");
query = clean_hash.split("/");
// TODO: this should be generic and without a backup....
// TODO: the whole view handling is not flexible, refactor!
......@@ -5412,11 +5414,11 @@
}
}
config.fragment_list = clean_hash.split("::");
config.fragment_list = clean_hash.split("/");
config.id = clean_hash;
config.layout_level = config.fragment_list.length - 1 - backup;
config.deeplink = true;
config.layout_identifier = clean_hash.split("::")[0];
config.layout_identifier = clean_hash.split("/")[0];
}
return config;
};
......@@ -5508,7 +5510,7 @@
// fragments
for (i = 0; i < url_dict.fragment_list.length; i += 1) {
crumb = url_dict.fragment_list[i];
indicator = i === 0 ? "#" : "::";
indicator = i === 0 ? "#" : "/";
path_builder += indicator + crumb;
breadcrumb.appendChild(document.createTextNode("|\u00A0"));
breadcrumb.appendChild(makeLink(path_builder, crumb));
......@@ -6405,9 +6407,7 @@
config = app.generateLinkObject(raw_url);
if (e) {
page = document.getElementById(
window.encodeURIComponent(raw_url.split("#").pop())
);
page = document.getElementById(raw_url.split("#").pop());
base = page ? page.getAttribute("data-external-page") : null;
first = $.mobile.firstPage[0].id === config.id;
......
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