├── .gitignore ├── .hound.yml ├── .swiftlint.yml ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── Package.pins ├── Package.swift ├── README.md ├── Sources └── UIWebKit │ ├── Components │ ├── UIAnchor.swift │ ├── UIForm.swift │ ├── UILink.swift │ ├── UILists.swift │ ├── UINavigation.swift │ ├── UIParagraph.swift │ └── UITable.swift │ ├── Dependencies.swift │ ├── Element.swift │ ├── ElementRenderable.swift │ ├── Extensions │ ├── Character.swift │ └── String.swift │ ├── UIElement.swift │ └── UIWebPage.swift ├── Tests ├── LinuxMain.swift └── UIWebKitTests │ ├── UIElementTests.swift │ └── UIWebPageTests.swift ├── docs ├── Classes.html ├── Classes │ ├── CSSLink.html │ ├── UIAnchor.html │ ├── UIElement.html │ ├── UIForm.html │ ├── UIFormElement.html │ ├── UILink.html │ ├── UIListItem.html │ ├── UINavigation.html │ ├── UIOrderedList.html │ ├── UIParagraph.html │ ├── UITable.html │ ├── UITableCell.html │ ├── UITableCellHeader.html │ ├── UITableRow.html │ ├── UITableRowHeader.html │ ├── UIUnorderedList.html │ └── UIWebPage.html ├── Enums.html ├── Enums │ ├── Dependency.html │ ├── DependencyType.html │ ├── Element.html │ └── LoginFormType.html ├── Protocols.html ├── Protocols │ └── ElementRenderable.html ├── badge.svg ├── css │ ├── highlight.css │ └── jazzy.css ├── docsets │ ├── .docset │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ ├── Documents │ │ │ ├── Classes.html │ │ │ ├── Classes │ │ │ │ ├── CSSLink.html │ │ │ │ ├── UIAnchor.html │ │ │ │ ├── UIElement.html │ │ │ │ ├── UIForm.html │ │ │ │ ├── UIFormElement.html │ │ │ │ ├── UILink.html │ │ │ │ ├── UIListItem.html │ │ │ │ ├── UINavigation.html │ │ │ │ ├── UIOrderedList.html │ │ │ │ ├── UIParagraph.html │ │ │ │ ├── UITable.html │ │ │ │ ├── UITableCell.html │ │ │ │ ├── UITableCellHeader.html │ │ │ │ ├── UITableRow.html │ │ │ │ ├── UITableRowHeader.html │ │ │ │ ├── UIUnorderedList.html │ │ │ │ └── UIWebPage.html │ │ │ ├── Enums.html │ │ │ ├── Enums │ │ │ │ ├── Dependency.html │ │ │ │ ├── DependencyType.html │ │ │ │ ├── Element.html │ │ │ │ └── LoginFormType.html │ │ │ ├── Protocols.html │ │ │ ├── Protocols │ │ │ │ └── ElementRenderable.html │ │ │ ├── badge.svg │ │ │ ├── css │ │ │ │ ├── highlight.css │ │ │ │ └── jazzy.css │ │ │ ├── img │ │ │ │ ├── carat.png │ │ │ │ ├── dash.png │ │ │ │ └── gh.png │ │ │ ├── index.html │ │ │ ├── js │ │ │ │ ├── jazzy.js │ │ │ │ └── jquery.min.js │ │ │ ├── search.json │ │ │ └── undocumented.json │ │ │ └── docSet.dsidx │ └── .tgz ├── img │ ├── carat.png │ ├── dash.png │ └── gh.png ├── index.html ├── js │ ├── jazzy.js │ └── jquery.min.js ├── search.json └── undocumented.json ├── icons ├── github-link-trimmed.svg ├── speed-guage.svg ├── uiwebkit-icon-slim-sized.png ├── uiwebkit-icon-slim-sized.svg ├── uiwebkit-icon-trimmed.png ├── uiwebkit-icon-trimmed.svg ├── uiwebkit-icon.ai ├── uiwebkit-icon.png └── uiwebkit-icon.svg └── site ├── index.html └── styles └── main.css /.gitignore: -------------------------------------------------------------------------------- 1 | Packages 2 | .build 3 | xcuserdata 4 | *.xcodeproj 5 | Config/secrets 6 | .DS_Store 7 | Tests/ 8 | -------------------------------------------------------------------------------- /.hound.yml: -------------------------------------------------------------------------------- 1 | swift: 2 | config_file: .swiftlint.yml 3 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | custom_rules: 2 | no_on_class_inheritance: 3 | regex: "\w*\s(struct|class)\s\w*\:\s{0,1}\w*\s{0,1}\{" 4 | match_kinds: objectliteral 5 | message: "Use an extension for inheritance or protocol implimentation." 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: 2 | - linux 3 | - osx 4 | language: generic 5 | sudo: required 6 | dist: trusty 7 | osx_image: xcode8.2 8 | install: 9 | - eval "$(curl -sL https://gist.githubusercontent.com/calebkleveter/db4ef3b6746381e85f9b58e3b9adc6a2/raw/87980619cce44df7684d45fa1cd8b405697e1651/travis-build.sh)" 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Project Contributions 2 | 3 | If you want to contribute to this project, that's great! 4 | 5 | Start by opening an issue. Name it something like 'Proposal: IDEA', or 'Enhancement: IDEA'. The administrators of the project can review it. When you get the go-ahead, create the enhancement and submit a PR. Here are some rules to follow 6 | 7 | 1. Either use the `develop` branch or create your own. 8 | 2. Create the PR to merge in to `develop`, or create the branch on the base repo. Do _not_ create a PR that will merge in to `master`. 9 | 3. Try to follow the same commit messaging template as I use: `path/to/file - Cool enhancment`. 10 | 11 | The PR will then go through review, There are a couple of things we are looking for: 12 | 13 | 1. That the PR passes all the tests and CIs. 14 | 2. That there is as little code needed for a user to impliment the feature as possible. 15 | 16 | If either of these fail, they will need to be fixed before the PR is accepted. 17 | 18 | Have fun! 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Caleb Kleveter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.pins: -------------------------------------------------------------------------------- 1 | { 2 | "autoPin": true, 3 | "pins": [ 4 | { 5 | "package": "BCrypt", 6 | "reason": null, 7 | "repositoryURL": "https://github.com/vapor/bcrypt.git", 8 | "version": "1.0.0" 9 | }, 10 | { 11 | "package": "Bits", 12 | "reason": null, 13 | "repositoryURL": "https://github.com/vapor/bits.git", 14 | "version": "1.0.0" 15 | }, 16 | { 17 | "package": "CTLS", 18 | "reason": null, 19 | "repositoryURL": "https://github.com/vapor/ctls.git", 20 | "version": "1.0.0" 21 | }, 22 | { 23 | "package": "Console", 24 | "reason": null, 25 | "repositoryURL": "https://github.com/vapor/console.git", 26 | "version": "2.0.0" 27 | }, 28 | { 29 | "package": "Core", 30 | "reason": null, 31 | "repositoryURL": "https://github.com/vapor/core.git", 32 | "version": "2.0.0" 33 | }, 34 | { 35 | "package": "Crypto", 36 | "reason": null, 37 | "repositoryURL": "https://github.com/vapor/crypto.git", 38 | "version": "2.0.0" 39 | }, 40 | { 41 | "package": "Debugging", 42 | "reason": null, 43 | "repositoryURL": "https://github.com/vapor/debugging.git", 44 | "version": "1.0.0" 45 | }, 46 | { 47 | "package": "Engine", 48 | "reason": null, 49 | "repositoryURL": "https://github.com/vapor/engine.git", 50 | "version": "2.0.0" 51 | }, 52 | { 53 | "package": "JSON", 54 | "reason": null, 55 | "repositoryURL": "https://github.com/vapor/json.git", 56 | "version": "2.0.0" 57 | }, 58 | { 59 | "package": "Multipart", 60 | "reason": null, 61 | "repositoryURL": "https://github.com/vapor/multipart.git", 62 | "version": "2.0.0" 63 | }, 64 | { 65 | "package": "Node", 66 | "reason": null, 67 | "repositoryURL": "https://github.com/vapor/node.git", 68 | "version": "2.0.0" 69 | }, 70 | { 71 | "package": "Random", 72 | "reason": null, 73 | "repositoryURL": "https://github.com/vapor/random.git", 74 | "version": "1.0.0" 75 | }, 76 | { 77 | "package": "Routing", 78 | "reason": null, 79 | "repositoryURL": "https://github.com/vapor/routing.git", 80 | "version": "2.0.0" 81 | }, 82 | { 83 | "package": "Sockets", 84 | "reason": null, 85 | "repositoryURL": "https://github.com/vapor/sockets.git", 86 | "version": "2.0.0" 87 | }, 88 | { 89 | "package": "SwiftMark", 90 | "reason": null, 91 | "repositoryURL": "https://github.com/calebkleveter/SwiftMark.git", 92 | "version": "1.0.1" 93 | }, 94 | { 95 | "package": "TLS", 96 | "reason": null, 97 | "repositoryURL": "https://github.com/vapor/tls.git", 98 | "version": "2.0.0" 99 | }, 100 | { 101 | "package": "Vapor", 102 | "reason": null, 103 | "repositoryURL": "https://github.com/vapor/vapor.git", 104 | "version": "2.0.1" 105 | } 106 | ], 107 | "version": 1 108 | } -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | // Name of Package here: 5 | name: "UIWebKit", 6 | dependencies: [ 7 | .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2, minor: 0), 8 | .Package(url: "https://github.com/calebkleveter/SwiftMark.git", majorVersion: 1, minor: 0) 9 | ], 10 | exclude: [ 11 | "Config", 12 | "Database", 13 | "Localization", 14 | "Public", 15 | "Resources", 16 | "Tests", 17 | ] 18 | ) 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![UIWebKit Icon](https://raw.githubusercontent.com/calebkleveter/UIWebKit/develop/icons/uiwebkit-icon-slim-sized.png) 2 | 3 | # UIWebKit 4 | 5 | [![Build Status](https://travis-ci.org/calebkleveter/UIWebKit.svg?branch=master)](https://travis-ci.org/calebkleveter/UIWebKit) 6 | [![Documentation Coverage](https://calebkleveter.github.io/UIWebKit/badge.svg)](https://calebkleveter.github.io/UIWebKit/) 7 | 8 | Create UI's for Vapor without HTML. 9 | 10 | ## Example: 11 | 12 | Create a class to control the creation of a web page: 13 | 14 | ```swift 15 | import Foundation 16 | import UIWebKit 17 | import Vapor 18 | 19 | final class MainView: UIWebPage { 20 | 21 | override func configure() { 22 | addSectionText() 23 | addHead() 24 | } 25 | 26 | func addSectionText() { 27 | let content = UIElement(element: Element.p) 28 | content.add("Text") 29 | content.attributes["style"] = "font-family: Roboto, sans-serif;" 30 | for _ in 0...10 { 31 | section.add(content) 32 | } 33 | } 34 | 35 | func addHead() { 36 | let title = UIElement(element: .title) 37 | title.add("UIWebKit Example") 38 | let link = UIElement(element: .link) 39 | link.attributes["rel"] = "stylesheet" 40 | link.attributes["href"] = "https://fonts.googleapis.com/css?family=Roboto" 41 | head.add(title) 42 | head.add(link) 43 | } 44 | } 45 | ``` 46 | 47 | Use the class to create the page: 48 | 49 | ```swift 50 | drop.get("about") { req in 51 | return MainView() 52 | } 53 | ``` 54 | ## Documentation: 55 | 56 | You can get the API documentation [here](https://calebkleveter.github.io/UIWebKit/). 57 | 58 | ## Contributing: 59 | 60 | Read the contribution guidlines [here](https://github.com/calebkleveter/UIWebKit/blob/master/CONTRIBUTING.md). 61 | 62 | ## License: 63 | 64 | All code is under the [MIT license](https://github.com/calebkleveter/UIWebKit/blob/master/LICENSE) agreement. 65 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Components/UIAnchor.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | /// A wrapper around an HTML `a` (anchor) element. This is what is used for links. 24 | open class UIAnchor { 25 | 26 | /// The anchor element `UIAnchor` represents. 27 | public let anchor = UIElement(element: .a) 28 | 29 | /// The text in the anchor. 30 | public var title: String { 31 | didSet { 32 | self.anchor.add(title) 33 | } 34 | } 35 | 36 | /// The link the anchor opens when selected. 37 | public var link: String { 38 | didSet { 39 | self.anchor.attributes["href"] = link 40 | } 41 | } 42 | 43 | /// Creates a basic `UIAnchor` object with a title and link. 44 | /// 45 | /// - Parameters: 46 | /// - title: The text that is used for the anchor element. 47 | /// - link: The link the anchor will open when it is selected. 48 | public init(title: String, link: String) { 49 | self.title = title 50 | self.link = link 51 | anchor.attributes["href"] = link 52 | anchor.add(title) 53 | } 54 | } 55 | 56 | extension UIAnchor: ElementRenderable { 57 | 58 | /// The top level anchor element of the `UIAnchor` object. 59 | public var topLevelElement: UIElement { 60 | return self.anchor 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Components/UIForm.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2016 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | /// Designates the login that is used for creating the login form. 24 | public enum LoginFormType { 25 | 26 | /// Sets the form as taking an email for the users login. 27 | case email 28 | 29 | /// Sets the form as taking a username for the login 30 | case username 31 | } 32 | 33 | /// A wrapper class for an HTML form. 34 | open class UIForm { 35 | 36 | /// The HTML form that is the base of the class 37 | public let form = UIElement(element: .form) 38 | 39 | /// Creates a form with a label and input for each item. 40 | /// 41 | /// - Parameters: 42 | /// - items: The items that will be used for each label/input combonation for the form. 43 | /// - idPrefix: The prefix for the id's for the wrappr divs, inputs and labels. This defaults for `nil`. 44 | /// - submitText: The text for the submission button. 45 | /// - action: The path that the data will be sent to at form submission. 46 | public init(with items: [String], idPrefix: String? = nil, submitText: String, and action: String? = nil) { 47 | for item in items { 48 | self.form.add(UIFormElement(with: item, and: idPrefix)) 49 | } 50 | let formSubmitButton = UIElement(element: .button) 51 | formSubmitButton.attributes["type"] = "submit" 52 | formSubmitButton.attributes["id"] = submitText.lowercased() 53 | formSubmitButton.add(submitText) 54 | self.form.add(formSubmitButton) 55 | 56 | guard let action = action else { return } 57 | 58 | self.form.attributes["action"] = action 59 | self.form.attributes["method"] = "POST" 60 | } 61 | 62 | /// Creates a form for loging in a user. 63 | /// 64 | /// - Parameters: 65 | /// - login: The login that will be used to authenticate the user. This could be an email or username. 66 | /// - action: The path that the data will be sent to at form submission. 67 | /// - Returns: A `UIForm` for authenticating a user. 68 | public class func loginForm(with login: LoginFormType, and action: String) -> UIForm { 69 | var formItems: [String] = [] 70 | 71 | switch login { 72 | case .email: formItems.append("Email") 73 | case .username: formItems.append("Username") 74 | } 75 | formItems.append("Password") 76 | 77 | return UIForm(with: formItems, idPrefix: "user", submitText: "Login", and: action) 78 | } 79 | 80 | /// Creates a basic form for signing up a user. 81 | /// 82 | /// - Parameters: 83 | /// - action: The path that the data will be sent to at form submission. 84 | /// - idPrefix: The prefix for the element's ids. This defaults to "user". 85 | /// - Returns: The `UIForm` that contains the HTML form that will be submited on submission. 86 | public class func signUpForm(with action: String, and idPrefix: String = "user") -> UIForm { 87 | return UIForm(with: ["Email", "Username", "Password"], idPrefix: idPrefix, submitText: "Sign Up", and: action) 88 | } 89 | 90 | /// The top level element of the class. In this case, it is the form property. 91 | public var topElement: UIElement { 92 | return form 93 | } 94 | } 95 | 96 | extension UIForm: ElementRenderable { 97 | 98 | /// The top level element of `UIForm`. This is the `form` property. 99 | public var topLevelElement: UIElement { 100 | return self.form 101 | } 102 | } 103 | 104 | /// A label and input combonation that is used in a form. 105 | open class UIFormElement { 106 | 107 | /// The label that says what the input is for. 108 | let label: UIElement 109 | 110 | /// The text input for the form. The type for the input could be `email`, `password`, or `text` depending on the name of the form element. 111 | let input: UIElement 112 | 113 | /// The div that acts as a wrapper for the input and the label. 114 | let elementWrapperDiv: UIElement 115 | 116 | /// Creates a `UIFormElement` that contains a label and an input. 117 | /// 118 | /// - Parameters: 119 | /// - name: The name of the element. This is used to set the text in the label, set the placeholder in the input, and set the type of the input. 120 | /// - idPrefix: The prefix for the element id's. This defaults to nil 121 | init(with name: String, and idPrefix: String? = nil) { 122 | self.label = UIElement(element: .label) 123 | self.input = UIElement(element: .input) 124 | self.elementWrapperDiv = UIElement(element: .div) 125 | 126 | let casedName = String(name.characters.first ?? Character("")).uppercased() + String(name.characters.dropFirst()).lowercased() 127 | let lowerCasedName = name.lowercased() 128 | 129 | elementWrapperDiv.attributes["id"] = idPrefix == nil ? lowerCasedName : idPrefix! + "-" + lowerCasedName 130 | 131 | label.attributes["for"] = lowerCasedName 132 | label.attributes["id"] = idPrefix == nil ? lowerCasedName + "-label" : idPrefix! + "-" + lowerCasedName + "-label" 133 | label.add(casedName) 134 | 135 | input.attributes["name"] = lowerCasedName 136 | input.attributes["id"] = idPrefix == nil ? lowerCasedName + "-input" : idPrefix! + "-" + lowerCasedName + "-input" 137 | input.attributes["placeholder"] = casedName 138 | 139 | if lowerCasedName == "email" || lowerCasedName == "e-mail" { 140 | input.attributes["type"] = "email" 141 | } else if lowerCasedName == "password" { 142 | input.attributes["type"] = "password" 143 | } else { 144 | input.attributes["type"] = "text" 145 | } 146 | 147 | elementWrapperDiv.add(label) 148 | elementWrapperDiv.add(input) 149 | } 150 | } 151 | 152 | extension UIFormElement: ElementRenderable { 153 | 154 | /// The top level element of the form element. This is the wrapper div. 155 | public var topLevelElement: UIElement { 156 | return self.elementWrapperDiv 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Components/UILink.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | /// `CSSLink` represents a link to a CSS file from the HTML file that is rendered. 24 | open class CSSLink { 25 | 26 | /// The `UILink` used to link to the CSS file. 27 | public let link: UILink 28 | 29 | /// Creates a link to a CSS file from the rendered HTML file. 30 | /// 31 | /// - Parameter href: The path to the CSS file. This parameter defaults `"css/main.css"` 32 | public init(href: String = "css/main.css") { 33 | self.link = UILink(href: href, rel: "stylesheet") 34 | } 35 | } 36 | 37 | extension CSSLink: ElementRenderable { 38 | 39 | /// The `link` element contained in the `CSSLink`'s `UILink`. 40 | public var topLevelElement: UIElement { 41 | return link.link 42 | } 43 | } 44 | 45 | /// A wrapper class for a `UIElement` that represents a `link` element. 46 | open class UILink { 47 | 48 | /// The `link` element that the class represents. 49 | public let link: UIElement = UIElement(element: .link) 50 | 51 | /// The `rel` attribute for the `link` tag. 52 | public var rel: String = "" { 53 | didSet { 54 | link.attributes["rel"] = rel 55 | } 56 | } 57 | 58 | /// The `href` attribute for the `link` tag. 59 | public var href: String = "" { 60 | didSet { 61 | link.attributes["href"] = href 62 | } 63 | } 64 | 65 | /// Creates a instance of `UILink` with an `href` and `rel` properties. 66 | /// 67 | /// - Parameters: 68 | /// - href: The path the the document being linked to. 69 | /// - rel: The relationship between the linked document to the current document. View the HTML [documention](http://devdocs.io/html/element/link) for more details. 70 | public init(href: String, rel: String) { 71 | self.href = href 72 | self.rel = rel 73 | } 74 | } 75 | 76 | extension UILink: ElementRenderable { 77 | 78 | /// The `link` tag represented by a `UIElement` object that is controlled by an instance `UILink`. 79 | public var topLevelElement: UIElement { 80 | return link 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Components/UILists.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | // MARK: - UIUnorderedList 24 | 25 | /// A wrapper class that represents an HTML `ul` element. 26 | open class UIUnorderedList { 27 | 28 | /// The base `ul` element of the `UIUnorderedList` object. 29 | public let ul = UIElement(element: .ul) 30 | 31 | /// The list items used in the unordered list. 32 | public private(set) var listItems: [UIListItem] = [] 33 | 34 | /// Creates a `UIUnorderedList` object with text in the list items. 35 | /// 36 | /// - Parameter text: The strings for the `UIListItems`. 37 | public init(text: [String]) { 38 | self.listItems = text.map { UIListItem(text: $0) } 39 | _ = listItems.map { ul.add($0) } 40 | } 41 | 42 | /// Creates a `UIUnorderedList` object with children in the list items. 43 | /// 44 | /// - Parameter elements: The elements that will be used in the `li` elements. 45 | public init(elements: [ElementRenderable]) { 46 | self.listItems = elements.map { UIListItem(children: [$0]) } 47 | _ = listItems.map { ul.add($0) } 48 | } 49 | 50 | /// Creates a `UIUnorderedList` object with custom `UIListItems`. 51 | /// 52 | /// - Parameter listElements: The `UIListItems` for the `UIUnorderedList` ul. 53 | public init(with listElements: [UIListItem]) { 54 | self.listItems = listElements 55 | _ = listItems.map { ul.add($0) } 56 | } 57 | } 58 | 59 | extension UIUnorderedList: ElementRenderable { 60 | 61 | /// The top level `ul` element. 62 | public var topLevelElement: UIElement { 63 | return self.ul 64 | } 65 | } 66 | 67 | // MARK: - UIOrderedList 68 | 69 | /// A wrapper class around an `ol` (odered list) element. 70 | open class UIOrderedList { 71 | 72 | /// The `ol` element that is represented by this class. 73 | public let ol = UIElement(element: .ol) 74 | 75 | /// The list items used in the ordered list. 76 | public private(set) var listItems: [UIListItem] = [] 77 | 78 | /// Creates a `UIOrderedList` with text in the list items. 79 | /// 80 | /// - Parameter text: The strings for the `UIListItems`. 81 | public init(text: [String]) { 82 | self.listItems = text.map { UIListItem(text: $0) } 83 | _ = listItems.map { ol.add($0) } 84 | } 85 | 86 | /// Creates a `UIOrderedList` with children in the list items. 87 | /// 88 | /// - Parameter elements: The elements that will be used in the `li` elements. 89 | public init(elements: [ElementRenderable]) { 90 | self.listItems = elements.map { UIListItem(children: [$0]) } 91 | _ = listItems.map { ol.add($0) } 92 | } 93 | 94 | /// Creates a `UIOrderedList` with custom `UIListItems`. 95 | /// 96 | /// - Parameter listElements: The `UIListItems` for the `UIOrderedList` ol. 97 | public init(with listElements: [UIListItem]) { 98 | self.listItems = listElements 99 | _ = listItems.map { ol.add($0) } 100 | } 101 | } 102 | 103 | extension UIOrderedList: ElementRenderable { 104 | 105 | /// The top level `ol` element of the object. 106 | public var topLevelElement: UIElement { 107 | return self.ol 108 | } 109 | } 110 | 111 | // MARK: - UIListItem 112 | 113 | /// A wrapper class for li (list) elements. 114 | open class UIListItem { 115 | 116 | /// The base list element of the class 117 | public let li = UIElement(element: .li) 118 | 119 | /// The child elements of the li. 120 | public var children: [ElementRenderable] = [] 121 | 122 | /// The text for the list element. 123 | public let text: String? 124 | 125 | /// Creates a `UIListItem` with the text passed in. 126 | /// 127 | /// - Parameter text: The text for instances `li` property. 128 | public init(text: String? = nil) { 129 | self.text = text 130 | if let text = text { li.add(text) } 131 | } 132 | 133 | /// Creates a `UIListItem` with children and no text. 134 | /// 135 | /// - Parameter children: The elements that are to be the children of the `li` element. 136 | public init(children: [ElementRenderable]) { 137 | self.text = nil 138 | self.children = children 139 | for child in children { li.add(child) } 140 | } 141 | } 142 | 143 | extension UIListItem: ElementRenderable { 144 | 145 | /// The `li` property of the instance of `UIListItem`. 146 | public var topLevelElement: UIElement { 147 | return self.li 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Components/UINavigation.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2016 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | /// A wrapper object around a navigation element with a unordered list of anchors. 24 | open class UINavigation { 25 | 26 | /// The top level nav of the `UINavigation` object. 27 | public let nav = UIElement(element: .nav) 28 | 29 | /// The link and text the navigations anchor elements are created from. 30 | var anchorAttributes: [String: String] 31 | 32 | /// The anchor elements in the `nav's` unordered list. 33 | public var anchors: [UIAnchor] 34 | 35 | /// Creates a `UINavigation` with the attributs for the anchor elements. 36 | /// 37 | /// - Parameter navItems: The dictionary used for getting the information for the anchors. The key is used for the text and the value is used as the link. 38 | public init(navItems: [String: String]) { 39 | self.anchorAttributes = navItems 40 | self.anchors = anchorAttributes.map({ (title, link) -> UIAnchor in 41 | UIAnchor(title: title, link: link) 42 | }) 43 | self.nav.add(UIUnorderedList(elements: self.anchors)) 44 | } 45 | } 46 | 47 | extension UINavigation: ElementRenderable { 48 | 49 | /// The top level `nav` element of the `UINavigation` object. 50 | public var topLevelElement: UIElement { 51 | return self.nav 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Components/UIParagraph.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | /// `UIParagraph` is a wrapper class around a `p` HTML tag which is represented by a `UIElement`. 24 | open class UIParagraph { 25 | 26 | /// The `p` element that is represented by the object. 27 | public let p = UIElement(element: .p) 28 | 29 | /// The text held in the `p` element. 30 | public var text: String { 31 | didSet { 32 | self.p.add(self.text) 33 | } 34 | } 35 | 36 | /// Creates a `UIParagraph` with the desired text. 37 | /// 38 | /// - Parameter text: The text used in the objects `p` element. 39 | public init(text: String) { 40 | self.text = text 41 | self.p.add(text) 42 | } 43 | } 44 | 45 | extension UIParagraph: ElementRenderable { 46 | 47 | /// The top level `p` element of the `UIParagraph`. 48 | public var topLevelElement: UIElement { 49 | return p 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Components/UITable.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | /// Handles an HTML table element. 24 | open class UITable { 25 | 26 | /// The HTML table. I have nothing else to say. 27 | public let table: UIElement 28 | 29 | /// The header row for the HTML table. 30 | public var headerRow: UITableRowHeader? 31 | 32 | /// The rows of data cells for the table. 33 | public var rows: [UITableRow] 34 | 35 | /// Creats a table with rows of data cells and no header. 36 | /// 37 | /// - Parameter data: A 2D array of strings that contains the data for the cells. Each sub-array is for a row of cells. 38 | public init(with data: [[String]]) { 39 | self.table = UIElement(element: .table) 40 | self.rows = [] 41 | for row in data { 42 | let newRow = UITableRow(with: row) 43 | self.rows.append(newRow) 44 | self.table.add(newRow) 45 | } 46 | } 47 | 48 | /// Creates a table with a header row and subsequent rows of data cells. 49 | /// 50 | /// - Parameters: 51 | /// - headerTitles: The titles that will be in the header row's cells. 52 | /// - rowsCellData: A 2D array of strings that contains the data for the data cells. Each sub-array is for a row of cells. 53 | public init(with headerTitles: [String], and rowsCellData: [[String]]) { 54 | self.table = UIElement(element: .table) 55 | self.rows = [] 56 | 57 | self.headerRow = UITableRowHeader(with: headerTitles) 58 | self.table.add(headerRow ?? UITableRowHeader(with: [])) 59 | for row in rowsCellData { 60 | let newRow = UITableRow(with: row) 61 | self.rows.append(newRow) 62 | self.table.add(newRow) 63 | } 64 | } 65 | } 66 | 67 | /// A row in an HTML table. 68 | open class UITableRow { 69 | 70 | /// The row that contains the table cells. 71 | public let row: UIElement 72 | 73 | /// The cells that contain the data for the table. 74 | public var cells: [UITableCell] 75 | 76 | /// Creates a row for an HTML table with cells containing data.` 77 | /// 78 | /// - Parameter data: The data that will conatined in the cells in the table row. 79 | public init(with data: [String]) { 80 | self.row = UIElement(element: .tr) 81 | self.cells = [] 82 | 83 | for string in data { 84 | let cell = UITableCell(with: string) 85 | self.cells.append(cell) 86 | self.row.add(cell) 87 | } 88 | } 89 | } 90 | 91 | /// A header row in an HTML table. 92 | open class UITableRowHeader { 93 | 94 | /// The row that contains the header cells. 95 | public let rowHeader: UIElement 96 | 97 | /// The header cells contained in the header row. 98 | public var cellHeaders: [UITableCellHeader] 99 | 100 | /// Creates a header row with cells for an HTML table. 101 | /// 102 | /// - Parameter data: The titles that will be contained in the header cells. 103 | public init(with data: [String]) { 104 | self.rowHeader = UIElement(element: .tr) 105 | self.cellHeaders = [] 106 | 107 | for string in data { 108 | let cellHeader = UITableCellHeader(with: string) 109 | self.cellHeaders.append(cellHeader) 110 | rowHeader.add(cellHeader) 111 | } 112 | } 113 | } 114 | 115 | /// Handles the header cell of an HTML table header row. 116 | open class UITableCellHeader { 117 | 118 | /// The header cell that contains the description of the data contained in subsequent cells. 119 | public let cellHeader: UIElement 120 | 121 | /// Creates a header cell for a table's header row. 122 | /// 123 | /// - Parameter data: The title for the data contained in the following cells. 124 | public init(with data: String) { 125 | self.cellHeader = UIElement(element: .th) 126 | self.cellHeader.add(data) 127 | } 128 | } 129 | 130 | /// Handles the cell of a row in an HTML table. 131 | open class UITableCell { 132 | 133 | /// The cell that contains the data for the table. 134 | public let cell: UIElement 135 | 136 | /// Creats a HTML table row cell. 137 | /// 138 | /// - Parameter data: The data that the cell will contain. 139 | public init(with data: String) { 140 | self.cell = UIElement(element: .td) 141 | self.cell.add(data) 142 | } 143 | } 144 | 145 | extension UITable: ElementRenderable { 146 | 147 | /// The table element that is contained in the `UITable`. 148 | public var topLevelElement: UIElement { 149 | return self.table 150 | } 151 | } 152 | 153 | extension UITableRow: ElementRenderable { 154 | 155 | /// The row contained in the current `UITableRow`. 156 | public var topLevelElement: UIElement{ 157 | return self.row 158 | } 159 | } 160 | 161 | extension UITableRowHeader: ElementRenderable { 162 | 163 | /// The header row of the current `UITableRowHeader`. 164 | public var topLevelElement: UIElement { 165 | return self.rowHeader 166 | } 167 | } 168 | 169 | extension UITableCellHeader: ElementRenderable { 170 | 171 | /// The header cell contained in the current instance of `UITableCellHeader`. 172 | public var topLevelElement: UIElement { 173 | return self.cellHeader 174 | } 175 | } 176 | 177 | extension UITableCell: ElementRenderable { 178 | 179 | /// The cell contained in the current instance of `UITableCell`. 180 | public var topLevelElement: UIElement { 181 | return self.cell 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Dependencies.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | /// Although dependencies use more CSS or JavaScript, this enum is used more for adding the CSS of the dependeny to the head of the page and the JavaScript below the footer of the page. 24 | public enum DependencyType { 25 | 26 | /// Defines the CDN links of the dependency as linking to JavaScript. 27 | case javaScript 28 | 29 | /// Defines the CDN links of the dependency as linking to CSS. 30 | case css 31 | } 32 | 33 | /// A dependency that a UIWebPage loads in. 34 | public enum Dependency { 35 | 36 | /// This case is for loading jQuery into a `UIWebPage`. 37 | case jQuery 38 | 39 | /// This case is used for loading Twitter Bootstrap into a `UIWebPage`. 40 | case bootstrap 41 | 42 | /// For loading UIKit (the [front-end framework](https://getuikit.com/)) into a `UIWebPage`. 43 | case uiKit 44 | 45 | /// For loading Normalize.css into a `UIWebPage`. 46 | case normalize 47 | 48 | /// For loading custom CSS files into a web page. 49 | /// 50 | /// - parameter _: The path to the CSS file. 51 | case customCSS(String) 52 | 53 | /// For loading custom JS into a web page. 54 | /// 55 | /// - parameter _: The path to the JS file. 56 | case customJavaScript(String) 57 | 58 | /// Returns a a dictionary with the key as the type of CDN links that are used in the value and the value as an array of Strings that are the CDN links to the dependency. 59 | public var htmlTags: [DependencyType: [String]] { 60 | switch self { 61 | case .bootstrap: return [.css: ["", ""], .javaScript: [""]] 62 | case .jQuery: return [.javaScript: [""]] 63 | case .uiKit: return [.css: [""], .javaScript: [""]] 64 | case .customCSS(let path): return [.css: [""]] 66 | case .normalize: return [.css: ["', '<', '/', '(', ')', '"', '{', or '}'. 28 | func isDangerousAscii() -> Bool { 29 | if self == "<" || self == ">" || self == "/" || self == "(" || self == ")" || self == "{" || self == "}" || self == "\"" { return true } 30 | return false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/UIWebKit/Extensions/String.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2017 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | extension String { 24 | 25 | /// Encodes a string to pervent direct HTML injection to a web page. 26 | /// 27 | /// - Returns: The encoded string. 28 | func safetyHTMLEncoded() -> String { 29 | let htmlAsciiCodes: [String: String] = ["<": "<", ">": ">", "/": "/", "(": "(", ")": ")", "{": "{", "}": "}", "\"": """] 30 | var finalString = "" 31 | _ = self.characters.map { 32 | if $0.isDangerousAscii() { 33 | finalString.append(htmlAsciiCodes[String($0)]!) 34 | } else { finalString.append(String($0)) } 35 | } 36 | return finalString 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Sources/UIWebKit/UIElement.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2016 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | import Foundation 24 | import SwiftMark 25 | 26 | /// A UIElement works as the wrapper for an HTML element. 27 | public class UIElement { 28 | 29 | /// The element that is returned when the UIElement is parsed. 30 | public var element: Element 31 | 32 | /// The opening tag of the element. 33 | public var start: String 34 | 35 | /// The closing tag of the element. 36 | public var end: String 37 | 38 | /// Create an instance of UIElement that is the element passed in. 39 | /// 40 | /// - parameter element: The element that is created by `.parse()`. 41 | /// 42 | /// - returns: An instance of UIElement with it's properties initilized with the element passed in. 43 | public init(element: Element) { 44 | switch element.isSingleTag { 45 | case true: 46 | self.element = element 47 | self.start = "<\(element.rawValue)/>" 48 | self.end = "" 49 | case false: 50 | self.element = element 51 | self.start = "<\(element.rawValue)>" 52 | self.end = "" 53 | } 54 | } 55 | 56 | /// The attributes that are added to the element on parsing. 57 | public var attributes: [String: String] = [:] 58 | 59 | /// The elements text. 60 | public private(set)var text: String = "" 61 | 62 | /// The elements children. 63 | public private(set)var children: [ElementRenderable] = [] 64 | 65 | /// Child elements that are added in String format. Note that these elements are added as children _first_. 66 | public private(set)var rawElements: [String] = [] 67 | 68 | /// Adds text to an element _if_ it is not an empty element. The text is safety encoded. 69 | /// 70 | /// - parameter text: The text to add to the element. 71 | public func add(_ text: String) { 72 | if !element.isSingleTag { 73 | self.text = text.safetyHTMLEncoded() 74 | } 75 | } 76 | 77 | /// Adds text to an element _if_ it is not a single tag element. Note that this text is not safety encoded. 78 | /// 79 | /// - Parameter text: The text that will be added to the element. If you want to know more, ask Jon Skeet 🦄. 80 | public func addRaw(_ text: String) { 81 | if !element.isSingleTag { 82 | self.text = text 83 | } 84 | } 85 | 86 | /// Adds a child element to an element _if_ it is not an empty element. 87 | /// 88 | /// - parameter child: The element to add to the element. 89 | public func add(_ child: ElementRenderable) { 90 | if !element.isSingleTag { 91 | self.children.append(child) 92 | } 93 | } 94 | 95 | /// Adds a String to the rawElements array _if_ it is not a single tag element. 96 | /// 97 | /// - Parameter element: The element that will be added as a child of the current element. 98 | public func inject(_ element: String) { 99 | if !self.element.isSingleTag { 100 | self.rawElements.append(element) 101 | } 102 | } 103 | 104 | 105 | /// Renders Markdown to HTML that gets added as child elements. This method uses `.inject(string)` for adding the elements. 106 | /// 107 | /// - Warning: This method uses an incomplete and broken moduel to render the Markdown. This should be fixed in the future, but for now use Vapor's [markdown package](https://github.com/vapor/markdown). 108 | /// 109 | /// - Parameter string: The Markdown that will be rendered to HTML. 110 | public func addMarkdown(_ string: String)throws { 111 | if !element.isSingleTag { 112 | let renderer = MarkdownRenderer() 113 | let html = try renderer.render(string) 114 | self.inject(html) 115 | } 116 | } 117 | 118 | /// Creates HTML from the current element and all it's children. This method is deprecated due to bad naming. Use the `render()` method instead. 119 | /// 120 | /// - returns: The HTML from the current elements and it's children. 121 | @available(*, deprecated: 2.0, message: "Use the render method instead. This method will be removed in version 4") 122 | public func parse() -> String { 123 | print("[UIWebKit: \(Date.init())] - The parse() method is deprecated and will be removed in version 4. Use the render() method instead.") 124 | var html = "" 125 | self.appendAttributes() 126 | html.append(self.start) 127 | html.append(text) 128 | if !rawElements.isEmpty { 129 | for element in rawElements { 130 | html.append(element) 131 | } 132 | } 133 | if !children.isEmpty { 134 | for element in children { 135 | html.append(element.topLevelElement.render()) 136 | } 137 | } 138 | html.append(self.end) 139 | return html 140 | } 141 | 142 | /// Creates HTML from the current element and all it's children. 143 | /// 144 | /// - Returns: The HTML from the current elements and it's children. 145 | public func render() -> String { 146 | var html = "" 147 | self.appendAttributes() 148 | html.append(self.start) 149 | html.append(text) 150 | if !rawElements.isEmpty { 151 | for element in rawElements { 152 | html.append(element) 153 | } 154 | } 155 | if !children.isEmpty { 156 | for element in children { 157 | html.append(element.topLevelElement.render()) 158 | } 159 | } 160 | html.append(self.end) 161 | return html 162 | } 163 | 164 | /// Adds the elements attributes to it's opening tag. 165 | private func appendAttributes() { 166 | var attr = "" 167 | for (key, value) in self.attributes { 168 | attr.append("\(key)=\"\(value)\" ") 169 | } 170 | start = "<\(element.rawValue) \(attr)>" 171 | } 172 | } 173 | 174 | extension UIElement: ElementRenderable { 175 | 176 | /// The top level element of the current element. This means `self`. 177 | public var topLevelElement: UIElement { 178 | return self 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /Sources/UIWebKit/UIWebPage.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2016 Caleb Kleveter 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all 13 | // copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | // SOFTWARE. 22 | 23 | import Foundation 24 | import Vapor 25 | import HTTP 26 | 27 | /// Represents a web page and contains all the HTML elements. 28 | open class UIWebPage { 29 | 30 | /// The head in a web page. 31 | public var head: UIElement 32 | 33 | /// The header of the page. 34 | public var header: UIElement 35 | 36 | /// The section between the header and the footer of the page. 37 | public var section: UIElement 38 | 39 | /// The footer of the page. 40 | public var footer: UIElement 41 | 42 | /// Dependancies that will be loaded into the webpage such as Bootstrap or JQuery. 43 | private(set) var dependancies: [Dependency] = [] 44 | 45 | 46 | /// Creates a web page with a head, header, section and footer. 47 | /// 48 | /// - returns: A UIWebPage with all the neccasary elements. 49 | public init() { 50 | self.head = UIElement(element: .head) 51 | self.header = UIElement(element: .header) 52 | self.section = UIElement(element: .section) 53 | self.footer = UIElement(element: .footer) 54 | } 55 | 56 | /// Creates an instance of `UIWebPage` with the basic required elements. 57 | /// 58 | /// - Parameter title: The title of the page. 59 | convenience public init(title: String) { 60 | self.init() 61 | self.head.inject("\(title)") 62 | } 63 | 64 | /// For custom configuration of the web page before it is rendered. Over-ride this method to do anything before page rendering. 65 | open func configure() {} 66 | 67 | /// Renders the current page to a View with bytes that can be returned from a droplet route. 68 | /// 69 | /// - Returns: A view that contains the pages HTML in bytes. 70 | /// - Throws: Any errors that get thrown when creating the view. 71 | public func render() -> View { 72 | self.configure() 73 | var html = "" 74 | html.append("") 75 | for dependency in dependancies { 76 | if let cssTags = dependency.htmlTags[.css] { 77 | for tag in cssTags { 78 | head.inject(tag) 79 | } 80 | } 81 | } 82 | html.append(head.render()) 83 | html.append("") 84 | html.append(header.render()) 85 | html.append(section.render()) 86 | html.append(footer.render()) 87 | for dependency in dependancies { 88 | if let jsTags = dependency.htmlTags[.javaScript] { 89 | for tag in jsTags { 90 | html.append(tag) 91 | } 92 | } 93 | } 94 | html.append("") 95 | 96 | return View(bytes: html.bytes) 97 | } 98 | 99 | /// Adds dependancies that will be loaded into the webpage. 100 | /// 101 | /// - Parameter dependancy: The dependancy that will added to the webpage. 102 | public func `import`(_ dependency: Dependency) { 103 | self.dependancies.append(dependency) 104 | } 105 | } 106 | 107 | extension UIWebPage: ResponseRepresentable { 108 | 109 | /// Handles auto rendering for routes. 110 | /// 111 | /// - Returns: A response containing the view from rendering. 112 | /// - Throws: Any errors generated from creating the view. 113 | public func makeResponse()throws -> Response { 114 | return render().makeResponse() 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import UIWebKit 3 | 4 | XCTMain([ 5 | testCase(UIElementTests.allTests) 6 | ]) 7 | -------------------------------------------------------------------------------- /Tests/UIWebKitTests/UIElementTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import UIWebKit 3 | 4 | class UIElementTests: XCTestCase { 5 | static let allTests = [ 6 | ("Test Element Start", testElementStart), 7 | ("Test Element End", testElementEnd), 8 | ("Test Element Attributes", testAttributes), 9 | ("Test Element Text", testText), 10 | ("Test Element Children", testChildren), 11 | ("Test Element Parse", testParse) 12 | ] 13 | 14 | func testElementStart() { 15 | let element = UIElement(element: .p) 16 | XCTAssert(element.start == "

