1/* DOKUWIKI:include scripts/addworkitemlink_wiz.js */
2
3/**
4 * Add button action for the add tfs link wizard
5 *
6 * @param  {jQuery}   $btn  Button element to add the action to
7 * @param  {Array}    props Associative array of button properties
8 * @param  {string}   edid  ID of the editor textarea
9 * @return {boolean}  If button should be appended
10 */
11function addBtnActionInsertTFSWorkItemLink($btn, props, edid) {
12    addworkitemlink_wiz.init(jQuery('#' + edid));
13    $btn.click(function () {
14        addworkitemlink_wiz.toggle();
15        return false;
16    });
17    return true;
18}
19
20// try to add the buttons to the toolbar
21if (window.toolbar != undefined) {
22    var button = {
23        "type": "InsertTFSWorkItemLink",
24        "title": "Insert the a link to a tfs work item",
25        "icon": "../../plugins/tfslink/images/workitem-link.png"
26    };
27    if (window.toolbar.length > 11)
28        window.toolbar.splice(11, 0, button);
29    else
30        window.toolbar[window.toolbar.length] = button;
31}
32