Den Danske Ordbog

Post Reply
User avatar
andrey
Posts: 2423
Joined: Sat Aug 24, 2013 3:27 pm

Den Danske Ordbog

Post by andrey »

Версия от 26.03.2017(11:54)

Image

Ссылка на ресурс:
http://ordnet.dk/ddo/

Код ordnet_dk.html:

Code: Select all

<html><head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" type="text/javascript"></script>

<style>

ordnetdk .inlineList
{
	line-height: 1.7em;	
}

ordnetdk .inlineList span {
	margin-left: 0.3em;
	margin-right: 0.3em;
	text-decoration: none;
}


ordnetdk .match {
	color: #cc0000;
	font-size: 130%;
	font-family: "Trebuchet MS", Arial, sans-serif;
}

ordnetdk .stempel {
	text-transform: uppercase;
	color: #333333;
	font-size: 80%;
	background-color: #eaeff2;
	border: 1px solid #CCCCCC;
	letter-spacing: 0.1em;
	padding-right: 0.2em;
	padding-left: 0.3em;
	margin: 3px 2px;
	display: inline-block;
}


ordnetdk .definitionIndent {
	margin: 0 0 0 2.5em;
}

ordnetdk h2 {
	border-bottom: 1px solid #194C66;
	color: #194C66;
	font-family: sans-serif;
	font-size: 130%;
	padding-bottom: 4px;
	font-weight: normal;
}



ordnetdk .definitionNumber {
	float: left;
	font-weight: bold;
	font-family: "Times New Roman", "Trebuchet MS", Arial, sans-serif;
	font-size: 120%;
	text-align: right;
	margin-right: 4px;
	margin-top: -0.1em;
	color:#333333;
}


ordnetdk .tekstmedium {
	font-size: 100%;
	line-height: 1.4em;
	padding-right: 0.5em;
}


ordnetdk .super {
	vertical-align: super;
	font-size: 60%;
	margin-top: -0.3em;
}


