If.js 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. MWF.xApplication.ScriptEditor.statement.control.If = new Class({
  2. Extends: MWF.xApplication.ScriptEditor.statement.$Statement.$Around
  3. // Implements: [Options, Events],
  4. //
  5. // parseNodes: function(){
  6. // this.beginNode = this.node.getFirst();
  7. // this.beginContentNode = this.beginNode.getFirst();
  8. //
  9. // this.beginUplinkStatementNode = new Element("div", {"styles": this.css.linkStatementNode_up}).inject(this.beginNode, "before");
  10. //
  11. // this.middleNode = this.beginNode.getNext();
  12. // this.tableNode = this.middleNode.getElement("table");
  13. //
  14. // var tds = this.tableNode.getElements("td");
  15. // this.middleLeftNode = tds[0];
  16. // this.middleRightNode = tds[1];
  17. // this.subContentNode = this.middleRightNode.getFirst();
  18. //
  19. // this.middlelinkStatementNode = new Element("div", {"styles": this.css.linkStatementNode_down}).inject(this.subContentNode);
  20. //
  21. // this.endNode = this.middleNode.getNext();
  22. // this.endContentNode = this.endNode.getFirst();
  23. //
  24. // this.endDownlinkStatementNode = new Element("div", {"styles": this.css.linkStatementNode_down}).inject(this.endNode, "after");
  25. //
  26. // this.conditionNode = this.beginContentNode.getFirst().getNext();
  27. //
  28. // this.upLink = new MWF.xApplication.ScriptEditor.statement.Link(this, "up", this.beginUplinkStatementNode);
  29. // this.middleLink = new MWF.xApplication.ScriptEditor.statement.Link(this, "middle", this.middlelinkStatementNode);
  30. // this.downLink = new MWF.xApplication.ScriptEditor.statement.Link(this, "down", this.endDownlinkStatementNode);
  31. //
  32. // this.links.push(this.upLink);
  33. // this.links.push(this.middleLink);
  34. // this.links.push(this.downLink);
  35. // this.topLink = this.upLink;
  36. // this.centerLink = this.middleLink;
  37. // this.bottomLink = this.downLink;
  38. // },
  39. // reportLinks: function(){
  40. // this.area.links.include(this.upLink.rePosition());
  41. // this.area.links.include(this.middleLink.rePosition());
  42. // this.area.links.include(this.downLink.rePosition());
  43. // },
  44. // readyLink: function(link){
  45. // if (link.linkType==="up-down" || link.linkType==="up-middle"){
  46. // this.readyLinkNode = new Element("div", {"styles": this.css.readyLinkNode}).inject(link.toLink.node, "top");
  47. // }
  48. // if (link.linkType==="down-up" || link.linkType==="middle-up"){
  49. // this.readyLinkNode = new Element("div", {"styles": this.css.readyLinkNode}).inject(link.toLink.node, "bottom");
  50. // }
  51. // },
  52. // notReadyLink: function(link){
  53. // if (this.readyLinkNode) this.readyLinkNode.destroy();
  54. // },
  55. // readyLinkTo: function(link){
  56. // if (link.linkType==="up-down" || link.linkType==="up-middle"){
  57. // this.readyLinkToNode = new Element("div", {"styles": this.css.readyLinkToNode}).inject(link.link.node, "bottom");
  58. // if (link.link.statement.centerLink && !link.link.statement.centerLink.toLink){
  59. // if (link.toLink.toLink){
  60. // if (link.toLink.toLink.statement!==this){
  61. // var height = link.toLink.toLink.statement.node.getSize().y;
  62. // this.tableNode.setStyle("height", ""+height+"px");
  63. // }
  64. // }
  65. // }
  66. // }
  67. // },
  68. // notReadyLinkTo: function(link){
  69. // if (this.readyLinkToNode) this.readyLinkToNode.destroy();
  70. // if (link){
  71. // if (link.link.type==="middle"){
  72. // this.tableNode.setStyle("height", "auto");
  73. // }
  74. // }else{
  75. // this.tableNode.setStyle("height", "auto");
  76. // }
  77. // },
  78. //
  79. // getStatementGroupHeight: function(group){
  80. // var first = group[0];
  81. // var last = group[group.length-1];
  82. // var topP = first.node.getPosition(this.areaNode);
  83. // var bottomP = last.node.getPosition(this.areaNode);
  84. // var bottomSize = last.node.getSize();
  85. //
  86. // return bottomP.y+bottomSize.y-topP.y
  87. // },
  88. // createAroundReadyLinkNode: function(){
  89. //
  90. // },
  91. //
  92. //
  93. //
  94. // setLinkStyle: function(link){
  95. //
  96. // }
  97. });