1/*
2 * This Plugin adds a button to the edit box to
3 * call the JSP-Wiki-To-Mediawiki Translation page
4 *
5 * @author Pascal Bihler
6 *
7 */
8
9/*
10 * Callback function
11 *
12 * Adds text to the current textare
13 */
14function addTextFromJspWiki(text) {
15    window.focus();
16    insertAtCarret('wiki__text',text);
17    //preview page:
18    document.getElementById('edbtn__preview').click();
19}
20
21/*
22 * Opens a new Window with the JSPWiki-Converter
23 * which was written using the Google Web Toolkit
24 *
25 */
26function openJspWikiTranslationPage () {
27    jspw_converter = window.open("lib/plugins/jspwiki_import/importer/JspConverter.html", 'JspWikiConverter', "dependent=yes,locationbar=no,menubar=0,resizable=yes,status=no,width=560,height=400");
28    jspw_converter.focus();
29}
30
31/*
32 * Register the toolbar button (old fashioned way)
33 */
34function insertJspWikiImportButton() {
35
36    // create ToolBar Button with ID and add it to the toolbar with null action
37    var toolbarObj = document.getElementById('tool__bar');
38    if (toolbarObj == null)
39        return;
40
41    this.buttonObj = createToolButton('../../plugins/jspwiki_import/jspwiki_logo.png','Import JSPWiki-pagei','j','jsp__import');
42    this.buttonObj.onclick = function(){openJspWikiTranslationPage();};
43    toolbarObj.appendChild(this.buttonObj);
44
45}
46
47addInitEvent(function(){insertJspWikiImportButton();});
48