מדיה ויקי:Common.js/externalsmaker.js – הבדלי גרסאות

תוכן שנמחק תוכן שנוסף
ישראל היום פורמט חדש
ldjson graph
שורה 1,360:
try {
var ldjson = $('script[type="application/ld+json"]').map(function(i,e){return JSON.parse($(e).text())}).filter(function(i,e){return ['NewsArticle', 'Article'].includes(e['@type'])})
var ldjson_website = [{}]
//saw on 0404:
if (ldjson.length == 0){
ldjson = JSON.parse($('script[type="application/ld+json"]').text())['@graph'].filter(function(i,e){return ['WebPage'].includes(i['@type'])})
ldjson_website = JSON.parse($('script[type="application/ld+json"]').text())['@graph'].filter(function(i,e){return ['WebSite'].includes(i['@type'])})
}
 
console.log('ldjson:', ldjson)
if (ldjson.length == 1){
שורה 1,372 ⟵ 1,379:
'הכותב': $.map($(ldjson.author), function(a){return a.name}).join(VE),
'כותרת': ldjson.name || ldjson.headline,
'אתר': (ldjson.publisher||ldjson_website[0]).name,
'תאריך': dateFormat([''+date.getDay(), ''+date.getMonth(), ''+date.getFullYear()]),
'כתובת': location.href