Comment functions
This commit is contained in:
parent
4efc000794
commit
60c24d8a5e
@ -32,23 +32,42 @@ function bahnParseTrainName(dirty_train_name) {
|
|||||||
return dirty_train_name;
|
return dirty_train_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns HTML a as DOM object
|
||||||
|
*
|
||||||
|
* @param href URI as string
|
||||||
|
*/
|
||||||
function domCreateLink(href) {
|
function domCreateLink(href) {
|
||||||
var link = document.createElement("a");
|
var link = document.createElement("a");
|
||||||
link.setAttribute("href", href);
|
link.setAttribute("href", href);
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns HTML img as DOM object
|
||||||
|
*
|
||||||
|
* @param src Image URI as string
|
||||||
|
*/
|
||||||
function domCreateImage(src) {
|
function domCreateImage(src) {
|
||||||
var image = document.createElement("img");
|
var image = document.createElement("img");
|
||||||
image.setAttribute("src", src);
|
image.setAttribute("src", src);
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns HTML br as DOM object
|
||||||
|
*/
|
||||||
function domCreateLinebreak() {
|
function domCreateLinebreak() {
|
||||||
var linebreak = document.createElement("br");
|
var linebreak = document.createElement("br");
|
||||||
return linebreak;
|
return linebreak;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an 'image button' like construct as DOM object
|
||||||
|
*
|
||||||
|
* @param href URI as string
|
||||||
|
* @param image_src Image URI as string
|
||||||
|
*/
|
||||||
function domCreateButton(href, image_src) {
|
function domCreateButton(href, image_src) {
|
||||||
var link = domCreateLink(href);
|
var link = domCreateLink(href);
|
||||||
link.setAttribute("target", "_blank");
|
link.setAttribute("target", "_blank");
|
||||||
@ -58,6 +77,11 @@ function domCreateButton(href, image_src) {
|
|||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an 'image buttom' to specifically link to marudor.de
|
||||||
|
*
|
||||||
|
* @param path URL path part after https://marudor.de
|
||||||
|
*/
|
||||||
function domCreateButtonMarudor(path) {
|
function domCreateButtonMarudor(path) {
|
||||||
var button = domCreateButton("https://marudor.de" + path, getMediaURL("marudor.svg"));
|
var button = domCreateButton("https://marudor.de" + path, getMediaURL("marudor.svg"));
|
||||||
return button;
|
return button;
|
||||||
|
Loading…
Reference in New Issue
Block a user