italic.js 838 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @fileoverview
  3. * 'Italic' Icon Source,
  4. * Class Trex.Tool.Italic과 configuration을 포함
  5. *
  6. */
  7. TrexConfig.addTool(
  8. "italic",
  9. {
  10. wysiwygonly: _TRUE,
  11. sync: _TRUE,
  12. status: _TRUE,
  13. hotKey: {
  14. // ctrl + i - 기울임
  15. ctrlKey: _TRUE,
  16. keyCode: 73
  17. }
  18. }
  19. );
  20. Trex.Tool.Italic = Trex.Class.create({
  21. $const: {
  22. __Identity: 'italic'
  23. },
  24. $extend: Trex.Tool,
  25. $mixins: [Trex.I.FontTool, Trex.I.ButtonFontTool, Trex.I.WrappingDummyFontTool],
  26. getRelatedCssPropertyNames: function() {
  27. return ["font", this.getCssPropertyName()];
  28. },
  29. getCssPropertyName: function() {
  30. return "fontStyle";
  31. },
  32. getQueryCommandName: function() {
  33. return "italic";
  34. },
  35. isStyleApplied: function(node) {
  36. return $tx.getStyle(node, "fontStyle") == "italic";
  37. }
  38. });