/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

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