Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cdayjr committed Dec 28, 2018
0 parents commit e88e303
Show file tree
Hide file tree
Showing 18 changed files with 8,789 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> 0.25%
not dead
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Dependency directories
node_modules/

# Build files
dist

# Temp files
var
.cache
3 changes: 3 additions & 0 deletions .postcssrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"modules": true
}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
node_modules
dist
shrinkwrap.yaml
var
7 changes: 7 additions & 0 deletions .sassrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('path');

const CWD = process.cwd();

module.exports = {
includePaths: [path.resolve(CWD, 'node_modules')]
};
4 changes: 4 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
node_modules
dist
var
5 changes: 5 additions & 0 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends:
- stylelint-config-standard
rules:
declaration-colon-newline-after: null
value-list-comma-newline-after: null
77 changes: 77 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

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 Chad Wade Day, Jr.

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.
127 changes: 127 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Video Tag

JavaScript for making video bbcodes and similar things as simple as they can get. Currently supports Twitch, Vimeo, and YouTube videos.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

This project uses [pnpm](https://pnpm.js.org/) to manage dependencies, but should work by replacing the `pnpm` comamnds with `npm` if you have [npm](https://www.npmjs.com/).

For example, installing the dependencies can work with either:

```bash
pnpm install
```

or

```bash
npm install
```

The same can apply to `pnpx` to `npx` commands. `pnpm` and `pnpx` are recommended, however.

### Installing

Once you have your package manager of choice up and running, get the packages needed for this project with the following command:

```bash
pnpm install
```

## Running the tests

Automated testing isn't set up yet, but there's a simple manual html test, which will compile the code that'll re-compile on changes and run a `test.html` file on a local server.

Run the test with the following command:

```bash
pnpm run test
```

### And coding style tests

Explain what these tests test and why

```bash
Give an example
```

## Deployment

Building this ready for deployment is as easy as:

```bash
pnpm run build
```

From there, the files in the `dist` folder must be uploaded to the same
directory, and then include the `video-tag.js` file in your code with a
`<script>` tag and the `video-tag.css` file in your code with a `<link rel="stylesheet">` tag.

## Usage

Once the code has been deployed to your site, it'll look for `div` tags with the `video-tag` class. If the tag has a `data-content` attribute with a URL in it. An example would be:

```html
<div class="video-tag" data-content="https://www.youtube.com/watch?v=g4Hbz2jLxvQ"></div>
```

This is the bare minimum, of course, so a fallback link to the content is recommended like so:

```html
<div class="video-tag" data-content="https://www.youtube.com/watch?v=g4Hbz2jLxvQ"><a class="video-tag-fallback" href="https://www.youtube.com/watch?v=58OabCRCx_Q">https://www.youtube.com/watch?v=58OabCRCx_Q</a></div>
```

For [Jcink Forum Hosting](https://jcink.net), a 1 paramater video tag with the following content:

```html
<div class="video-tag" data-content="(PARAM1)"><a class="video-tag-fallback" href="(PARAM1)">(PARAM1)</a></div>
```

should be sufficient if you have the JavaScript and CSS loaded in your board wrappers. It's recommend you style the `video-tag` class in your own stylesheet to how you'd like, a sample is:

```css
.video-tag {
margin: 1em 1em 1em 0;
max-width: 100%;
}
```

## Built With

- [Babel](https://babeljs.io/)
- [Bootstrap](https://getbootstrap.com/) - Bootstrap responsive 16:9 embed CSS used
- [PostCSS](https://postcss.org/)
- [SCSS](https://sass-lang.com/)
- [TypeScript](https://www.typescriptlang.org/)
- [parcel](https://parceljs.org/) - The bundler that brings it all together
- [pnpm](https://pnpm.js.org/) - JavaScript package management
- [prettier](https://prettier.io/)
- [stylelint](https://stylelint.io/)
- [tslint](https://palantir.github.io/tslint/)

## Contributing

Contributing information coming soon! Please read [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before submitting an issue.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/cdayjr/video-tag/tags).

## Authors

- **Chad Wade Day, Jr.** - _Initial work_ - [@cdayjr](https://github.com/cdayjr)

See also the list of [contributors](https://github.com/cdayjr/video-tag/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

- Many video bbcode tags I've seen in the past inspiring me to take my own swing at it.
11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const presets = [
[
'@babel/env',
{
target: '> 0.25%, not dead',
useBuiltIns: 'usage'
}
]
];

module.exports = { presets };
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "video-tag",
"version": "1.0.0",
"description": "JavaScript to load third-party embed scripts for various video services.",
"main": "index.ts",
"scripts": {
"clean": "rm -rf ./dist",
"build": "npm run clean && parcel build video-tag.ts --target=browser --no-source-maps",
"test": "npm run clean && parcel test.html --target=browser"
},
"author": "Chad Wade Day, Jr.",
"license": "MIT",
"private": true,
"devDependencies": {
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.0",
"autoprefixer": "^9.4.3",
"css-mqpacker": "^7.0.0",
"cssnano": "^4.1.7",
"husky": "^1.3.0",
"node-sass": "^4.11.0",
"parcel-bundler": "^1.11.0",
"postcss": "^7.0.7",
"postcss-import": "^12.0.1",
"postcss-modules": "^1.4.1",
"postcss-preset-env": "^6.5.0",
"postcss-syntax": "^0.34.0",
"prettier": "^1.15.3",
"stylelint": "^9.9.0",
"stylelint-config-standard": "^18.2.0",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0",
"typescript": "^3.2.2"
},
"dependencies": {
"style": "0.0.3"
}
}
Loading

0 comments on commit e88e303

Please sign in to comment.