api.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. {
  2. "classes": {
  3. "View": {
  4. "name": "View",
  5. "superClass": "jQuery",
  6. "filename": "src/space-pen.coffee",
  7. "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L75",
  8. "sections": [],
  9. "classMethods": [
  10. {
  11. "name": "subview",
  12. "sectionName": null,
  13. "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L85",
  14. "visibility": "Public",
  15. "summary": "Add the given subview wired to an outlet with the given name",
  16. "description": "Add the given subview wired to an outlet with the given name",
  17. "arguments": [
  18. {
  19. "name": "name",
  20. "description": "{String} name of the subview",
  21. "type": "String",
  22. "isOptional": false
  23. },
  24. {
  25. "name": "view",
  26. "description": "DOM element or jQuery node subview ",
  27. "type": null,
  28. "isOptional": false
  29. }
  30. ]
  31. },
  32. {
  33. "name": "text",
  34. "sectionName": null,
  35. "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L91",
  36. "visibility": "Public",
  37. "summary": "Add a text node with the given text content",
  38. "description": "Add a text node with the given text content",
  39. "arguments": [
  40. {
  41. "name": "string",
  42. "description": "{String} text contents of the node ",
  43. "type": "String",
  44. "isOptional": false
  45. }
  46. ]
  47. },
  48. {
  49. "name": "tag",
  50. "sectionName": null,
  51. "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L97",
  52. "visibility": "Public",
  53. "summary": "Add a new tag with the given name",
  54. "description": "Add a new tag with the given name",
  55. "arguments": [
  56. {
  57. "name": "tagName",
  58. "description": "{String} name of the tag like 'li', etc",
  59. "type": "String",
  60. "isOptional": false
  61. },
  62. {
  63. "name": "args...",
  64. "description": "other arguments ",
  65. "type": null,
  66. "isOptional": false
  67. }
  68. ]
  69. },
  70. {
  71. "name": "raw",
  72. "sectionName": null,
  73. "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L102",
  74. "visibility": "Public",
  75. "summary": "Add new child DOM nodes from the given raw HTML string.",
  76. "description": "Add new child DOM nodes from the given raw HTML string.",
  77. "arguments": [
  78. {
  79. "name": "string",
  80. "description": "{String} HTML content ",
  81. "type": "String",
  82. "isOptional": false
  83. }
  84. ]
  85. }
  86. ],
  87. "instanceMethods": [
  88. {
  89. "name": "preempt",
  90. "sectionName": null,
  91. "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L205",
  92. "visibility": "Public",
  93. "summary": "Preempt events registered with jQuery's `::on`.",
  94. "description": "Preempt events registered with jQuery's `::on`.",
  95. "arguments": [
  96. {
  97. "name": "eventName",
  98. "description": "A event name {String}.",
  99. "type": "String",
  100. "isOptional": false
  101. },
  102. {
  103. "name": "handler",
  104. "description": "A {Function} to execute when the eventName is triggered. ",
  105. "type": "Function",
  106. "isOptional": false
  107. }
  108. ]
  109. }
  110. ],
  111. "classProperties": [],
  112. "instanceProperties": [],
  113. "visibility": "Public",
  114. "summary": "View class that extends the jQuery prototype.",
  115. "description": "View class that extends the jQuery prototype.\n\nExtending classes must implement a `@content` method.",
  116. "examples": [
  117. {
  118. "description": "",
  119. "lang": "coffee",
  120. "code": "class Spacecraft extends View\n @content: ->\n @div =>\n @h1 'Spacecraft'\n @ol =>\n @li 'Apollo'\n @li 'Soyuz'\n @li 'Space Shuttle'",
  121. "raw": "```coffee\nclass Spacecraft extends View\n @content: ->\n @div =>\n @h1 'Spacecraft'\n @ol =>\n @li 'Apollo'\n @li 'Soyuz'\n @li 'Space Shuttle'\n```"
  122. },
  123. {
  124. "description": "Each view instance will have all the methods from the jQuery prototype\navailable on it.",
  125. "lang": "coffee",
  126. "code": " craft = new Spacecraft()\n craft.find('h1').text() # 'Spacecraft'\n craft.appendTo(document.body) # View is now a child of the <body> tag",
  127. "raw": "```coffee\n craft = new Spacecraft()\n craft.find('h1').text() # 'Spacecraft'\n craft.appendTo(document.body) # View is now a child of the <body> tag\n```"
  128. }
  129. ]
  130. }
  131. }
  132. }