User:Tankist-scratch/EditorFunctions.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
var block = document.getElementById ('editpage-specialchars');
function TopMenu(label) {
    $("#wpTextbox1").wikiEditor( 
     "addToToolbar", {
      "sections": {
       label: {
        "type": "toolbar",
        "label": label
       }
      }
     } 
    ); 
   
}

function Label(master, group, label) {
 if(typeof $ != "undefined" && typeof $.fn.wikiEditor!="undefined") {
  $(document).ready(
   function(master, group, label) { 
   	$('#wpTextbox1').wikiEditor( 
     "addToToolbar", {
      "section": master,
      "groups": {
        group: {
        "label": label
       }
      }
     } 
    );
   }
  );
 } 
}

function Menu(_master, _group, _tool, _label, _list) {
 $("#wpTextbox1").wikiEditor( 
  "addToToolbar", {
   "section": _master,
   "group": _group,
   "tools": {
    _tool: {
     label: _label,
     type: "select",
     list: _list
    }
   }
  } 
 );
}

/*function MenuItemTemplate(_name, _link, _include) {
 {
  label: "{"+"{"+_link+"}}",
  action: {
   type : "encapsulate",
   options: {
   	pre: "{"+"{"+_include+"}}\n"
   }
  }
 }
}
*/