Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mweibel committed Jul 3, 2014
2 parents ddd202e + 2e33e82 commit a13ccaa
Show file tree
Hide file tree
Showing 30 changed files with 2,802 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
._*
.idea
.*.sw*
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@
This is the official plugin repository for [Candy](http://candy-chat.github.com/candy), a JavaScript based multi-user chat client.

## List of available plugins
* __available-rooms__ A plugin to show & join public rooms.
* __Auto-Join Invites__ - Automatically joins any and all incoming MUC invites.
* __available-rooms__ - A plugin to show & join public rooms.
* __Chat Recall__ - Saves the last {x} messages to scroll through with up and down arrows, similar to terminal/cmd.
* __Clearchat__ - Clears chat window on click or if typing `/clear`
* __Colors__ - Send and receive colored messages.
* __Colors XHTML__ - Send and receive colored messages formatted with XHTML.
* __Clearchat__ - Clears chat window on click or if typing `/clear`
* __Namecomplete__ - Autocompletes names of users within room
* __Notifyme__ - Notifies yourself in case one does use your nickname in a message
* __Create Room__ - Creates a clickable UI for creating and joining rooms.
* __Inline Images__ - If a user posts a URL to an image, that image gets rendered directly inside of Candy.
* __Inline Videos__ - If a user posts a URL to youtube video, it embeds the youtube video iframe into Candy.
* __join__ A plugin that allows to type `/join room [password]` to join a room.
* __jQuery-Ui__ - jQuery UI lightness theme
* __Left Tabs__ - Moves the tabs to the left side and uses a bit of Bootstrap3-friendly theme elements.
* __Modify Role__ - Adds **add moderator** and **remove moderator** context menu links.
* __Namecomplete__ - Provides auto-complete of user names that are currently in the chat room.
* __Namecomplete__ - Autocompletes names of users within room
* __Nickchange__ - Enable your users to change the nick using a toolbar icon
* __Notifications__ - OS Notifications in webkit
* __Notify Me__ - Notify me either through highlighting or audio that my username was mentioned.
* __Notifyme__ - Notifies yourself in case one does use your nickname in a message
* __Refocus__ - This plugin puts the focus on the entry box if the user clicks somewhere in the message list.
* __Remove Ignore__ - Removes the option to ignore/unignore a user from the roster.
* __Replies__ - Highlight any message that contains "@my_username"
* __Room Panel__ - Provides a list of rooms available to join.
* __Static Lobby__ - Creates a static lobby UI and pulls in a global roster. Allows you to invite people from global roster to other MUCs you are participating in.
* __Sticky Subject__ - Retains the subject of the room underneath the tab itself.
* __Timeago__ - Replaces the exact time/date with fuzzy timestamps like "2 minutes ago".
* __Typing Notifications__ - Displays a user's typing notification status above the text entry form.

## Contributing
Please submit a pull request with your plugin or your changes to a plugin. We'll gladly merge it.
Expand Down
339 changes: 339 additions & 0 deletions autojoininvites/LICENSE

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions autojoininvites/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Auto-Join Invites

A plugin for Candy Chat to automatically join any and all incoming MUC room invites.


## Usage
Include the JavaScript file:
```HTML
<script type="text/javascript" src="candyshop/autojoininvites/autojoininvites.js"></script>
```

To enable this plugin, add its `init` method after you `init` Candy:
```JavaScript
CandyShop.AutoJoinInvites.init();
Candy.connect();
```
30 changes: 30 additions & 0 deletions autojoininvites/autojoininvites.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** File: autojoininvites.js
* Candy Plugin Auto-Join Incoming MUC Invites
* Author: Melissa Adamaitis <madamei@mojolingo.com>
*/

var CandyShop = (function(self) { return self; }(CandyShop || {}));

CandyShop.AutoJoinInvites = (function(self, Candy, $) {
/** Object: about
*
* Contains:
* (String) name - Candy Plugin Auto-Join Incoming MUC Invites
* (Float) version - Candy Plugin Auto-Join Incoming MUC Invites
*/
self.about = {
name: 'Candy Plugin Auto-Join Incoming MUC Invites',
version: '1.0'
};

/**
* Initializes the AutoJoinInvites plugin with the default settings.
*/
self.init = function(){
$(Candy).on('candy:core:chat:invite',function(ev, obj) {
Candy.Core.Action.Jabber.Room.Join(obj.roomJid, null);
})
};

return self;
}(CandyShop.AutoJoinInvites || {}, Candy, jQuery));
339 changes: 339 additions & 0 deletions createroom/LICENSE

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions createroom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Create Room UI

A plugin for Candy Chat to enable a clickable UI for creating new chatrooms.

![Create Room UI](screenshot.png)

## Usage
Include the JavaScript and CSS files:
```HTML
<script type="text/javascript" src="candyshop/createroom/createroom.js"></script>
<link rel="stylesheet" type="text/css" href="candyshop/createroom/createroom.css" />
```

To enable this Left Tabs plugin, add its `init` method _before_ you `init` Candy:
```JavaScript
CandyShop.CreateRoom.init();
Candy.init('/http-bind', { ...
```
90 changes: 90 additions & 0 deletions createroom/createroom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/**
* Create Room CSS
*
* @author Melissa Adamaitis <madamei@mojolingo.com>
*/
#create-group {
background-color: rgba(255,255,255,0.9);
border-radius: 3px;
bottom: 7px;
cursor: default;
display: inline-block;
height: 13px;
padding: 6px 5px;
position: relative;
}
#create-group .click {
bottom: 3px;
position: relative;
text-align: center;
}
#create-group .group-form {
border-top: 1px solid rgba(0,0,0,0.9);
left: 0;
margin-top: 5px;
padding-top: 5px;
position: absolute;
top: 0;
}
#group-form-wrapper.hidden {
display: none;
}
#group-form-wrapper.show {
display block;
background-color: rgba(0,0,0,0.3);
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
#group-form-wrapper .inner-wrapper {
background: none;
display: table;
margin: 0 auto;
height: 100%;
}
#group-form-wrapper .inner-inner-wrapper {
display: table-cell;
height: 50%;
margin: 0 auto;
vertical-align: middle;
width: 50%;
}
#create-group-form {
background: white;
border-bottom: 2px solid rgba(0,0,0,0.5);
border-radius: 4px;
padding: 20px;
}
#create-group .group-form > p {
font-size: 0.85em;
margin-bottom: 0;
}
#create-group .group-form > button {
bottom: 0;
left: 32%;
position: absolute;
}
#chat-tabs {
display: inline-block;
}
#create-group-form p:first-of-type {
margin-top: 0;
}
#create-group-form .close-button {
cursor: default;
display: inline-block;
float: right;
}
#create-group-form .close-button:hover {
color: #A8A8A8;
}
#create-group-form button[type='submit'] {
display: block;
margin-top: 15px;
}
#create-group-form .text-warning {
font-style: oblique;
padding-bottom: 3px;
}
89 changes: 89 additions & 0 deletions createroom/createroom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/** File: createroom.js
* Candy Plugin Create Room
* Author: Melissa Adamaitis <madamei@mojolingo.com>
*/

