Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed May 10, 2018
0 parents commit 8cc040c
Show file tree
Hide file tree
Showing 135 changed files with 8,646 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"parserOptions": {
"ecmaVersion": 5
},
"extends": "eslint:recommended",
"env": {
"commonjs": true,
"browser": true
},
"rules": {
"strict": [2, "global"],
"block-scoped-var": 2,
"consistent-return": 2,
"eqeqeq": [2, "smart"],
"guard-for-in": 2,
"no-caller": 2,
"no-extend-native": 2,
"no-loop-func": 2,
"no-new": 2,
"no-param-reassign": 2,
"no-return-assign": 2,
"no-unused-expressions": 2,
"no-use-before-define": 2,
"radix": [2, "always"],
"indent": [2, 2],
"quotes": [2, "double"],
"semi": [2, "always"]
}
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Dependencies
.psci_modules
bower_components
node_modules

# Generated files
.psci
output
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: node_js
dist: trusty
sudo: required
node_js: stable
install:
- npm install -g bower
- npm install
- bower install
script:
- npm run -s build
after_success:
- >-
test $TRAVIS_TAG &&
echo $GITHUB_TOKEN | pulp login &&
echo y | pulp publish --no-push
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 PureScript

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# purescript-web-html

[![Latest release](http://img.shields.io/github/release/purescript-web/purescript-web-html.svg)](https://github.com/purescript-web/purescript-web-html/releases)
[![Build status](https://travis-ci.org/purescript-web/purescript-web-html.svg?branch=master)](https://travis-ci.org/purescript-web/purescript-web-html)

Type definitions and low level interface implementations for the W3C HTML5 API.

## Installation

```
bower install purescript-web-html
```

## Documentation

Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-web-html).
23 changes: 23 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "purescript-web-html",
"homepage": "https://github.com/purescript-web/purescript-web-html",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/purescript-web/purescript-web-html.git"
},
"ignore": [
"**/.*",
"bower_components",
"node_modules",
"output",
"bower.json",
"package.json"
],
"dependencies": {
"purescript-js-date": "#compiler/0.12",
"purescript-web-dom": "#compiler/0.12",
"purescript-web-file": "#compiler/0.12",
"purescript-web-storage": "purescript-web/purescript-web-storage#compiler/0.12"
}
}
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"private": true,
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "eslint src && pulp build -- --censor-lib --strict"
},
"devDependencies": {
"eslint": "^4.19.1",
"pulp": "^12.2.0",
"purescript-psa": "^0.6.0",
"purescript": "^0.11.7",
"rimraf": "^2.6.2"
}
}
119 changes: 119 additions & 0 deletions src/Web/HTML/HTMLAnchorElement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
"use strict";

exports.target = function (a) {
return function () {
return a.target;
};
};

exports.setTarget = function (target) {
return function (a) {
return function () {
a.target = target;
};
};
};

// ----------------------------------------------------------------------------

exports.download = function (a) {
return function () {
return a.download;
};
};

exports.setDownload = function (download) {
return function (a) {
return function () {
a.download = download;
};
};
};

// ----------------------------------------------------------------------------

exports.rel = function (a) {
return function () {
return a.rel;
};
};

exports.setRel = function (rel) {
return function (a) {
return function () {
a.rel = rel;
};
};
};

// ----------------------------------------------------------------------------

exports.rev = function (a) {
return function () {
return a.rev;
};
};

exports.setRev = function (rev) {
return function (a) {
return function () {
a.rev = rev;
};
};
};

// ----------------------------------------------------------------------------

exports.relList = function (a) {
return function () {
return a.relList;
};
};

// ----------------------------------------------------------------------------

exports.hreflang = function (a) {
return function () {
return a.hreflang;
};
};

exports.setHreflang = function (hreflang) {
return function (a) {
return function () {
a.hreflang = hreflang;
};
};
};

// ----------------------------------------------------------------------------

exports.type_ = function (a) {
return function () {
return a.type;
};
};

exports.setType = function (type) {
return function (a) {
return function () {
a.type = type;
};
};
};

// ----------------------------------------------------------------------------

exports.text = function (a) {
return function () {
return a.text;
};
};

exports.setText = function (text) {
return function (a) {
return function () {
a.text = text;
};
};
};
39 changes: 39 additions & 0 deletions src/Web/HTML/HTMLAnchorElement.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module Web.HTML.HTMLAnchorElement where

import Effect (Effect)
import Foreign (Foreign, F, unsafeReadTagged)
import Prelude (Unit)
import Unsafe.Coerce (unsafeCoerce)
import Web.DOM.DOMTokenList (DOMTokenList)
import Web.HTML.HTMLElement (HTMLElement)

foreign import data HTMLAnchorElement :: Type

toHTMLElement :: HTMLAnchorElement -> HTMLElement
toHTMLElement = unsafeCoerce

read :: Foreign -> F HTMLAnchorElement
read = unsafeReadTagged "HTMLAnchorElement"

foreign import target :: HTMLAnchorElement -> Effect String
foreign import setTarget :: String -> HTMLAnchorElement -> Effect Unit

foreign import download :: HTMLAnchorElement -> Effect String
foreign import setDownload :: String -> HTMLAnchorElement -> Effect Unit

foreign import rel :: HTMLAnchorElement -> Effect String
foreign import setRel :: String -> HTMLAnchorElement -> Effect Unit

foreign import rev :: HTMLAnchorElement -> Effect String
foreign import setRev :: String -> HTMLAnchorElement -> Effect Unit

foreign import relList :: HTMLAnchorElement -> Effect DOMTokenList

foreign import hreflang :: HTMLAnchorElement -> Effect String
foreign import setHreflang :: String -> HTMLAnchorElement -> Effect Unit

foreign import type_ :: HTMLAnchorElement -> Effect String
foreign import setType :: String -> HTMLAnchorElement -> Effect Unit

foreign import text :: HTMLAnchorElement -> Effect String
foreign import setText :: String -> HTMLAnchorElement -> Effect Unit
Loading

0 comments on commit 8cc040c

Please sign in to comment.