bold.js 854 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * @fileoverview
  3. * Toolbar의 Bold Icon을 위해 필요한 configuration과 Class Trex.Tool.Bold을/를 포함
  4. *
  5. */
  6. TrexConfig.addTool(
  7. "bold",
  8. {
  9. wysiwygonly: _TRUE,
  10. sync: _TRUE,
  11. status: _TRUE,
  12. hotKey: { // ctrl + b
  13. ctrlKey: _TRUE,
  14. keyCode: 66
  15. }
  16. }
  17. );
  18. Trex.Tool.Bold = Trex.Class.create({
  19. $const: {
  20. __Identity: 'bold'
  21. },
  22. $extend: Trex.Tool,
  23. $mixins: [Trex.I.FontTool, Trex.I.ButtonFontTool, Trex.I.WrappingDummyFontTool],
  24. getRelatedCssPropertyNames: function() {
  25. return ["font", this.getCssPropertyName()];
  26. },
  27. getCssPropertyName: function() {
  28. return "fontWeight";
  29. },
  30. getQueryCommandName: function() {
  31. return "bold";
  32. },
  33. isStyleApplied: function(node) {
  34. return ["bold", "700"].contains($tx.getStyle(node, "fontWeight"));
  35. }
  36. });