") 17 | } 18 | 19 | func testElementEnd() { 20 | let element = UIElement(element: .a) 21 | XCTAssert(element.end == "") 22 | } 23 | 24 | func testAttributes() { 25 | let element = UIElement(element: .div) 26 | element.attributes["style"] = "color: orange;" 27 | XCTAssert(element.attributes["style"] == "color: orange;") 28 | } 29 | 30 | func testText() { 31 | let element = UIElement(element: .p) 32 | element.text = "Hello World" 33 | XCTAssert(element.text == "Hello World") 34 | } 35 | 36 | func testChildren() { 37 | let element = UIElement(element: .div) 38 | let child = UIElement(element: .p) 39 | element.children.append(child) 40 | XCTAssert(element.children[0] == child) 41 | } 42 | 43 | func testParse() { 44 | let element = UIElement(element: .div) 45 | element.attributes["style"] = "color: orange;" 46 | let child = UIElement(element: .p) 47 | element.children.append(child) 48 | 49 | let html = element.parse() 50 | 51 | XCTAssert(html == "

") 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Tests/UIWebKitTests/UIWebPageTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import Vapor 3 | @testable import UIWebKit 4 | 5 | class UIWebPageTests: XCTestCase { 6 | static let allTests = [ 7 | ("Tests Page Elements", testElements), 8 | ("Test Page Render", testRender) 9 | ] 10 | 11 | func testElements() { 12 | let head = UIElement(element: .head) 13 | let header = UIElement(element: .header) 14 | let section = UIElement(element: .section) 15 | let footer = UIElement(element: .footer) 16 | let page = UIWebPage(head: head, header: header, section: section, footer: footer) 17 | 18 | XCTAssert(page.head == head) 19 | XCTAssert(page.header == header) 20 | XCTAssert(page.section == section) 21 | XCTAssert(page.footer == footer) 22 | } 23 | 24 | 25 | func testRender() { 26 | let head = UIElement(element: .head) 27 | let header = UIElement(element: .header) 28 | let section = UIElement(element: .section) 29 | let footer = UIElement(element: .footer) 30 | let page = UIWebPage(head: head, header: header, section: section, footer: footer) 31 | 32 | AssertThrows(page.render) 33 | 34 | let drop = Droplet() 35 | page.add(drop) 36 | 37 | AssertNotThrows(page.render) 38 | XCTAssert(page.render != nil) 39 | XCTAssert(page.render! == "UIWebPageTests.html") 40 | } 41 | } 42 | 43 | func AssertThrows(_ function: (T)throws -> U) { 44 | do { 45 | try function 46 | XCTFail() 47 | } catch { 48 | XCTAssertEqual(1, 1) 49 | } 50 | } 51 | 52 | func AssertNotThrows(_ function: (T)throws -> U) { 53 | do { 54 | try function 55 | XCTAssertEqual(1, 1) 56 | } catch { 57 | XCTFail() 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /docs/Classes/UIFormElement.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | UIFormElement Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

