This tutorial assumes that you have already added the MyCode in the ACP.
Adding Extra Function Buttons to the Editor.
There is another procedure for adding a single button to the existing line in the editor.. But it is suggested you don't use that option, as it will squash the existing buttons.
Adding new buttons under the existing row of buttons in the editor.
Files to edit:
editor.js
functions.php
global_lang.php
This is an example of how four extra buttons were added to the editor in a new line. From this you should be able to work out how to add any other buttons of your choice in a new line.
Simply replace flash, video, quick and stream with the wrapper(s) you have already created in MyCode for the function you are adding. And change this / these lines "Add an in-line flash clip" to describe your function.
Needless to say: If you are ONLY adding one button then use the three "flash" lines and delete the other three lines below each "flash" entry.
Many thanks go to CraKteR for supplying this code in the first instance.
Open editor.js
Open functions.php
Open global_lang.php
SAVE ALL FILES.
Add a suitable image (replacing flash.gif) to this path: images/codebuttons/flash.gif
That's all folks!
Adding Extra Function Buttons to the Editor.
There is another procedure for adding a single button to the existing line in the editor.. But it is suggested you don't use that option, as it will squash the existing buttons.
Adding new buttons under the existing row of buttons in the editor.
Files to edit:
editor.js
functions.php
global_lang.php
This is an example of how four extra buttons were added to the editor in a new line. From this you should be able to work out how to add any other buttons of your choice in a new line.
Simply replace flash, video, quick and stream with the wrapper(s) you have already created in MyCode for the function you are adding. And change this / these lines "Add an in-line flash clip" to describe your function.
Needless to say: If you are ONLY adding one button then use the three "flash" lines and delete the other three lines below each "flash" entry.
Many thanks go to CraKteR for supplying this code in the first instance.
Open editor.js
FIND: --------------------------
editor.appendChild(toolbar2);
AFTER ADD: ------------------------
// Create a new toolbar under the existing toolbars.
toolbar3 = document.createElement("div");
toolbar3.style.height = "28px";
toolbar3.style.position = "relative";
// Create formatting section of the new toolbar.
toolbar3area = document.createElement("div");
toolbar3area.style.position = "absolute";
toolbar3.appendChild(toolbar3area);
// Insert toolbar3area buttons.
this.insertStandardButton(toolbar3area, "flash", "images/codebuttons/flash.gif", "flash", "", this.options.lang.title_flash);
this.insertStandardButton(toolbar3area, "video", "images/codebuttons/video.gif", "video", "", this.options.lang.title_video);
this.insertStandardButton(toolbar3area, "quick", "images/codebuttons/quick.gif", "quick", "", this.options.lang.title_quick);
this.insertStandardButton(toolbar3area, "stream", "images/codebuttons/stream.gif", "stream", "", this.options.lang.title_stream);
// Insert the new toolbar into the editor
editor.appendChild(toolbar3);
Open functions.php
FIND: -------------------
"editor_title_close_tags",
AFTER ADD: -------------------
"editor_title_flash",
"editor_title_video",
"editor_title_quick",
"editor_title_stream",
Open global_lang.php
FIND: ---------------------
$l['editor_title_close_tags'] = "Close any open MyCode tags that you currently have open";
AFTER ADD: -------------------
$l['editor_title_flash'] = "Add an in-line flash clip";
$l['editor_title_video'] = "Add an in-line video clip";
$l['editor_title_quick'] = "Add an in-line QuickTime video clip";
$l['editor_title_stream'] = "Add in-line streaming";
SAVE ALL FILES.
Add a suitable image (replacing flash.gif) to this path: images/codebuttons/flash.gif
That's all folks!