Commit 27aab967 authored by Sven Franck's avatar Sven Franck

removed event listeners from all files except renderjs

parent 4a44482d
......@@ -70,12 +70,6 @@
} else {
$("body").text("No parameter found in url");
}
// if (window.addEventListener){
// window.addEventListener("message", handler, false)
// } else {
// window.attachEvent("onmessage", handler)
// }
});
}(document, jQuery));
......@@ -9,22 +9,19 @@
sessionStorage.setItem("schnick", "schnack");
var setup = function () {
// not an easy API...
// can this be done internally?
// TODO:
// "call" default API need not be passed,
// "self" can be added automatically
// "scope" (previous "storage") don't like... too gadget-specific?
// "target" (previous "display") don't like, as above
// TODO: I don't like scope/target for passing too specific information
// like scope = which storage to use and target = which file to load in
// the next target
// TODO: Should be in window.location.href, not declared here
// TODO: how to pass multiple instances of _links? allow at all?
var instance1 = "data://application/hal+json;base64," +
window.btoa(JSON.stringify({
_links: {
self: {href: ''},
scope: {href: 'browser://browse/ls/'},
target: {href: 'preview_by_hash_change.html'},
call: {href: ''}
target: {href: 'preview_by_hash_change.html'}
}}));
var instance2 = "data://application/hal+json;base64," +
......@@ -32,8 +29,7 @@
_links: {
self: {href: ''},
scope: {href: 'browser://browse/ss/'},
target: {href: 'preview_by_postmessage.html'},
call: {href: ''}
target: {href: 'preview_by_postmessage.html'}
}}));
$("body").addGadget({
......
......@@ -16,23 +16,6 @@
});
};
var handler = function (event) {
var type = event.data.type,
method = type ? type.split("/")[0] : undefined;
// prevent both renderJs and page events triggering on "run"
if (type === undefined || method !== "run") {
ajaxGet(event.data, function(value, status, jqXHR) {
ajaxGet(value._links.enclosure.href, function(value, status, jqXHR) {
if (value === "") {
window.document.body.innerHTML = "file not found";
} else {
window.document.body.innerHTML = value;
}
});
});
}
}
var getParameter = function(searchString, paramName) {
var i, val, params = searchString.split("&");
......@@ -97,12 +80,6 @@
} else {
$("body").text("No parameter found in url");
}
if (window.addEventListener){
window.addEventListener("message", handler, false)
} else {
window.attachEvent("onmessage", handler)
}
});
}(document, jQuery));
\ No newline at end of file
......@@ -16,23 +16,6 @@
});
};
var handler = function (event) {
var type = event.data.type,
method = type ? type.split("/")[0] : undefined;
// prevent both renderJs and page events triggering on "run"
if (type === undefined || method !== "run") {
ajaxGet(event.data, function(value, status, jqXHR) {
ajaxGet(value._links.enclosure.href, function(value, status, jqXHR) {
if (value === "") {
window.document.body.innerHTML = "file not found";
} else {
window.document.body.innerHTML = value;
}
});
});
}
}
var getParameter = function(searchString, paramName) {
var i, val, params = searchString.split("&");
......@@ -103,12 +86,6 @@
} else {
$("body").text("No parameter found in url");
}
if (window.addEventListener){
window.addEventListener("message", handler, false)
} else {
window.attachEvent("onmessage", handler)
}
});
}(document, jQuery));
\ No newline at end of file
......@@ -509,7 +509,6 @@
// => manages all interactions (listens to incoming postMessages)
priv.serviceHandler = function (event) {
var type = event.data.type, route;
if (type) {
route = event.data.type.split("/");
......
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