UIFormElement

117 |
118 |
119 |
open class UIFormElement
120 | 121 |
122 |
123 |

A label and input combonation that is used in a form.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | topLevelElement 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    The top level element of the form element. This is the wrapper div.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public var topLevelElement: UIElement
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
160 | 164 |
165 |
166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /docs/Enums/DependencyType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DependencyType Enum Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

DependencyType

117 |
118 |
119 |
public enum DependencyType
120 | 121 |
122 |
123 |

Although dependencies use more CSS or JavaScript, this enum is used more for adding the CSS of the dependeny to the head of the page and the JavaScript below the footer of the page.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | javaScript 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Defines the CDN links of the dependency as linking to JavaScript.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    case javaScript
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
    160 |
  • 161 |
    162 | 163 | 164 | 165 | css 166 | 167 |
    168 |
    169 |
    170 |
    171 |
    172 |
    173 |

    Defines the CDN links of the dependency as linking to CSS.

    174 | 175 |
    176 |
    177 |

    Declaration

    178 |
    179 |

    Swift

    180 |
    case css
    181 | 182 |
    183 |
    184 |
    185 |
    186 |
  • 187 |
188 |
189 |
190 |
191 | 195 |
196 |
197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /docs/Enums/LoginFormType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | LoginFormType Enum Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

