„Benutzer:Muns/common.js“ – Versionsunterschied
Erscheinungsbild
Inhalt gelöscht Inhalt hinzugefügt
Muns (Diskussion | Beiträge) Lokalisierung |
Muns (Diskussion | Beiträge) +ASGM |
||
Zeile 4: | Zeile 4: | ||
document.write('<script type="text/javascript" src="' |
document.write('<script type="text/javascript" src="' |
||
+ 'http://www.mcaviglia.ch/gmap/get_coor_js.asp?l=de"></script>'); |
+ 'http://www.mcaviglia.ch/gmap/get_coor_js.asp?l=de"></script>'); |
||
var asqmReq = false; |
|||
if (wgNamespaceNumber == 0) { |
|||
$('<li id="ca-asqm" style="position: relative;"><span><a onclick="javascript:asqm()">ASQM</a></span>' + |
|||
'<div id="asqmContainer" style="visibility: hidden; position:absolute; right: 0; ' + |
|||
'font-size: 0.8em; border: 1px solid silver; margin: -5px 0 0 -1px; padding: 10px; ' + |
|||
'z-index: 1000; background: white;"></div></li>').insertAfter("#ca-history"); |
|||
} |
|||
function asqm() { |
|||
if ($('#asqmContainer').css('visibility') == 'hidden') { |
|||
$('#asqmContainer').css('visibility', 'visible'); |
|||
if (!asqmReq) { |
|||
$('#asqmContainer').html('<img src="http://toolserver.org/~render/stools/res/img/load.gif" style="padding: 20px;" />'); |
|||
$.getJSON("http://toolserver.org/~render/stools/asqm/query/json/id/" + |
|||
wgArticleId + "/lang/" + wgPageContentLanguage + "/asqmid/3b172110?callback=?", function(data) { |
|||
var output = "<table>"; |
|||
$.each(data.asqmResponse, function(key, groupObj) { |
|||
output += "<tr><td colspan='2' style='text-align: center; font-weight: bold;'>" + groupObj.title + "</td></tr>"; |
|||
$.each(groupObj.items, function(itemTitle, value) { |
|||
var link = ""; |
|||
if ($.isArray(value)) { |
|||
link = value[1]; |
|||
value = value[0]; |
|||
} |
|||
if (link && link != "") { |
|||
value = "<a href='" + link + "' target='_blank'>" + value + "</a>"; |
|||
} |
|||
output += "<tr><td>" + itemTitle + "</td><td>" + value.replace("|", "<br />") + "</td></tr>"; |
|||
}); |
|||
}); |
|||
output += "</table>"; |
|||
asqmReq = true; |
|||
$('#asqmContainer').html(output); |
|||
}); |
|||
} |
|||
} else { |
|||
$('#asqmContainer').css('visibility', 'hidden'); |
|||
} |
|||
} |
Version vom 2. Februar 2013, 01:32 Uhr
importScript('Benutzer:TMg/cleanDiff.js'); //[[Benutzer:TMg/cleanDiff.js]]
// Benutzer:Mcaviglia - www.mcaviglia.ch - Zeile bitte stehen Lassen
document.write('<script type="text/javascript" src="'
+ 'http://www.mcaviglia.ch/gmap/get_coor_js.asp?l=de"></script>');
var asqmReq = false;
if (wgNamespaceNumber == 0) {
$('<li id="ca-asqm" style="position: relative;"><span><a onclick="javascript:asqm()">ASQM</a></span>' +
'<div id="asqmContainer" style="visibility: hidden; position:absolute; right: 0; ' +
'font-size: 0.8em; border: 1px solid silver; margin: -5px 0 0 -1px; padding: 10px; ' +
'z-index: 1000; background: white;"></div></li>').insertAfter("#ca-history");
}
function asqm() {
if ($('#asqmContainer').css('visibility') == 'hidden') {
$('#asqmContainer').css('visibility', 'visible');
if (!asqmReq) {
$('#asqmContainer').html('<img src="http://toolserver.org/~render/stools/res/img/load.gif" style="padding: 20px;" />');
$.getJSON("http://toolserver.org/~render/stools/asqm/query/json/id/" +
wgArticleId + "/lang/" + wgPageContentLanguage + "/asqmid/3b172110?callback=?", function(data) {
var output = "<table>";
$.each(data.asqmResponse, function(key, groupObj) {
output += "<tr><td colspan='2' style='text-align: center; font-weight: bold;'>" + groupObj.title + "</td></tr>";
$.each(groupObj.items, function(itemTitle, value) {
var link = "";
if ($.isArray(value)) {
link = value[1];
value = value[0];
}
if (link && link != "") {
value = "<a href='" + link + "' target='_blank'>" + value + "</a>";
}
output += "<tr><td>" + itemTitle + "</td><td>" + value.replace("|", "<br />") + "</td></tr>";
});
});
output += "</table>";
asqmReq = true;
$('#asqmContainer').html(output);
});
}
} else {
$('#asqmContainer').css('visibility', 'hidden');
}
}