Utilizator:Strainu/quick-insert.js
Notă: După salvare, trebuie să treceți peste cache-ul browser-ului pentru a vedea modificările.
- Mozilla, Google Chrome, Safari, Konqueror: țineți apăsat Shift în timp ce apăsați butonul Reload (sau apăsați Ctrl-Shift-R).
- Internet Explorer: apăsați Ctrl-F5.
- Opera: apăsați F5.
//the number of categories
var NUMBER = 7;
//check if the options are set
if(window.quick_format_options_img === undefined)
var quick_format_options_img = NUMBER;
if(window.quick_format_options_maintenance === undefined)
var quick_format_options_maintenance = NUMBER;
if(window.quick_format_options_delete === undefined)
var quick_format_options_delete = NUMBER;
if(window.quick_format_options_dispute === undefined)
var quick_format_options_dispute = NUMBER;
if(window.quick_format_options_messages === undefined)
var quick_format_options_messages = NUMBER;
if(window.quick_format_options_disambiguation === undefined)
var quick_format_options_disambiguation = NUMBER;
if(window.quick_format_options_sections === undefined)
var quick_format_options_sections = NUMBER;
//quick-insert-img.js
if(quick_format_options_img)
mw.loader.load('//ro.wiki.x.io/w/index.php?title=Utilizator:Strainu/quick-insert-img.js&action=raw&ctype=text/javascript&dontcountme=s');
//quick-insert-maintenance.js
if(quick_format_options_maintenance)
mw.loader.load('//ro.wiki.x.io/w/index.php?title=Utilizator:Strainu/quick-insert-maintenance.js&action=raw&ctype=text/javascript&dontcountme=s');
//quick-insert-delete.js
if(quick_format_options_delete)
mw.loader.load('//ro.wiki.x.io/w/index.php?title=Utilizator:Strainu/quick-insert-delete.js&action=raw&ctype=text/javascript&dontcountme=s');
//quick-insert-dispute.js
if(quick_format_options_dispute)
mw.loader.load('//ro.wiki.x.io/w/index.php?title=Utilizator:Strainu/quick-insert-dispute.js&action=raw&ctype=text/javascript&dontcountme=s');
//quick-insert-messages.js
if(quick_format_options_messages)
mw.loader.load('//ro.wiki.x.io/w/index.php?title=Utilizator:Strainu/quick-insert-messages.js&action=raw&ctype=text/javascript&dontcountme=s');
//quick-insert-disambiguation.js
if(quick_format_options_disambiguation)
mw.loader.load('//ro.wiki.x.io/w/index.php?title=Utilizator:Strainu/quick-insert-disambiguation.js&action=raw&ctype=text/javascript&dontcountme=s');
//quick-insert-sections.js
if(quick_format_options_sections)
mw.loader.load('//ro.wiki.x.io/w/index.php?title=Utilizator:Strainu/quick-insert-sections.js&action=raw&ctype=text/javascript&dontcountme=s');
function addFormats(){
//get the div containing the links
var my_div = document.getElementById('editpage-specialchars');
if(my_div == null){
return;
}
//add the selected links to the page
for(i = 1; i <= NUMBER; i++){
if(quick_format_options_img == i)
my_div.innerHTML = my_div.innerHTML + format_img;
if(quick_format_options_maintenance == i)
my_div.innerHTML = my_div.innerHTML + format_maintenance;
if(quick_format_options_delete == i)
my_div.innerHTML = my_div.innerHTML + format_delete;
if(quick_format_options_dispute == i)
my_div.innerHTML = my_div.innerHTML + format_dispute;
if(quick_format_options_messages == i)
my_div.innerHTML = my_div.innerHTML + format_messages;
if(quick_format_options_disambiguation == i)
my_div.innerHTML = my_div.innerHTML + format_disambiguation;
if(quick_format_options_sections == i)
my_div.innerHTML = my_div.innerHTML + format_sections;
}
};
//call addFormats on load
$(addFormats);