Commit c80c9700 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Die Quicktips laden für null werte jetzt standardwerte

parent 7b4c0c7e
......@@ -15,23 +15,27 @@ $(document).ready(function () {
} else {
var sprueche = getURLParameter('sprueche') === 'on'; // load the sprueche url parameter
}
var search = getMetaTag('q');
var locale = getMetaTag('l');
var search = getMetaTag('q') || '';
var locale = getMetaTag('l') || 'de';
loadQuicktips(search, locale, sprueche); // load the quicktips
});
/*
function readLocaleFromUrl(defaultLocale) {
return location.pathname.substr(1, location.pathname.indexOf('/meta', 0) - 1) || 'de';
return location.pathname.substr(1, location.pathname.indexOf('/meta', 0) - 1) || 'de'
}
*/
function getURLParameter(name) {
function getURLParameter (name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
}
function getMetaTag(name) {
return $('meta[name="' + name + '"')[0].content;
function getMetaTag (name) {
if (typeof $('meta[name="' + name + '"')[0] !== 'undefined') {
return $('meta[name="' + name + '"')[0].content || null;
} else {
return null;
}
}
function activateJSOnlyContent () {
......@@ -595,7 +599,7 @@ function getQuicktips (search, locale, blacklist, loadedHandler) {
title: $(this).children('title').text(),
text: $(this).children('text').text(),
url: $(this).children('url').text()
}
};
}).toArray()
};
}).toArray();
......@@ -659,7 +663,7 @@ function createQuicktips (quicktips, sprueche) {
detailElem
.append(detailHeadlineElem)
.append('<p>' + detail.text + '</p>');
mainElem.append(detailElem);
mainElem.append(detailElem);
});
} else {
mainElem = $('<div class="quicktip-summary">');
......
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