-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
2,802 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
._* | ||
.idea | ||
.*.sw* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', { ... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.