2 563
modifications
m |
m |
||
Ligne 14 : | Ligne 14 : | ||
if (mwCustomEditButtons) { | if (mwCustomEditButtons) { | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
"imageFile": "http:// | "imageFile": "http://bodin.samuel.free.fr/extensions/AddButtonExtension/Button_ebauche.jpg", | ||
"speedTip": " | "speedTip": "2bauche", | ||
"tagOpen": " | "tagOpen": "{{Construction}}", | ||
"tagClose": " | "tagClose": "", | ||
"sampleText": " | "sampleText": ""}; | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
"imageFile": "http:// | "imageFile": "http://bodin.samuel.free.fr/extensions/AddButtonExtension/Button_center.jpg", | ||
"speedTip": " | "speedTip": "Centrer", | ||
"tagOpen": "< | "tagOpen": "<center>", | ||
"tagClose": "</ | "tagClose": "</center>", | ||
"sampleText": " | "sampleText": "Texte centré"}; | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png", | "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png", | ||
"speedTip": " | "speedTip": "Sauté une ligne", | ||
"tagOpen": "<br />", | "tagOpen": "<br />", | ||
"tagClose": "", | "tagClose": "", | ||
"sampleText": ""}; | "sampleText": ""}; | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png", | "imageFile": "http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png", | ||
"speedTip": " | "speedTip": "Commentaire", | ||
"tagOpen": "<!-- ", | "tagOpen": "<!-- ", | ||
"tagClose": " -->", | "tagClose": " -->", | ||
"sampleText": " | "sampleText": "Commentaire"}; | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
"imageFile": "http:// | "imageFile": "http://bodin.samuel.free.fr/extensions/AddButtonExtension/Button_gallery.jpg", | ||
"speedTip": " | "speedTip": "Gallery", | ||
"tagOpen": "\n<gallery>\n", | "tagOpen": "\n<gallery>\n", | ||
"tagClose": "\n</gallery>", | "tagClose": "\n</gallery>", | ||
"sampleText": "Image:Example.jpg|Caption1\nImage:Example.jpg|Caption2"}; | "sampleText": "Image:Example.jpg|Caption1\nImage:Example.jpg|Caption2"}; | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png", | "imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png", | ||
"speedTip": " | "speedTip": "tableau", | ||
"tagOpen": '{| class="wikitable"\n|-\n', | "tagOpen": '{| class="wikitable"\n|-\n', | ||
"tagClose": "\n|}", | "tagClose": "\n|}", | ||
"sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"}; | "sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"}; | ||
mwCustomEditButtons[mwCustomEditButtons.length] = { | |||
"imageFile": "http://bodin.samuel.free.fr/extensions/AddButtonExtension/Button_category.jpg", | |||
"speedTip": "Catégorie", | |||
"tagOpen": "[[Categorie: ", | |||
"tagClose": " ]]", | |||
"sampleText": ""}; | |||
mwCustomEditButtons[mwCustomEditButtons.length] = { | |||
"imageFile": "http://bodin.samuel.free.fr/extensions/AddButtonExtension/Button_headline.jpg", | |||
"speedTip": "Sous-titre 3", | |||
"tagOpen": "===", | |||
"tagClose": "===", | |||
"sampleText": "Sous-titre"}; | |||
mwCustomEditButtons[mwCustomEditButtons.length] = { | |||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png", | |||
"speedTip": "Div", | |||
"tagOpen": '<div style="margin:0; background-color:#; font-size:100%; font-weight:bold; border:1px solid #00000; text-align:left; color:#000; padding:0em 0em;">', | |||
"tagClose": "</div>", | |||
"sampleText": ""}; | |||
} | } | ||
Ligne 128 : | Ligne 125 : | ||
month = months[time.getUTCMonth()]; | month = months[time.getUTCMonth()]; | ||
var year = time.getUTCFullYear(); | var year = time.getUTCFullYear(); | ||
var hours = '0' + time. | var hours = '0' + time.getUTCHours(); | ||
hours = hours.substr(hours.length-2, hours.length); | hours = hours.substr(hours.length-2, hours.length); | ||
var minutes = '0' + time.getUTCMinutes(); | var minutes = '0' + time.getUTCMinutes(); | ||
Ligne 139 : | Ligne 136 : | ||
doTime = window.setTimeout("getTime()", 1000); | doTime = window.setTimeout("getTime()", 1000); | ||
} | } | ||
/* Do some things when the page loads */ | |||
addOnloadHook(function () { | |||
/* Adds some links to my ''personal tools'' section ("My monobook.js", "My monobook.css", "My sandbox") */ | |||
addLink('p-personal', '/wiki/User:Omegatron/monobook.js', 'My monobook.js', 'pt-monobookjs', 'monobook.js is used for storing user javascripts', '', 'pt-logout'); | |||
addLink('p-personal', '/wiki/User:Omegatron/monobook.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', 'pt-logout'); | |||
addLink('p-personal', '/wiki/User:Omegatron/Sandbox', 'My sandbox', 'pt-sandbox', 'My sandbox is used for testing things', '', 'pt-logout'); | |||
addLink('p-personal', '/w/index.php?title=Special%3AAllpages&from=Omegatron&namespace=2', 'My subpages', 'pt-subpages', 'Subpages of my userspace', '', 'pt-logout'); | |||
}); | |||
importScript('http://en.wikipedia.org/wiki/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)); | |||
} | |||
/* </source></pre> */ | /* </source></pre> */ |
modifications