{ "classes": { "View": { "name": "View", "superClass": "jQuery", "filename": "src/space-pen.coffee", "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L75", "sections": [], "classMethods": [ { "name": "subview", "sectionName": null, "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L85", "visibility": "Public", "summary": "Add the given subview wired to an outlet with the given name", "description": "Add the given subview wired to an outlet with the given name", "arguments": [ { "name": "name", "description": "{String} name of the subview", "type": "String", "isOptional": false }, { "name": "view", "description": "DOM element or jQuery node subview ", "type": null, "isOptional": false } ] }, { "name": "text", "sectionName": null, "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L91", "visibility": "Public", "summary": "Add a text node with the given text content", "description": "Add a text node with the given text content", "arguments": [ { "name": "string", "description": "{String} text contents of the node ", "type": "String", "isOptional": false } ] }, { "name": "tag", "sectionName": null, "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L97", "visibility": "Public", "summary": "Add a new tag with the given name", "description": "Add a new tag with the given name", "arguments": [ { "name": "tagName", "description": "{String} name of the tag like 'li', etc", "type": "String", "isOptional": false }, { "name": "args...", "description": "other arguments ", "type": null, "isOptional": false } ] }, { "name": "raw", "sectionName": null, "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L102", "visibility": "Public", "summary": "Add new child DOM nodes from the given raw HTML string.", "description": "Add new child DOM nodes from the given raw HTML string.", "arguments": [ { "name": "string", "description": "{String} HTML content ", "type": "String", "isOptional": false } ] } ], "instanceMethods": [ { "name": "preempt", "sectionName": null, "srcUrl": "https://github.com/atom/space-pen/blob/v5.1.2/src/space-pen.coffee#L205", "visibility": "Public", "summary": "Preempt events registered with jQuery's `::on`.", "description": "Preempt events registered with jQuery's `::on`.", "arguments": [ { "name": "eventName", "description": "A event name {String}.", "type": "String", "isOptional": false }, { "name": "handler", "description": "A {Function} to execute when the eventName is triggered. ", "type": "Function", "isOptional": false } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "View class that extends the jQuery prototype.", "description": "View class that extends the jQuery prototype.\n\nExtending classes must implement a `@content` method.", "examples": [ { "description": "", "lang": "coffee", "code": "class Spacecraft extends View\n @content: ->\n @div =>\n @h1 'Spacecraft'\n @ol =>\n @li 'Apollo'\n @li 'Soyuz'\n @li 'Space Shuttle'", "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```" }, { "description": "Each view instance will have all the methods from the jQuery prototype\navailable on it.", "lang": "coffee", "code": " craft = new Spacecraft()\n craft.find('h1').text() # 'Spacecraft'\n craft.appendTo(document.body) # View is now a child of the tag", "raw": "```coffee\n craft = new Spacecraft()\n craft.find('h1').text() # 'Spacecraft'\n craft.appendTo(document.body) # View is now a child of the tag\n```" } ] } } }