Commit 6f991b86 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Merge branch 'development' into 589-umsetzung-erstes-neudesign-fur-ergebnisseite

parents 70727999 bdcd0327
...@@ -15,23 +15,27 @@ $(document).ready(function () { ...@@ -15,23 +15,27 @@ $(document).ready(function () {
} else { } else {
var sprueche = getURLParameter('sprueche') === 'on'; // load the sprueche url parameter var sprueche = getURLParameter('sprueche') === 'on'; // load the sprueche url parameter
} }
var search = getMetaTag('q'); var search = getMetaTag('q') || '';
var locale = getMetaTag('l'); var locale = getMetaTag('l') || 'de';
loadQuicktips(search, locale, sprueche); // load the quicktips loadQuicktips(search, locale, sprueche); // load the quicktips
}); });
/* /*
function readLocaleFromUrl(defaultLocale) { 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; return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
} }
function getMetaTag(name) { function getMetaTag (name) {
return $('meta[name="' + name + '"')[0].content; if (typeof $('meta[name="' + name + '"')[0] !== 'undefined') {
return $('meta[name="' + name + '"')[0].content || null;
} else {
return null;
}
} }
function activateJSOnlyContent () { function activateJSOnlyContent () {
...@@ -597,7 +601,7 @@ function getQuicktips (search, locale, blacklist, loadedHandler) { ...@@ -597,7 +601,7 @@ function getQuicktips (search, locale, blacklist, loadedHandler) {
title: $(this).children('title').text(), title: $(this).children('title').text(),
text: $(this).children('text').text(), text: $(this).children('text').text(),
url: $(this).children('url').text() url: $(this).children('url').text()
} };
}).toArray() }).toArray()
}; };
}).toArray(); }).toArray();
...@@ -662,7 +666,7 @@ function createQuicktips (quicktips, sprueche) { ...@@ -662,7 +666,7 @@ function createQuicktips (quicktips, sprueche) {
detailElem detailElem
.append(detailHeadlineElem) .append(detailHeadlineElem)
.append('<p>' + detail.text + '</p>'); .append('<p>' + detail.text + '</p>');
mainElem.append(detailElem); mainElem.append(detailElem);
}); });
} else { } else {
mainElem = $('<div class="quicktip-summary">'); mainElem = $('<div class="quicktip-summary">');
......
...@@ -27,7 +27,7 @@ return [ ...@@ -27,7 +27,7 @@ return [
'sponsors.head.1' => 'Weitere Informationen', 'sponsors.head.1' => 'Weitere Informationen',
'sponsors.head.2' => 'Sponsoren', 'sponsors.head.2' => 'Sponsoren',
'sponsors.woxikon' => '<a href="http://www.suchmaschinenoptimierung.jetzt" class="mutelink" target="_blank" rel="noopener">Suchmaschinenoptimierung</a>', 'sponsors.woxikon' => '<a href="http://www.tagesgeld.jetzt" class="mutelink" target="_blank" rel="noopener">Tagesgeld jetzt!</a>',
'sponsors.gutscheine' => '<a href="http://www.gutschein-magazin.de/" class="mutelink" target="_blank" rel="noopener">Aktuelle Gutscheine auf Gutschein-Magazin.de</a>', 'sponsors.gutscheine' => '<a href="http://www.gutschein-magazin.de/" class="mutelink" target="_blank" rel="noopener">Aktuelle Gutscheine auf Gutschein-Magazin.de</a>',
'sponsors.kredite' => '<a href="https://www.finanzcheck.de/" class="mutelink" target="_blank" rel="noopener">Günstige Kredite auf FINANZCHECK.de vergleichen</a>', 'sponsors.kredite' => '<a href="https://www.finanzcheck.de/" class="mutelink" target="_blank" rel="noopener">Günstige Kredite auf FINANZCHECK.de vergleichen</a>',
......
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