npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-ui-chat

v1.2.2

Published

Angular UI Customizible chatroom that lets you determine how to store and retrieve data

Downloads

25

Readme

Angular-UI-Chat

=========

A small library for making a custom chatroom. This addon is purely front-end so how you send data to it is up to you.

chatdemo

Dependencies

Angular 1.x

Installation

npm install angular-ui-chat --save

Feature Roadmap

  • [x] Basic functionality (plain text)
  • [x] User Message Callback
  • [x] Curse Word Filters
  • [x] Emoticons
  • [x] Mobile Friendly
  • [x] User Images
  • [x] Collapsable user name list
  • [x] Private Messages
  • [x] Admin abilities
  • [x] Parse on key up Emoticons/PM/Mention
  • [x] HTML - bold
  • [x] HTML - underline
  • [x] HTML - italics
  • [ ] HTML - links
  • [ ] HTML - size increase
  • [ ] HTML - images
  • [ ] User Settings
  • [ ] Custom User Levels
  • [ ] Themes

Usage

  1. run npm install angular-ui-chat
  2. include the .min.js and the .min.css file from the dist/ folder in your project.
  3. Add 'ui-chat' to your angular dependencies
  4. Add to your html

  <ui-chat chatoptions="uiChatOptions" chatmessage="messageCallbackFunction" chattyping="isTypingCallbackFunction" chatprivatemessage="chatPrivateMessageCallbackFunction" chatmessagedelete="messageDeleteCallbackFunction"></ui-chat>
  1. In your controller create an optionsObject and a message callback function (DO NOT include parenthesis () in the html!)

  $scope.uiChatOptions = {
    //'left' or 'right'; defaults to right
    usersListSide: 'right',
    //if set to twa, the cha t will filter for twemoji awesome
    emoji: 'twa',
    curseFilter: true,
    //start this will parse items in the input box on key up
    mentionParse: true,
    emojiParse: true,
    pmParse: true,
    //object to enable html input / false to disable
    html: {
      italicize: true,
      bold: true,
      underline: true
    },
    //end input box filters
    defaultCurseReplacer: '$|^&!',
    users: [arrayOfUsersInChat],
    user: {userObject},
    userFeedback: {
      message: 'soandso is typing a message',
    },
    messages: [messagesFromUsersInChat]
  };

  $scope.messageCallbackFunction = function(messageObject){
    //process message here whenever message received
    //you can also alter the message here and return the change
    return messageObject;
  };

  $scope.isTypingCallbackFunction = function(lengthOfCharacters){
    //process is activity here for user is typing...
  };

  $scope.chatPrivateMessageCallbackFunction = function(messageObject, userObject){
    //process message here whenever a private message is sent from the client user
    //you can also alter the message here and return the change
    return messageObject;
  };

  $scope.messageDeleteCallbackFunction = function(messageObject){
    //call for when an admin wants to delete a message
  };
  1. Each array is an array of objects, the following should be contained in each. User is an object of the user that is the owner of the chat instance. For security reasons it is not recommended to include user email addresses in calls related to chat functionality, this would leave anyone in the live chat open to having their emails scraped by a bot.

  var arrayOfUsersInChat = [userObject, userObject];
  arrayOfUsersInChat.push(userObject);

  var messagesFromUsersInChat = [];
  messagesFromUsersInChat.push({
    //the same userobject as listed below.
    user: {userObject},
    //the message sent
    message: 'message sent by user',
    id: 'unique id(optional)',
    //time of the messages
    time: new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds();
    //if it is a private message
    private: {
      //who our client is having a conversation with
      user: userObject,
      //if the message is from the client to private user
      from: true,
      //if the message is to the client from private user
      to: true,
    },
  });

  var userObject = {};
  userObject = {
    username: 'what to display',
    id: 'unique id(optional)',
    image: 'an image for the user',
    //if you want to use gravatar you should generate the links server side and pass it into this image field
    admin: false, // or true if they are a chat admin,
    //use left or right to display which side the users image should be on
    side: 'left'
  };

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code. To build use grunt dist. To develop use grunt dev. Use a different branch and send a pull request to contribute.

About

This project is sponsered by ITProTV

Release History

VERSION.MD