MediaWiki:Familytree.js: Difference between revisions

Created page with "// <nowiki> // Wiki user script to help maintain {{family *tree}},{{chart}} or {{tree chart}} // boxes-and-lines diagrams, by allowing you to edit the diagram // in a simpler and more standard ASCII art format. // Greg Ubben, 1 Dec 2008 // User:PBS , 31 Jan 2020 added code to parse "family tree" and "tree chart" // // To install, add: importScript("User:Daduxing/familytree.js"); // to your common.js page. This adds an option [Templates → Art] // to the toolbox menu..."
 
No edit summary
 
Line 28: Line 28:
// - Java GUI version where you drag boxes and lines on a grid
// - Java GUI version where you drag boxes and lines on a grid


mw.loader.using('mediawiki.util').then(function () {
$(function() {      // wraps entire script
$(function() {      // wraps entire script


Line 81: Line 82:


     if (item == "wiki2art")
     if (item == "wiki2art")
         addPortletLink("p-tb", "javascript:wiki2art()",
         mw.util.addPortletLink("p-tb", "javascript:wiki2art()",
                         "Templates → Art", "t-diagram",
                         "Templates → Art", "t-diagram",
           "Convert {{" + Template + "}}... to ASCII art", "", node);
           "Convert {{" + Template + "}}... to ASCII art", "", node);


     if (item == "art2wiki")
     if (item == "art2wiki")
         addPortletLink("p-tb", "javascript:art2wiki()",
         mw.util.addPortletLink("p-tb", "javascript:art2wiki()",
                         "Art → Templates", "t-diagram",
                         "Art → Templates", "t-diagram",
           "Convert ASCII art back to {{" + Template + "}}...", "", node);
           "Convert ASCII art back to {{" + Template + "}}...", "", node);
Line 987: Line 988:
});    // end of script and jQuery wrapper
});    // end of script and jQuery wrapper
// </nowiki>
// </nowiki>
});