var CandyShop = (function(self) { return self; }(CandyShop || {}));

CandyShop.CreateRoom = (function(self, Candy, $) {
/** Object: about
*
* Contains:
* (String) name - Candy Plugin Create Room
* (Float) version - Candy Plugin Create Room
*/
self.about = {
name: 'Candy Plugin Create Room',
version: '1.0'
};

/**
* Initializes the CreateRoom plugin with the default settings.
*/
self.init = function(){
$(Candy).on('candy:view.room.after-add', function() {
self.addModal();
self.appendButton();
});
};

self.appendButton = function(){
if($('#create-group').length == 0) {
var create_room_html = '<div id="create-group"><div class="click">+ Create Group</div></div>';
$('#chat-tabs').after(create_room_html);
$('#create-group').click(function () {
self.showModal();
$('#group-form-wrapper').click(function() {
self.hideModal();
});
$('#create-group-form').click(function(event) {
event.stopPropagation();
});
$('#create-group-form .close-button').click(function() {
self.hideModal();
});
});
}
};

self.addFormHandler = function(){
$('#create-group-form').submit(function(event) {
event.preventDefault();
if($('#create-group-form-name').val() === '') {
// Notify that group name cannot be blank.
var warning_html = '<label class="control-label" for="create-group-form-name">Name cannot be blank.</label>';
$('#create-group-form-name').before(warning_html);
$('.form-group.group-form-name-group').addClass('has-error');
// Remove classes after user either starts typing or has pasted in a name.
$('#create-group-form-name').focus(function() {
$('.form-group.group-form-name-group').removeClass('has-error');
$('.form-group.group-form-name-group label').remove();
});
} else {
var roomJid = $('#create-group-form-name').val() + '@conference.' + Candy.Core.getConnection().domain;
Candy.Core.Action.Jabber.Room.Join(roomJid, null);
self.hideModal();
}
});
}

self.hideModal = function(){
$('#group-form-wrapper').addClass('hidden');
$('#group-form-wrapper').removeClass('show');
}

self.showModal = function(){
$('#group-form-wrapper').removeClass('hidden');
$('#group-form-wrapper').addClass('show');
self.addFormHandler();
}

self.addModal = function(){
if($('#group-form-wrapper').length == 0) {
var modal_html = '<div id="group-form-wrapper" class="hidden group-form"><div class="inner-wrapper"><div class="inner-inner-wrapper"><form id="create-group-form"><div class="close-button">X</div><p>Name:</p><div class="form-group group-form-name-group"><input class="form-control" type="text" name="room-name" id="create-group-form-name" /></div><button type="submit">Create</button></form></div></div></div>';
$('#candy').after(modal_html);
}
};

return self;
}(CandyShop.CreateRoom || {}, Candy, jQuery));
Binary file added createroom/screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a13ccaa

Please sign in to comment.