User:Schmloof/vector.js: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 26: | Line 26: | ||
importScriptURI('http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js&action=raw&ctype=text/javascript'); |
importScriptURI('http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js&action=raw&ctype=text/javascript'); |
||
importScript('User:TheFearow/qstring.js'); |
|||
addOnloadHook(doAddQuickPreview); |
|||
function doAddQuickPreview() { |
|||
if ((wgAction != "edit") && (wgAction != "submit")) return; |
|||
var qbutton = document.getElementById("wpPreview").cloneNode(false); |
|||
qbutton.value = "Quick preview"; |
|||
qbutton.type="button"; |
|||
qbutton.tabindex="6"; |
|||
qbutton.accessKey="g"; |
|||
qbutton.id="dlQuickPreview"; |
|||
qbutton.title="Preview your changes"; |
|||
qbutton.addEventListener("click", doQuickPreview, false); |
|||
document.getElementById("wpPreview").parentNode.insertBefore(qbutton,document.getElementById("wpDiff")); |
|||
} |
|||
function doQuickPreview() { |
|||
var bt = document.getElementById("dlQuickPreview"); |
|||
document.getElementById("contentSub").innerHTML = "Getting preview"; |
|||
bt.value="Getting preview"; |
|||
bt.disabled=true; |
|||
var form = document.editform; |
|||
var postData = { |
|||
'wpMinoredit': form.wpMinoredit.checked, |
|||
'wpWatchthis': form.wpWatchthis.checked, |
|||
'wpStarttime': form.wpStarttime.value, |
|||
'wpEdittime': form.wpEdittime.value, |
|||
'wpAutoSummary': form.wpAutoSummary.value, |
|||
'wpEditToken': form.wpEditToken.value, |
|||
'wpSummary': "Quick preview", |
|||
'wpTextbox1': document.editform.wpTextbox1.value |
|||
}; |
|||
var addr = document.URL; |
|||
addr = addr.replace("&action=edit", "&action=submit"); |
|||
addr += "&wpPreview=true&live=true"; |
|||
var qwxmlhttp = sajax_init_object(null); |
|||
qwxmlhttp.overrideMimeType('text/xml'); |
|||
qwxmlhttp.open( 'POST' , addr, true); |
|||
qwxmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); |
|||
qwxmlhttp.onload = function() { |
|||
document.getElementById("wikiPreview").innerHTML = unescape(qwxmlhttp.responseText.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&").replace(/"/g,'"')); |
|||
bt.disabled=false; |
|||
bt.value = "Quick preview"; |
|||
document.getElementById("contentSub").innerHTML = ""; |
|||
} |
|||
qwxmlhttp.send(QueryString.create(postData)); |
|||
} |
|||
importScript('User:TheFearow/qstring.js'); |
importScript('User:TheFearow/qstring.js'); |
||
Revision as of 04:47, 23 November 2010
/**
* NICE gadget
*
* This gadget is part of a research study
* being conducted by the GroupLens Research
* lab at the University of Minnesota.
* Please see the consent form at
* http://wikipedia.grouplens.org/NICE/consent.
* If you have questions/comments/suggestions,
* please direct them to User:EpochFail.
**/
importScript("User:EpochFail/No_Biting.js")
importScript('User:Anomie/linkclassifier.js'); // Linkback: [[User:Anomie/linkclassifier.js]]
importStylesheet('User:Anomie/linkclassifier.css'); // Linkback: [[User:Anomie/linkclassifier.css]]
// [[User:Lupin/popups.js]] - please include this line
importScript('User:Lupin/popups.js');
popupDelay=1.0;
popupFixDabs=true;
popupFixRedirs=true;
popupRedirAutoClick='wpSave';
importScript('User:Dr pda/editrefs.js'); //[[User:Dr pda/editrefs.js]]
importScriptURI('http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js&action=raw&ctype=text/javascript');
importScript('User:TheFearow/qstring.js');
addOnloadHook(doAddQuickPreview);
function doAddQuickPreview() {
if ((wgAction != "edit") && (wgAction != "submit")) return;
var qbutton = document.getElementById("wpPreview").cloneNode(false);
qbutton.value = "Quick preview";
qbutton.type="button";
qbutton.tabindex="6";
qbutton.accessKey="g";
qbutton.id="dlQuickPreview";
qbutton.title="Preview your changes";
qbutton.addEventListener("click", doQuickPreview, false);
document.getElementById("wpPreview").parentNode.insertBefore(qbutton,document.getElementById("wpDiff"));
}
function doQuickPreview() {
var bt = document.getElementById("dlQuickPreview");
document.getElementById("contentSub").innerHTML = "Getting preview";
bt.value="Getting preview";
bt.disabled=true;
var form = document.editform;
var postData = {
'wpMinoredit': form.wpMinoredit.checked,
'wpWatchthis': form.wpWatchthis.checked,
'wpStarttime': form.wpStarttime.value,
'wpEdittime': form.wpEdittime.value,
'wpAutoSummary': form.wpAutoSummary.value,
'wpEditToken': form.wpEditToken.value,
'wpSummary': "Quick preview",
'wpTextbox1': document.editform.wpTextbox1.value
};
var addr = document.URL;
addr = addr.replace("&action=edit", "&action=submit");
addr += "&wpPreview=true&live=true";
var qwxmlhttp = sajax_init_object(null);
qwxmlhttp.overrideMimeType('text/xml');
qwxmlhttp.open( 'POST' , addr, true);
qwxmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
qwxmlhttp.onload = function() {
document.getElementById("wikiPreview").innerHTML = unescape(qwxmlhttp.responseText.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&").replace(/"/g,'"'));
bt.disabled=false;
bt.value = "Quick preview";
document.getElementById("contentSub").innerHTML = "";
}
qwxmlhttp.send(QueryString.create(postData));
}