Skip to content

Commit

Permalink
Merge pull request #6 from adanski/migration
Browse files Browse the repository at this point in the history
Migration to modern web standards
  • Loading branch information
adanski committed Jan 8, 2023
2 parents 91a1429 + 25c3f1b commit 09bfe79
Show file tree
Hide file tree
Showing 68 changed files with 6,514 additions and 12,671 deletions.
73 changes: 72 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,73 @@
node_modules/
# Build
dist/
target/

# Dependencies
node_modules/
jspm_packages/
package-lock.json

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids/
*.pid
*.seed
*.pid.lock

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# IntelliJ specific
.idea/

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2017 Viima Solutions Oy
Copyright (c) 2017-2021 Viima Solutions Oy
Copyright (c) 2022 adanski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
106 changes: 58 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# jquery-comments
jquery-comments is a jQuery plugin for implementing an out-of-the-box commenting solution to any web application with an existing backend. It provides all the UI functionalities and ties them to callbacks that let you easily define what you want to do with the data. The library is highly customizable and very easy to integrate thanks to a wide variety of settings.
# <ax-comments> element
<ax-comments> is a standalone web component with minimal set of dependencies (no jQuery!) for implementing an out-of-the-box commenting solution to any web application with an existing backend. It provides all the UI functionalities and ties them to callbacks that let you easily define what you want to do with the data. The library is highly customizable and very easy to integrate thanks to a wide variety of settings.

![Screenshot of jquery-comments](screenshot.png?raw=true "Screenshot of jquery-comments")
![Screenshot of ax-comments](screenshot.png?raw=true "Screenshot of ax-comments")

## Features

Features
--------
- Commenting
- Replying (nested comments)
- Editing comments
Expand All @@ -16,43 +16,53 @@ Features
- Enabling/disabling functionalities
- Localization
- Time formatting
- Field mappings
- Callbacks
- Fully responsive and mobile compatible
- Miscellaneous settings

Demo
----
http://viima.github.io/jquery-comments/demo/

Quick start
-----------
**1) Add the following to your HTML file**
```html
<link rel="stylesheet" type="text/css" href="css/jquery-comments.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
## Demo
http://adanski.github.io/ax-comments/demo/

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-comments.js"></script>
## Quick start
### Installation
```console
$ npm install --save ax-comments
```

**2) Initialize the library**
### Usage
```javascript
$('#comments-container').comments({
getComments: function(success, error) {
var commentsArray = [{
id: 1,
created: '2015-10-01',
content: 'Lorem ipsum dolort sit amet',
fullname: 'Simon Powell',
upvote_count: 2,
user_has_upvoted: false
import 'ax-comments/comments-element';

//...

const commentsElement = document.createElement('ax-comments');
commentsElement.options = {
// ...
getComments: (onSuccess, onError) => {
const commentsArray = [{
id: '1',
content: "Lorem ipsum dolor sit amet",
creatorUserId: "simon.powell",
creatorDisplayName: "Simon Powell",
// ...
createdByAdmin: false,
createdByCurrentUser: false,
upvoteCount: 3,
upvotedByCurrentUser: false,
isNew: false
}];
success(commentsArray);
}
});
onSuccess(commentsArray);
},
// ...
};

document.body.append(commentsElement);
```

See full example [here](https://github.com/adanski/ax-comments/blob/gh-pages/demo/demo.js).

If you are not using Font Awesome for icons, you should replace the icons with custom images by overriding following options when initializing the library:

```javascript
spinnerIconURL: '',
noCommentsIconURL: '',
Expand All @@ -63,24 +73,24 @@ uploadIconURL: '', // Only if attachments are enabled
attachmentIconURL: '', // Only if attachments are enabled
```

Dependencies
------------
- jQuery >= 1.9.0
- Font Awesome (optional)
- jquery-textcomplete (optional)
## Documentation
http://adanski.github.io/ax-comments

## Maintainers
- [adanski](https://github.com/adanski)

## Browser support
Basically every modern browser that supports native web components and shadow dom.

Documentation
-------------
http://viima.github.io/jquery-comments
Includes Firefox, Edge, Chrome and probably Safari

Maintainers
-----------
- [Joona Tykkyläinen](https://www.linkedin.com/in/joonatykkylainen), Viima Solutions Oy
## Special thanks
&lt;ax-comments&gt; probably wouldn't exist if it wasn't for the outstanding work of the authors of the following packages:
- [jquery-comments](https://github.com/Viima/jquery-comments)
- [textcomplete](https://github.com/yuku/textcomplete)
- [markdown-toolbar-element](https://github.com/github/markdown-toolbar-element)

Browser support
---------------
IE9+ and all modern browsers
## Copyright and license
Code and documentation copyright 2017-2021 [Viima Solutions Oy](https://www.viima.com/), 2022 [adanski](https://github.com/adanski).

Copyright and license
---------------------
Code and documentation copyright 2020 [Viima Solutions Oy](https://www.viima.com/). Code released under [the MIT license](https://github.com/Viima/jquery-comments/blob/master/LICENSE).
Code released under [the MIT license](https://github.com/adanski/ax-comments/blob/master/LICENSE).
24 changes: 0 additions & 24 deletions bower.json

This file was deleted.

Loading

0 comments on commit 09bfe79

Please sign in to comment.