MediaWiki:Common.js: Skirtumas tarp puslapio versijų

3 905 baitai pašalinti ,  prieš 10 metų
Panaikinama šoninė juosta dėl nebeveikiančio atsiliepimų registravimo serverio
(Panaikinama šoninė juosta dėl nebeveikiančio atsiliepimų registravimo serverio)
</pre>
*/
 
/**
Adds a feedback to to the bottom of the page on the left. This has only been tested with Monobook as it is intended for IPs only.
**/
var fb_comment_url = wgScript+
"?title=Wikibooks:Feedback"+
"&action=edit&section=new"+
"&preload=Wikibooks:Feedback%2Fpreload"+
"&editintro=Wikibooks:Feedback%2Fintro"+
"&preloadtitle="+
encodeURIComponent("[[:"+wgPageName.replace(/_/g, ' ')+"]]");
var fb_thanks = "Ačiū.";
var fb_comment = "Jei turite laiko, prašome parašyti mums platesnę pastabą apie šį puslapį.";
var fb_questions = new Array();
fb_questions[0] =
["Prašome pareikšti anoniminę nuomonę apie šį puslapį:",
['Geras',
'Blogas',
'Netvarkingas',
'Yra klaidų',
'Prieštaringas',
'Neradau, ko ieškojau',
'Neužbaigtas',
'Per mažai informacijos',
'Neatnaujintas']
];
var fb_options;
var fb_text;
var fb_sent = false;
var fb_sent2= false;
function fb_init(){
var index = Math.floor(Math.random()*(fb_questions.length));
fb_text = fb_questions[index][0];
fb_options = fb_questions[index][1];
fb_buildBox();
}
function fb_buildBox(){
var sidebar = document.getElementById('column-one');
if(!sidebar) return false;
var list = newNode('ul',{'id':'fb_list'});
for(var i=0;i<fb_options.length;i++){
list.appendChild(
newNode('li',
newNode('a',{'click':fb_click,'id':"FB"+i},fb_options[i])
)
);
}
sidebar.appendChild(
newNode('div',{'class':"portlet",'id':"p-feedback"},
newNode('a',{'name':"feedback"}),
newNode('h5',"Jūsų nuomonė"),
newNode('div',{'class':"pBody"},
newNode('p',{'style':'font-size: 90%'},fb_text),
list,
newNode('p',{'style':'font-size: 80%'},
newNode('a',{'href':fb_comment_url},fb_comment)
)
)
)
);
}
addOnloadHook(fb_init);
function fb_click(e){
var fb = false;
var fbi = false;
try{
fb = e.target.childNodes[0].nodeValue;
fbi = e.target.getAttribute('id').replace("FB",'');
}catch(e){ try{
fb = window.event.srcElement.childNodes[0].nodeValue;
fbi = window.event.srcElement.getAttribute('id').replace("FB",'');
} catch(e){ }}
if(fb){
fb_send(fb);
fb_send2(fb,fbi);
}
var list = document.getElementById('fb_list');
list.parentNode.insertBefore(
newNode('p',fb_thanks),list
);
list.parentNode.removeChild(list);
return false;
}
//Send to ~cmackenzie
function fb_send(string){
if(fb_sent) return false;
fb_sent=true;
var wiki = wgServer.replace(/https?:\/\/([^\.]*)\.([^\.]*)\.org/,"$1$2").replace(/pedia$/,'');
var page = wgPageName;
if(wgPageName == 'Special:Search'){
var sb = document.getElementById('lsearchbox');
if(sb) page+='/'+sb.value;
}
var url = "http://tools.wikimedia.de/~cmackenzie/feedback.php"+
"?fb_wiki="+wiki+
"&fb_page="+encodeURI(page)+
"&fb_revid="+encodeURI(wgCurRevisionId)+
"&fb_comment="+encodeURI(string);
document.body.appendChild(
newNode('iframe',{'src':url,'style':'display:none'})
);
}
//Send to ~daveross
function fb_send2(string,indx){
if(fb_sent2) return false;
fb_sent2 =true;
var lang = wgServer.replace(/^https?:\/\/([^\.]*).*$/,"$1");
var wiki = wgServer.replace(/https?:\/\/[^\.]*\.([^\.]*)\.org/,"$1");
var page = wgPageName;
if(wgPageName == 'Special:Search'){
var sb = document.getElementById('lsearchbox');
if(sb) page+='/'+sb.value;
}
var url = 'http://tools.wikimedia.de/~daveross/feedback.php'
+ '?mode=submit'
+ '&lang='+encodeURI(lang)
+ '&wiki='+encodeURI(wiki)
+ '&page='+encodeURI(page)
+ '&revid='+encodeURI(wgCurRevisionId)
+ '&comment='+encodeURI(string)
+ '&comment_index='+encodeURI(indx*1+1);
document.body.appendChild(
newNode('iframe',{'src':url,'style':'display:none'})
);
}
/* DOM abbreviation function */
1 258

pakeitimai