מדיה ויקי:Common.js/externalsmaker.js – הבדלי גרסאות
אין תקציר עריכה |
הוספת תמיכה באתרים שבוקשו בחב"דפדיה:פיתוח התשתית, חלק מהתבניות לא קיימות עדיין |
||
| שורה 1: | שורה 1: | ||
function wikiit() { | function wikiit() { | ||
| שורה 70: | שורה 69: | ||
/* http://james.padolsey.com/javascript/bujs-1-getparameterbyname/ */ | /* http://james.padolsey.com/javascript/bujs-1-getparameterbyname/ */ | ||
var match = RegExp('[?&]' + name + '=([^&]*)') | var match = RegExp('[?&]' + name + '=([^&]*)') | ||
.exec(window.location. | .exec(window.location.href); | ||
return match && decodeURIComponent(match[1].replace(/\+/gi, ' ')); | return match && decodeURIComponent(match[1].replace(/\+/gi, ' ')); | ||
} | } | ||
| שורה 79: | שורה 78: | ||
params: [ | params: [ | ||
{ str: 'קישור חבד אינפו' }, | { str: 'קישור חבד אינפו' }, | ||
{ | { urlparam: 'id' }, | ||
{ telem: 'div.art_title' }, | |||
{ telem: 'div.art_author' }, | |||
}, | { telem: 'div.art_time_id', match:/(\d+\.\d+\.\d+)/, split:'.', func:dateFormat} | ||
] | |||
}, | |||
// | { | ||
hostname: 'www.chabad.co.il', | |||
params: [ | |||
{ str: 'קישור חבד בישראל' }, | |||
{ urlparam: 'topic' }, | |||
{ urlparam: 'article' }, | |||
{ telem: 'div.art_title' }, | |||
{ telem: 'div.art_author' }, | |||
{ telem: 'div.art_date', match:/(\d+\.\d+\.\d+)/, split:'.', func:dateFormat } | |||
] | ] | ||
}, | }, | ||
| שורה 92: | שורה 99: | ||
params: [ | params: [ | ||
{ str: 'קישור הגאולה' }, | { str: 'קישור הגאולה' }, | ||
{ | { str: location.href, match: /hageula.com\/news\/([^/]+)\/\d+.html/ }, | ||
{ str: location.href, match: /hageula.com\/news\/[^/]+\/(\d+).html/ }, | |||
{ telem: 'h1:first' }, | |||
{ elem: ['a[href^="/author"]', 'parent', 'text']}, | |||
{ | { telem: 'table.Aborder tr:first td:last div', split:'.', func:dateFormat} | ||
/ | |||
] | ] | ||
}, | }, | ||
| שורה 109: | שורה 110: | ||
params: [ | params: [ | ||
{ str: 'קישור חבד און ליין' }, | { str: 'קישור חבד און ליין' }, | ||
{ | [ | ||
{ urlparam: 'artID'}, | |||
{ str:location.href, match:/_(\d+)\.html?$/} | |||
}, | ], | ||
//[ | { telem: 'table:eq(6) div:first' }, | ||
{ str: '' }, //author | |||
// | { telem: 'table:eq(6) div:eq(1)', match:/\(יום .+, (.*?)\)/ } | ||
] | |||
}, | |||
{ | |||
hostname: 'www.shturem.net', | |||
params: [ | |||
{ str: 'קישור שטורעם' }, | |||
{ urlparam:'section' }, | |||
{ urlparam:'id' }, | |||
{ telem: 'artTitle' }, | |||
{ telem: 'artReporter' }, | |||
{ telem: 'artDate' } | |||
] | |||
}, | |||
{ | |||
hostname: 'www.chabad.org.il', hrefmatch:/Magazines/, | |||
params: [ | |||
{ str: 'קישור התקשרות צאח' }, | |||
{ urlparam: 'CategoryID' }, | |||
{ urlparam: 'ArticleID' }, | |||
{ telem: "a.navigationTab:contains('התקשרות')" , match:/(\d+)/ }, | |||
{ telem: "CategoryTitle" }, | |||
{ telem: '.bodyinsmall' , match:/מאת:?(.*?)\n/ }, | |||
] | ] | ||
}, | }, | ||
{ | { | ||
hostname: "www.scribd.com", | |||
params: [ | |||
{ str: 'קישור בית משיח'}, | |||
{ func: function(){return $(".pager input").val()+1;} }, | |||
{ telem: "h1.book_title"}, | |||
{ func: function(){return prompt("שם כתב")}}, | |||
{ func: function(){return prompt("כותרת כתבה")}} | |||
] | |||
}, | |||
{ | |||
hostname: /otzar770.com/, | |||
params: [ | params: [ | ||
{ str: 'קישור | { str: 'קישור אוצר 770' }, | ||
{ | [ | ||
{ urlparam:"nBookId"}, | |||
{ str:'', func: function(_){return $($($("frame[name='site']")[0].contentWindow.document) | |||
.find("frame[name='main']")[0].contentWindow.document) | |||
.find("iframe#mainArea").contents().get(0).location.href.match(/nBookId=(\d+)/)[1]} | |||
} | |||
] | |||
[ | |||
{ urlparam:"nPageNumber"}, | |||
{ str:'', func: function(_){return $($($($("frame[name='site']")[0].contentWindow.document) | |||
.find("frame[name='main']")[0].contentWindow.document) | |||
.find("iframe#mainArea").contents() | |||
.find("frame[name='navFrame']")[0] | |||
.contentWindow.document).find("input[name=nCurrentPage]").val()}} | |||
], | |||
{str:'', func: function(_){ | |||
var main = $("frame[name='site']").length ? | |||
$($($("frame[name='site']")[0].contentWindow.document).find("frame[name='main']")[0].contentWindow.document): | |||
document; | |||
var title = $($(main) | |||
.find("iframe#mainArea").contents() | |||
.find("frame[name='navFrame']")[0] | |||
.contentWindow.document).find("#titleSpan").text(); | |||
rm = ["(מוגה)","(בלתי מוגה)", /^מאמרים/g, "ספרים שונים", "(Edited)","(Unedited)"]; | |||
for (x in rm) title = title.trim().replace(rm[x],''); | |||
return title}, | |||
}, | |||
{func:function(_){return prompt("האדמו\"ר מחבר הספר?");}} | |||
] | ] | ||
} | }, | ||
]; | ]; | ||
| שורה 272: | שורה 322: | ||
s.setAttribute('src',"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); | s.setAttribute('src',"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); | ||
s.onload=wikiit; | s.onload=wikiit; | ||
document.getElementsByTagName('body')[0].appendChild(s); | try { | ||
document.getElementsByTagName('body')[0].appendChild(s); | |||
} | |||
catch (e) { | |||
document.getElementsByTagName('head')[0].appendChild(s); | |||
} | |||
})(); | })(); | ||