LoginFormType

117 |
118 |
119 |
public enum LoginFormType
120 | 121 |
122 |
123 |

Designates the login that is used for creating the login form.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | email 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Sets the form as taking an email for the users login.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    case email
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
    160 |
  • 161 |
    162 | 163 | 164 | 165 | username 166 | 167 |
    168 |
    169 |
    170 |
    171 |
    172 |
    173 |

    Sets the form as taking a username for the login

    174 | 175 |
    176 |
    177 |

    Declaration

    178 |
    179 |

    Swift

    180 |
    case username
    181 | 182 |
    183 |
    184 |
    185 |
    186 |
  • 187 |
188 |
189 |
190 |
191 | 195 |
196 |
197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /docs/Protocols.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Protocols Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |
18 |
19 |
20 | 25 |
26 |
27 | 112 |
113 |
114 |
115 |

Protocols

116 |

The following protocols are available globally.

117 | 118 |
119 |
120 |
121 |
    122 |
  • 123 |
    124 | 125 | 126 | 127 | ElementRenderable 128 | 129 |
    130 |
    131 |
    132 |
    133 |
    134 |
    135 |

    Designates an object as capable of being rendered into HTML.

    136 | 137 | See more 138 |
    139 |
    140 |

    Declaration

    141 |
    142 |

    Swift

    143 |
    public protocol ElementRenderable
    144 | 145 |
    146 |
    147 |
    148 |
    149 |
  • 150 |