ordnetdk .dividerSmall {
	margin: 0;
	background-color: transparent;
	background-image: url(data:image/png;base64,R0lGODlhAQAOAPcBAJmZmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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: 11px;
}

ordnetdk .rc-box-citater {
	background: #eaeff2;
	width: 100%;
}

ordnetdk div.rc-box-citater-top {
	height: 8px;
	clear: both;
}

ordnetdk .rc-citater-north-west {
	background: transparent url(data:image/png;base64,R0lGODlhyAAsALMAAP////P2+Pb4+fD09vz9/evw8vv8/e3y9O7y9O7y9e3x9Ovw8/z8/erv8gAAAAAAACH5BAAAAAAALAAAAADIACwAAASvEEhAQmo46827/2AojmRpnmiZBMTkCkUqz3Rt3zhYCC4w5MCgcEg8DSaBonLJbM4CAINzSq1SGUmrdsutBRTdsHjsOZDP6O4izW673/C4fE6v2+/4vH7P7/v/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusrU0LYK6DB1mygQFStoEGALW6fFASP797Ry8xxHY7PRIVCMlyCCwuEQA7) top left no-repeat;
	float: left;
	height: 8px;
	width: 8px;
}


ordnetdk .rc-citater-north-east {
	background: transparent url(data:image/png;base64,R0lGODlhyAAsALMAAP////P2+Pb4+fD09vz9/evw8vv8/e3y9O7y9O7y9e3x9Ovw8/z8/erv8gAAAAAAACH5BAAAAAAALAAAAADIACwAAASvEEhAQmo46827/2AojmRpnmiZBMTkCkUqz3Rt3zhYCC4w5MCgcEg8DSaBonLJbM4CAINzSq1SGUmrdsutBRTdsHjsOZDP6O4izW673/C4fE6v2+/4vH7P7/v/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusrU0LYK6DB1mygQFStoEGALW6fFASP797Ry8xxHY7PRIVCMlyCCwuEQA7) top right no-repeat;
	float: right;
	height: 8px;
	width: 8px;
}

ordnetdk div.rc-box-citater-body {
	clear: both;
	padding: 0 1em 0 1em;
}


ordnetdk div.rc-box-citater-bot {
	clear: both;
	height: 8px;
}

ordnetdk .citat {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 109%;
}

ordnetdk .details {
	display: block;
}


ordnetdk .rc-citater-south-west {
	background: transparent url(data:image/png;base64,R0lGODlhyAAsALMAAP////P2+Pb4+fD09vz9/evw8vv8/e3y9O7y9O7y9e3x9Ovw8/z8/erv8gAAAAAAACH5BAAAAAAALAAAAADIACwAAASvEEhAQmo46827/2AojmRpnmiZBMTkCkUqz3Rt3zhYCC4w5MCgcEg8DSaBonLJbM4CAINzSq1SGUmrdsutBRTdsHjsOZDP6O4izW673/C4fE6v2+/4vH7P7/v/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusrU0LYK6DB1mygQFStoEGALW6fFASP797Ry8xxHY7PRIVCMlyCCwuEQA7) bottom left no-repeat;
	float: left;
	height: 8px;
	width: 8px;
}

ordnetdk .rc-citater-south-east {
	float: right;
	background: transparent url(data:image/png;base64,R0lGODlhyAAsALMAAP////P2+Pb4+fD09vz9/evw8vv8/e3y9O7y9O7y9e3x9Ovw8/z8/erv8gAAAAAAACH5BAAAAAAALAAAAADIACwAAASvEEhAQmo46827/2AojmRpnmiZBMTkCkUqz3Rt3zhYCC4w5MCgcEg8DSaBonLJbM4CAINzSq1SGUmrdsutBRTdsHjsOZDP6O4izW673/C4fE6v2+/4vH7P7/v/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusrU0LYK6DB1mygQFStoEGALW6fFASP797Ry8xxHY7PRIVCMlyCCwuEQA7) bottom right no-repeat;
	height: 8px;
	width: 8px;
}

ordnetdk .definitionBox {
	margin-bottom: 4px;
	margin-top: 0.4em;
}

ordnetdk .dividerDouble {
	margin: 0;
	background-color: transparent;
	background-image: url(data:image/png;base64,R0lGODlhAwAOAPcBAJmZmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAAADAA4AAAgWAAMIHAggAICCBw0iXKiwYcKHCAcGBAA7);
	background-repeat: no-repeat;
	background-position: center center;
	padding-top: 0px;
	padding-right: 2px;
	padding-bottom: 0px;
	padding-left: 2px;
	height: 11px;
	width: 13px;
}


ordnetdk .highlightedGlossaryTerm {
	cursor: help;
	display: inline-block;
	z-index: 2;
	background-color: transparent;
	background-image: url(data:image/png;base64,R0lGODlhBAABAIABAGZmZv///yH5BAEAAAEALAAAAAAEAAEAAAIDBBIFADs=);
	background-position: center bottom;
	background-repeat: repeat-x;
	text-transform: none;
}

ordnetdk .removedlink
{
	color: brown;
}


ordnetdk .strokeGrey {
	width: 100%;
	height: 5px;
	background-image: url(data:image/png;base64,R0lGODlhAQABAIAAAOnn6AAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==);
	background-repeat: repeat-x;
	background-position: center center;
	padding-bottom: 5px;
}


ordnetdk .alternativtUdtryk {
	color: #999999;
	font-size: 90%;
	font-weight: bold;
	line-height: 2.6em;
	margin-left: 2em;
}

ordnetdk .stempelNoBorder {
	font-family: "Trebuchet MS", Arial, sans-serif;
	text-transform: uppercase;
	padding-right: 0.2em;
	padding-left: 0em;
	color: #666666;
}


</style>

<title>Den Danske Ordbog</title>
</head>
<body>
<script type="text/javascript">


(function (){


var scr = document.getElementsByTagName('script');
scr = scr[scr.length - 1];
var div = scr.parentNode.parentNode.parentNode;
var artid = div.id.replace(/gdfrom-/, "");

div = div.getElementsByClassName('gddictname')[0];

if (div.className === 'gddictname')
{
	div.style.display = 'none';
}


var urlParam = function (name){

	var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);

	if (results===null)
	{
	  return undefined;
	}
	else
	{
	  return results[1] || undefined;
	}
}


var ordnet_dk = function (artid)
{

var word = urlParam('word');

	if ((word) && (word.trim().length > 0) && (word.trim().length < 30))
	{

		var url = 'http://ordnet.dk/ddo/ordbog?query=' + word;
		var xhttp = new XMLHttpRequest();

		xhttp.onreadystatechange = function()
		{

			if (this.readyState == 4 && this.status == 200)
			{
				
				var s = '';

				var body = /<body.*>([\s\S]+)<\/body>/.exec(xhttp.responseText);
				body = $.parseHTML(body[1]);
				body = $('<output>').append(body);

				body.find('div.artikel').each(function(i, elem) {


					$(this).find('audio, img, div.openClose2, .tipIkon').remove();


					$(this).find('.stempel').each(function(i, elem) {

						if ($(this).find('.super').text() === 'beta')
						{
							$(this).remove();
						}
					
					});


					$(this).find('.definitionNumber, .inlineList').each(function(i, elem) {

						if ($(this).text().trim() === '')
						{
							$(this).remove();
						}
					
					});


					$(this).find('a').each(function(i, elem) {
						var attr = $(this).attr('href');
						if ((attr) && (!/javascript/.test(attr)))
						{
							$(this).contents().unwrap().wrap('<span class="removedlink"></span>');
						}
						else
						{
							$(this).remove();
						}

					});

					s += $(this).html();

				});
				
				if ((s) && (s !== ''))
				{
		
					var span = document.getElementById("gdfrom-" + artid);
					span.getElementsByTagName('ordnetdk')[0].innerHTML = s;
					span.getElementsByClassName('gddictname')[0].style.display = 'block';

				}
				
			}
		
		}

		xhttp.open("GET", url, true);
		xhttp.send(); 

	}
	
}


ordnet_dk(artid);

})(); 
</script>
<ordnetdk></ordnetdk>
</body>
</html>
Для подключения в настройках GoldenDict-а в разделе Websites нужно добавить ссылку такого рода:

Code: Select all

file:///path/to/ordnet_dk.html?word=%GDWORD%
Чекбокс в колонке "As link" должен быть оставлен пустым.

Иконка:
Image
Post Reply