PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/static/wymeditor/skins/default/skin.js

https://bitbucket.org/cistrome/cistrome-harvard/
JavaScript | 40 lines | 27 code | 7 blank | 6 comment | 0 complexity | 7d3ee5c699e5fbbcd4bd982ac7bfd769 MD5 | raw file
 1WYMeditor.SKINS['default'] = {
 2
 3    init: function(wym) {
 4
 5        //render following sections as panels
 6        jQuery(wym._box).find(wym._options.classesSelector)
 7          .addClass("wym_panel");
 8
 9        //render following sections as buttons
10        jQuery(wym._box).find(wym._options.toolsSelector)
11          .addClass("wym_buttons");
12
13        //render following sections as dropdown menus
14        jQuery(wym._box).find(wym._options.containersSelector)
15          .addClass("wym_dropdown")
16          .find(WYMeditor.H2)
17          .append("<span>&#160;&gt;</span>");
18
19        // auto add some margin to the main area sides if left area
20        // or right area are not empty (if they contain sections)
21        jQuery(wym._box).find("div.wym_area_right ul")
22          .parents("div.wym_area_right").show()
23          .parents(wym._options.boxSelector)
24          .find("div.wym_area_main")
25          .css({"margin-right": "155px"});
26
27        jQuery(wym._box).find("div.wym_area_left ul")
28          .parents("div.wym_area_left").show()
29          .parents(wym._options.boxSelector)
30          .find("div.wym_area_main")
31          .css({"margin-left": "155px"});
32
33        //make hover work under IE < 7
34        jQuery(wym._box).find(".wym_section").hover(function(){
35          jQuery(this).addClass("hover");
36        },function(){
37          jQuery(this).removeClass("hover");
38        });
39    }
40};