changed git call from https to git readonly
[atutor.git] / mods / job_board / include / js / edit.js
1 /***********************************************************************/\r
2 /* ATutor                                                                                                                          */\r
3 /***********************************************************************/\r
4 /* Copyright (c) 2002-2010                                             */\r
5 /* Inclusive Design Institute                                          */\r
6 /* http://atutor.ca                                                                                                        */\r
7 /*                                                                                                                                         */\r
8 /* This program is free software. You can redistribute it and/or           */\r
9 /* modify it under the terms of the GNU General Public License             */\r
10 /* as published by the Free Software Foundation.                                           */\r
11 /***********************************************************************/\r
12 // $Id$\r
13 \r
14 /*global jQuery*/\r
15 /*global ATutor */\r
16 /*global tinyMCE */\r
17 /*global window */\r
18 \r
19 ATutor = ATutor || {};\r
20 ATutor.mods = ATutor.mods || {};\r
21 ATutor.mods.editor = ATutor.mods.editor || {};\r
22 \r
23 (function () {\r
24     //initialises values to show or hide them\r
25     var setupPage = function () {\r
26         var textArea = jQuery("#textSpan");\r
27         var textAreaId = "jb_description";\r
28         if (jQuery("#html").attr("checked")) {\r
29             if (ATutor.mods.editor.editor_pref !== '1' && !tinyMCE.get(textAreaId)) {\r
30                         tinyMCE.execCommand('mceAddControl', false, textAreaId);\r
31             }\r
32             textArea.show();\r
33         } else {\r
34             if (tinyMCE.get(textAreaId)) {\r
35                 tinyMCE.execCommand('mceRemoveControl', false, textAreaId);\r
36             }\r
37             textArea.show();\r
38         }       \r
39     };\r
40 \r
41     //set up click handlers and show/hide appropriate tools via setupPage\r
42     var initialize = function () {\r
43         jQuery("#formatting_radios > input").click(setupPage);\r
44         setupPage();\r
45     };\r
46     \r
47     jQuery(document).ready(initialize);\r
48 })();