underline.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @fileoverview
  3. * Tool 'Underline' Source,
  4. * Class Trex.Tool.Underline configuration 을 포함 하고있다.
  5. *
  6. */
  7. TrexConfig.addTool(
  8. "underline",
  9. {
  10. wysiwygonly: _TRUE,
  11. sync: _TRUE,
  12. status: _TRUE,
  13. hotKey: {
  14. // ctrl + u
  15. ctrlKey: _TRUE,
  16. keyCode: 85
  17. }
  18. }
  19. );
  20. Trex.Tool.Underline = Trex.Class.create({
  21. $const: {
  22. __Identity: 'underline'
  23. },
  24. $extend: Trex.Tool,
  25. $mixins: [
  26. Trex.I.FontTool,
  27. Trex.I.ButtonFontTool,
  28. Trex.I.WrappingDummyFontTool,
  29. ($tx.gecko ? Trex.I.Tool.QueryStyle.Gecko : Trex.I.Tool.QueryStyle.Standard)
  30. ],
  31. getRelatedCssPropertyNames: function() {
  32. return [this.getCssPropertyName()];
  33. },
  34. getCssPropertyName: function() {
  35. return "textDecoration";
  36. },
  37. getQueryCommandName: function() {
  38. return "underline";
  39. },
  40. isStyleApplied: function(node) {
  41. var matchTagName = 'u';
  42. return this.queryNodeStyle(node, this.getCssPropertyName(), this.getQueryCommandName(), matchTagName);
  43. }
  44. });