151 |
152 |
153 |
154 | 158 |
159 |
160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /docs/Protocols/ElementRenderable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ElementRenderable Protocol Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

ElementRenderable

117 |
118 |
119 |
public protocol ElementRenderable
120 | 121 |
122 |
123 |

Designates an object as capable of being rendered into HTML.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | topLevelElement 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    The element the is at the top level for the object. Example: If there is a form, the top level element would be the UIElement that is form.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    var topLevelElement: UIElement
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
160 | 164 |
165 |
166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | documentationdocumentation100%100% -------------------------------------------------------------------------------- /docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 1; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 1; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; 143 | white-space: nowrap; } 144 | .nav-group-task a { 145 | color: #888; } 146 | 147 | .main-content { 148 | background-color: #fff; 149 | border: 1px solid #e2e2e2; 150 | margin-left: 246px; 151 | position: absolute; 152 | overflow: hidden; 153 | padding-bottom: 60px; 154 | top: 70px; 155 | width: 734px; } 156 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 157 | margin-bottom: 1em; } 158 | .main-content p { 159 | line-height: 1.8em; } 160 | .main-content section .section:first-child { 161 | margin-top: 0; 162 | padding-top: 0; } 163 | .main-content section .task-group-section .task-group:first-of-type { 164 | padding-top: 10px; } 165 | .main-content section .task-group-section .task-group:first-of-type .section-name { 166 | padding-top: 15px; } 167 | 168 | .section { 169 | padding: 0 25px; } 170 | 171 | .highlight { 172 | background-color: #eee; 173 | padding: 10px 12px; 174 | border: 1px solid #e2e2e2; 175 | border-radius: 4px; 176 | overflow-x: auto; } 177 | 178 | .declaration .highlight { 179 | overflow-x: initial; 180 | padding: 0 40px 40px 0; 181 | margin-bottom: -25px; 182 | background-color: transparent; 183 | border: none; } 184 | 185 | .section-name { 186 | margin: 0; 187 | margin-left: 18px; } 188 | 189 | .task-group-section { 190 | padding-left: 6px; 191 | border-top: 1px solid #e2e2e2; } 192 | 193 | .task-group { 194 | padding-top: 0px; } 195 | 196 | .task-name-container a[name]:before { 197 | content: ""; 198 | display: block; 199 | padding-top: 70px; 200 | margin: -70px 0 0; } 201 | 202 | .item { 203 | padding-top: 8px; 204 | width: 100%; 205 | list-style-type: none; } 206 | .item a[name]:before { 207 | content: ""; 208 | display: block; 209 | padding-top: 70px; 210 | margin: -70px 0 0; } 211 | .item code { 212 | background-color: transparent; 213 | padding: 0; } 214 | .item .token { 215 | padding-left: 3px; 216 | margin-left: 15px; 217 | font-size: 11.9px; } 218 | .item .declaration-note { 219 | font-size: .85em; 220 | color: gray; 221 | font-style: italic; } 222 | 223 | .pointer-container { 224 | border-bottom: 1px solid #e2e2e2; 225 | left: -23px; 226 | padding-bottom: 13px; 227 | position: relative; 228 | width: 110%; } 229 | 230 | .pointer { 231 | background: #f9f9f9; 232 | border-left: 1px solid #e2e2e2; 233 | border-top: 1px solid #e2e2e2; 234 | height: 12px; 235 | left: 21px; 236 | top: -7px; 237 | -webkit-transform: rotate(45deg); 238 | -moz-transform: rotate(45deg); 239 | -o-transform: rotate(45deg); 240 | transform: rotate(45deg); 241 | position: absolute; 242 | width: 12px; } 243 | 244 | .height-container { 245 | display: none; 246 | left: -25px; 247 | padding: 0 25px; 248 | position: relative; 249 | width: 100%; 250 | overflow: hidden; } 251 | .height-container .section { 252 | background: #f9f9f9; 253 | border-bottom: 1px solid #e2e2e2; 254 | left: -25px; 255 | position: relative; 256 | width: 100%; 257 | padding-top: 10px; 258 | padding-bottom: 5px; } 259 | 260 | .aside, .language { 261 | padding: 6px 12px; 262 | margin: 12px 0; 263 | border-left: 5px solid #dddddd; 264 | overflow-y: hidden; } 265 | .aside .aside-title, .language .aside-title { 266 | font-size: 9px; 267 | letter-spacing: 2px; 268 | text-transform: uppercase; 269 | padding-bottom: 0; 270 | margin: 0; 271 | color: #aaa; 272 | -webkit-user-select: none; } 273 | .aside p:last-child, .language p:last-child { 274 | margin-bottom: 0; } 275 | 276 | .language { 277 | border-left: 5px solid #cde9f4; } 278 | .language .aside-title { 279 | color: #4b8afb; } 280 | 281 | .aside-warning { 282 | border-left: 5px solid #ff6666; } 283 | .aside-warning .aside-title { 284 | color: #ff0000; } 285 | 286 | .graybox { 287 | border-collapse: collapse; 288 | width: 100%; } 289 | .graybox p { 290 | margin: 0; 291 | word-break: break-word; 292 | min-width: 50px; } 293 | .graybox td { 294 | border: 1px solid #e2e2e2; 295 | padding: 5px 25px 5px 10px; 296 | vertical-align: middle; } 297 | .graybox tr td:first-of-type { 298 | text-align: right; 299 | padding: 7px; 300 | vertical-align: top; 301 | word-break: normal; 302 | width: 40px; } 303 | 304 | .slightly-smaller { 305 | font-size: 0.9em; } 306 | 307 | #footer { 308 | position: absolute; 309 | bottom: 10px; 310 | margin-left: 25px; } 311 | #footer p { 312 | margin: 0; 313 | color: #aaa; 314 | font-size: 0.8em; } 315 | 316 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 317 | display: none; } 318 | html.dash .main-content { 319 | width: 980px; 320 | margin-left: 0; 321 | border: none; 322 | width: 100%; 323 | top: 0; 324 | padding-bottom: 0; } 325 | html.dash .height-container { 326 | display: block; } 327 | html.dash .item .token { 328 | margin-left: 0; } 329 | html.dash .content-wrapper { 330 | width: auto; } 331 | html.dash #footer { 332 | position: static; } 333 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy. 7 | CFBundleName 8 | 9 | DocSetPlatformFamily 10 | 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Classes/UIFormElement.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | UIFormElement Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

UIFormElement

117 |
118 |
119 |
open class UIFormElement
120 | 121 |
122 |
123 |

A label and input combonation that is used in a form.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | topLevelElement 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    The top level element of the form element. This is the wrapper div.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    public var topLevelElement: UIElement
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
160 | 164 |
165 |
166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Enums/DependencyType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DependencyType Enum Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

DependencyType

117 |
118 |
119 |
public enum DependencyType
120 | 121 |
122 |
123 |

Although dependencies use more CSS or JavaScript, this enum is used more for adding the CSS of the dependeny to the head of the page and the JavaScript below the footer of the page.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | javaScript 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Defines the CDN links of the dependency as linking to JavaScript.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    case javaScript
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
    160 |
  • 161 |
    162 | 163 | 164 | 165 | css 166 | 167 |
    168 |
    169 |
    170 |
    171 |
    172 |
    173 |

    Defines the CDN links of the dependency as linking to CSS.

    174 | 175 |
    176 |
    177 |

    Declaration

    178 |
    179 |

    Swift

    180 |
    case css
    181 | 182 |
    183 |
    184 |
    185 |
    186 |
  • 187 |
188 |
189 |
190 |
191 | 195 |
196 |
197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Enums/LoginFormType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | LoginFormType Enum Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

LoginFormType

117 |
118 |
119 |
public enum LoginFormType
120 | 121 |
122 |
123 |

Designates the login that is used for creating the login form.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | email 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    Sets the form as taking an email for the users login.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    case email
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
    160 |
  • 161 |
    162 | 163 | 164 | 165 | username 166 | 167 |
    168 |
    169 |
    170 |
    171 |
    172 |
    173 |

    Sets the form as taking a username for the login

    174 | 175 |
    176 |
    177 |

    Declaration

    178 |
    179 |

    Swift

    180 |
    case username
    181 | 182 |
    183 |
    184 |
    185 |
    186 |
  • 187 |
188 |
189 |
190 |
191 | 195 |
196 |
197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Protocols.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Protocols Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |
18 |
19 |
20 | 25 |
26 |
27 | 112 |
113 |
114 |
115 |

Protocols

116 |

The following protocols are available globally.

117 | 118 |
119 |
120 |
121 |
    122 |
  • 123 |
    124 | 125 | 126 | 127 | ElementRenderable 128 | 129 |
    130 |
    131 |
    132 |
    133 |
    134 |
    135 |

    Designates an object as capable of being rendered into HTML.

    136 | 137 | See more 138 |
    139 |
    140 |

    Declaration

    141 |
    142 |

    Swift

    143 |
    public protocol ElementRenderable
    144 | 145 |
    146 |
    147 |
    148 |
    149 |
  • 150 |
151 |
152 |
153 |
154 | 158 |
159 |
160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Protocols/ElementRenderable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ElementRenderable Protocol Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |
19 |
20 |
21 | 26 |
27 |
28 | 113 |
114 |
115 |
116 |

ElementRenderable

117 |
118 |
119 |
public protocol ElementRenderable
120 | 121 |
122 |
123 |

Designates an object as capable of being rendered into HTML.

124 | 125 |
126 |
127 |
128 |
    129 |
  • 130 |
    131 | 132 | 133 | 134 | topLevelElement 135 | 136 |
    137 |
    138 |
    139 |
    140 |
    141 |
    142 |

    The element the is at the top level for the object. Example: If there is a form, the top level element would be the UIElement that is form.

    143 | 144 |
    145 |
    146 |

    Declaration

    147 |
    148 |

    Swift

    149 |
    var topLevelElement: UIElement
    150 | 151 |
    152 |
    153 |
    154 |
    155 |
  • 156 |
157 |
158 |
159 |
160 | 164 |
165 |
166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/badge.svg: -------------------------------------------------------------------------------- 1 | documentationdocumentation100%100% -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 1; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 1; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; 143 | white-space: nowrap; } 144 | .nav-group-task a { 145 | color: #888; } 146 | 147 | .main-content { 148 | background-color: #fff; 149 | border: 1px solid #e2e2e2; 150 | margin-left: 246px; 151 | position: absolute; 152 | overflow: hidden; 153 | padding-bottom: 60px; 154 | top: 70px; 155 | width: 734px; } 156 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 157 | margin-bottom: 1em; } 158 | .main-content p { 159 | line-height: 1.8em; } 160 | .main-content section .section:first-child { 161 | margin-top: 0; 162 | padding-top: 0; } 163 | .main-content section .task-group-section .task-group:first-of-type { 164 | padding-top: 10px; } 165 | .main-content section .task-group-section .task-group:first-of-type .section-name { 166 | padding-top: 15px; } 167 | 168 | .section { 169 | padding: 0 25px; } 170 | 171 | .highlight { 172 | background-color: #eee; 173 | padding: 10px 12px; 174 | border: 1px solid #e2e2e2; 175 | border-radius: 4px; 176 | overflow-x: auto; } 177 | 178 | .declaration .highlight { 179 | overflow-x: initial; 180 | padding: 0 40px 40px 0; 181 | margin-bottom: -25px; 182 | background-color: transparent; 183 | border: none; } 184 | 185 | .section-name { 186 | margin: 0; 187 | margin-left: 18px; } 188 | 189 | .task-group-section { 190 | padding-left: 6px; 191 | border-top: 1px solid #e2e2e2; } 192 | 193 | .task-group { 194 | padding-top: 0px; } 195 | 196 | .task-name-container a[name]:before { 197 | content: ""; 198 | display: block; 199 | padding-top: 70px; 200 | margin: -70px 0 0; } 201 | 202 | .item { 203 | padding-top: 8px; 204 | width: 100%; 205 | list-style-type: none; } 206 | .item a[name]:before { 207 | content: ""; 208 | display: block; 209 | padding-top: 70px; 210 | margin: -70px 0 0; } 211 | .item code { 212 | background-color: transparent; 213 | padding: 0; } 214 | .item .token { 215 | padding-left: 3px; 216 | margin-left: 15px; 217 | font-size: 11.9px; } 218 | .item .declaration-note { 219 | font-size: .85em; 220 | color: gray; 221 | font-style: italic; } 222 | 223 | .pointer-container { 224 | border-bottom: 1px solid #e2e2e2; 225 | left: -23px; 226 | padding-bottom: 13px; 227 | position: relative; 228 | width: 110%; } 229 | 230 | .pointer { 231 | background: #f9f9f9; 232 | border-left: 1px solid #e2e2e2; 233 | border-top: 1px solid #e2e2e2; 234 | height: 12px; 235 | left: 21px; 236 | top: -7px; 237 | -webkit-transform: rotate(45deg); 238 | -moz-transform: rotate(45deg); 239 | -o-transform: rotate(45deg); 240 | transform: rotate(45deg); 241 | position: absolute; 242 | width: 12px; } 243 | 244 | .height-container { 245 | display: none; 246 | left: -25px; 247 | padding: 0 25px; 248 | position: relative; 249 | width: 100%; 250 | overflow: hidden; } 251 | .height-container .section { 252 | background: #f9f9f9; 253 | border-bottom: 1px solid #e2e2e2; 254 | left: -25px; 255 | position: relative; 256 | width: 100%; 257 | padding-top: 10px; 258 | padding-bottom: 5px; } 259 | 260 | .aside, .language { 261 | padding: 6px 12px; 262 | margin: 12px 0; 263 | border-left: 5px solid #dddddd; 264 | overflow-y: hidden; } 265 | .aside .aside-title, .language .aside-title { 266 | font-size: 9px; 267 | letter-spacing: 2px; 268 | text-transform: uppercase; 269 | padding-bottom: 0; 270 | margin: 0; 271 | color: #aaa; 272 | -webkit-user-select: none; } 273 | .aside p:last-child, .language p:last-child { 274 | margin-bottom: 0; } 275 | 276 | .language { 277 | border-left: 5px solid #cde9f4; } 278 | .language .aside-title { 279 | color: #4b8afb; } 280 | 281 | .aside-warning { 282 | border-left: 5px solid #ff6666; } 283 | .aside-warning .aside-title { 284 | color: #ff0000; } 285 | 286 | .graybox { 287 | border-collapse: collapse; 288 | width: 100%; } 289 | .graybox p { 290 | margin: 0; 291 | word-break: break-word; 292 | min-width: 50px; } 293 | .graybox td { 294 | border: 1px solid #e2e2e2; 295 | padding: 5px 25px 5px 10px; 296 | vertical-align: middle; } 297 | .graybox tr td:first-of-type { 298 | text-align: right; 299 | padding: 7px; 300 | vertical-align: top; 301 | word-break: normal; 302 | width: 40px; } 303 | 304 | .slightly-smaller { 305 | font-size: 0.9em; } 306 | 307 | #footer { 308 | position: absolute; 309 | bottom: 10px; 310 | margin-left: 25px; } 311 | #footer p { 312 | margin: 0; 313 | color: #aaa; 314 | font-size: 0.8em; } 315 | 316 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 317 | display: none; } 318 | html.dash .main-content { 319 | width: 980px; 320 | margin-left: 0; 321 | border: none; 322 | width: 100%; 323 | top: 0; 324 | padding-bottom: 0; } 325 | html.dash .height-container { 326 | display: block; } 327 | html.dash .item .token { 328 | margin-left: 0; } 329 | html.dash .content-wrapper { 330 | width: auto; } 331 | html.dash #footer { 332 | position: static; } 333 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/docsets/.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/docsets/.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/docsets/.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | var tokenOffset = "15px"; 27 | var original = link.css('marginLeft') == tokenOffset; 28 | link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); 29 | $content = link.parent().parent().next(); 30 | $content.slideToggle(animationDuration); 31 | 32 | // Keeps the document from jumping to the hash. 33 | var href = $(this).attr('href'); 34 | if (history.pushState) { 35 | history.pushState({}, '', href); 36 | } else { 37 | location.hash = href; 38 | } 39 | event.preventDefault(); 40 | }); 41 | 42 | // Dumb down quotes within code blocks that delimit strings instead of quotations 43 | // https://github.com/realm/jazzy/issues/714 44 | $("code q").replaceWith(function () { 45 | return ["\"", $(this).contents(), "\""]; 46 | }); 47 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Volumes/CalebsHD/Development/backEndWebDev/personal/vapor/packages/UIWebKit" 6 | } -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/docsets/.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /docs/docsets/.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/docsets/.tgz -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/img/dash.png -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/docs/img/gh.png -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | var tokenOffset = "15px"; 27 | var original = link.css('marginLeft') == tokenOffset; 28 | link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); 29 | $content = link.parent().parent().next(); 30 | $content.slideToggle(animationDuration); 31 | 32 | // Keeps the document from jumping to the hash. 33 | var href = $(this).attr('href'); 34 | if (history.pushState) { 35 | history.pushState({}, '', href); 36 | } else { 37 | location.hash = href; 38 | } 39 | event.preventDefault(); 40 | }); 41 | 42 | // Dumb down quotes within code blocks that delimit strings instead of quotations 43 | // https://github.com/realm/jazzy/issues/714 44 | $("code q").replaceWith(function () { 45 | return ["\"", $(this).contents(), "\""]; 46 | }); 47 | -------------------------------------------------------------------------------- /docs/undocumented.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | 4 | ], 5 | "source_directory": "/Volumes/CalebsHD/Development/backEndWebDev/personal/vapor/packages/UIWebKit" 6 | } -------------------------------------------------------------------------------- /icons/github-link-trimmed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | GitHub 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /icons/speed-guage.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /icons/uiwebkit-icon-slim-sized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/icons/uiwebkit-icon-slim-sized.png -------------------------------------------------------------------------------- /icons/uiwebkit-icon-slim-sized.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 88 | 89 | 90 | 91 | 92 | Swi 93 | 94 | ML 95 | 96 | ft HT 97 | 98 | -------------------------------------------------------------------------------- /icons/uiwebkit-icon-trimmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/icons/uiwebkit-icon-trimmed.png -------------------------------------------------------------------------------- /icons/uiwebkit-icon-trimmed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 54 | 55 | 56 | 57 | 58 | 71 | 72 | 73 | 74 | 75 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | Swi 132 | 133 | ML 134 | 135 | ft HT 136 | 137 | -------------------------------------------------------------------------------- /icons/uiwebkit-icon.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/icons/uiwebkit-icon.ai -------------------------------------------------------------------------------- /icons/uiwebkit-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calebkleveter/UIWebKit/13390318bdadf6b3b57c0f8b2e76d7eab07c4d92/icons/uiwebkit-icon.png -------------------------------------------------------------------------------- /icons/uiwebkit-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 54 | 55 | 56 | 57 | 58 | 71 | 72 | 73 | 74 | 75 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | Swi 132 | 133 | ML 134 | 135 | ft HT 136 | 137 | -------------------------------------------------------------------------------- /site/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIWebKit 6 | 7 | 8 | 9 | 10 |
11 | 14 | 21 |
22 |
23 | 26 |
27 |

UIWebKit Speed

28 |

UIWebKit is fast. From current benchmarks, it is 2x faster in production then Leaf, Vapor's default templating language (10x faster in debug).

29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /site/styles/main.css: -------------------------------------------------------------------------------- 1 | * { 2 | font-family: 'Quicksand', sans-serif; 3 | } 4 | 5 | body { 6 | margin: 0; 7 | } 8 | 9 | nav { 10 | float: right; 11 | margin-right: 2em; 12 | margin-top: 2.5em; 13 | } 14 | 15 | nav ul li { 16 | display: inline-block; 17 | margin-left: 1em; 18 | } 19 | 20 | nav ul li a { 21 | text-decoration: none; 22 | color: #FAFAFA; 23 | } 24 | 25 | header { 26 | height: 11em; 27 | background-color: #363636; 28 | } 29 | 30 | header div p a img { 31 | height: 9em; 32 | } 33 | 34 | .feature { 35 | margin-top: 3em; 36 | } 37 | 38 | .feature-icon { 39 | height: 8em; 40 | float: left; 41 | margin-left: 1em; 42 | } 43 | 44 | .feature-text { 45 | float: right; 46 | margin-right: 1em; 47 | margin-top: 4.6em; 48 | } 49 | 50 | header #logo { 51 | float: left; 52 | display: inline-block; 53 | margin: 0 0 1em 2em; 54 | } 55 | 56 | header #logo p { 57 | margin: 0; 58 | } 59 | 60 | #github-link { 61 | float: left; 62 | margin: 0 auto; 63 | padding: 0 40%; 64 | } 65 | 66 | #github-link-image { 67 | height: 8em; 68 | } 69 | --------------------------------------------------------------------------------