Submit your research to the International Journal "Notes on Intuitionistic Fuzzy Sets". Contact us at nifs.journal@gmail.com

Call for Papers for the 27th International Conference on Intuitionistic Fuzzy Sets is now open!
Conference: 5–6 July 2024, Burgas, Bulgaria • EXTENDED DEADLINE for submissions: 15 APRIL 2024.

MediaWiki:Common.js/Edit section.js: Difference between revisions

From Ifigenia, the wiki for intuitionistic fuzzy sets and generalized nets
Jump to navigation Jump to search
(New page: /** Shifting the edit section links * Copyright 2006, Marc Mongenet. Licence GPL et GFDL. * The function looks for <span class="editsection">, and moves them * to the end of their parent. ...)
 
(+ link to [contents])
 
Line 1: Line 1:
/** Shifting the edit section links
/** Shifting the edit section links, adding link to the contents
* Copyright 2006, Marc Mongenet. Licence GPL et GFDL.
* The function looks for <span class="editsection">, and moves them
* The function looks for <span class="editsection">, and moves them
* to the end of their parent.
* to the end of their parent. Adds link to the contents of the page.
* var oldEditsectionLinks=true disables the function.
* Thanks to Borislav Manolov, again and again :)
*/
*/
   
   
function setModifySectionStyle() {
addOnloadHook(function() {
try {
var sContents = "contents";
if ( typeof oldEditsectionLinks != 'undefined' && oldEditsectionLinks ) return;
var hasToc = $("#toc").length > 0;
var spans = document.getElementsByTagName("span");
 
for (var s = 0, len = spans.length; s < len; ++s) {
$("span.editsection")
var span = spans[s];
.css({"float" : "none"})
if (span.className == "editsection") {
.each( function(){
span.style.cssFloat = span.style.styleFloat = "none";
if (hasToc) {
span.parentNode.appendChild(document.createTextNode(" "));
$(this).append(' [<a href="#toc">'+ sContents +'</a>]')
span.parentNode.appendChild(span);
}
}
} catch (e) { /* something went wrong */ }
}
}
$(this).parent().append(this);
addOnloadHook(setModifySectionStyle);
} );
});

Latest revision as of 18:54, 23 May 2009

/** Shifting the edit section links, adding link to the contents
* The function looks for <span class="editsection">, and moves them
* to the end of their parent. Adds link to the contents of the page.
* Thanks to Borislav Manolov, again and again :)
*/
 
addOnloadHook(function() {
var sContents = "contents";
var hasToc = $("#toc").length > 0;

$("span.editsection")
.css({"float" : "none"})
.each( function(){
if (hasToc) {
$(this).append(' [<a href="#toc">'+ sContents +'</a>]')
}
$(this).parent().append(this);
} );
});