Готовый интерфейс

This commit is contained in:
Alexander Yakovlev 2016-02-20 11:59:06 +07:00
parent 6c69cdffcc
commit 2cd43f0e53
6 changed files with 46 additions and 370 deletions

View File

@ -1,24 +0,0 @@
# Left Tabs + Bootstrap3 Icons
A plugin for Candy Chat to enable left tabs with simple Bootstrap3 theme elements.
![Left Tabs + Bootstrap3](screenshot.png)
## Usage
Include the JavaScript and CSS files:
```HTML
<script type="text/javascript" src="candyshop/lefttabs/lefttabs.js"></script>
<link rel="stylesheet" type="text/css" href="candyshop/lefttabs/lefttabs.css" />
```
Remember to include your Bootstrap3 CSS/JS files! They are not included in this plugin. ;)
To enable this Left Tabs plugin, add its `init` method _before_ you `init` Candy:
```JavaScript
CandyShop.LeftTabs.init();
Candy.init('/http-bind', { ...
```
## Compatibility with other plugins
Make sure to `init` it after all other plugins, but before the Candy `init`.
1. CreateRoom

View File

@ -1,239 +0,0 @@
/**
* LeftTabs CSS
*
* @author Melissa Adamaitis <melissa@melissanoelle.com>
*/
/* Message pane/body CSS. */
#chat-rooms {
display: inline-block;
float: right;
margin-left: 50%;
margin-right: 14.6%;
width: 30.5%;
}
.message-pane-wrapper {
float:right;
height: auto;
margin: 0;
position: relative;
width: 100%;
}
.message-pane {
height: 100%;
padding-top: 1px;
width: 69.8%;
overflow-y: scroll;
position: fixed;
}
.message-pane .label {
padding-top: 7px;
}
/* Input form CSS. */
.message-form-wrapper {
float: left;
margin-right:auto;
position: relative;
width: 100%;
}
.message-form {
margin: 0;
position: relative;
width: 100%;
}
.message-form input.submit {
margin: 2px 3px;
position: absolute;
}
/* Roster (right) menu CSS. */
.roster-pane {
background-color: initial;
border: 0;
box-shadow: none;
float:right;
margin: 0;
padding-right: 3px;
padding-top: 2px;
position: fixed;
right: 0;
width: 14%;
}
.roster-pane .label {
color: #555;
font-size: 0.85em;
line-height: 1em;
padding-left: 0;
text-shadow: none;
width: auto;
}
.roster-pane .user {
border: 0;
box-sizing: initial;
box-shadow: none;
font-size: 14px;
padding: 0;
}
.roster-pane .user ul {
float: right;
margin: 0;
position: relative;
}
.roster-pane .user:hover {
background-color: initial;
}
.roster-pane .user:hover .label {
color: #33bbfc;
}
/* Toolbar CSS. (Below roster.) */
#chat-toolbar {
height: 30px;
margin-bottom: 0;
width: 14.5%;
}
#chat-toolbar li {
background-image: none !important;
font-size: 1.25em;
line-height: 1em;
}
#emoticons-icon {
color: #F3E43C;
}
/* Volume. */
#chat-sound-control, #chat-autoscroll-control {
color: #ccc;
}
#chat-sound-control .glyphicon {
display: none;
}
#chat-sound-control .glyphicon.glyphicon-volume-off {
display: initial;
color: #9b1414;
}
#chat-sound-control.checked .glyphicon.glyphicon-volume-off {
display: none;
}
#chat-sound-control.checked .glyphicon.glyphicon-volume-up {
display: block;
}
/* Scroll */
#chat-autoscroll-control {
position: relative;
}
#chat-autoscroll-control .glyphicon.glyphicon-ban-circle {
display: initial;
color: #9b1414;
position: absolute;
left: 0;
}
#chat-autoscroll-control.checked .glyphicon.glyphicon-ban-circle {
display: none;
}
/* Status message */
#chat-statusmessage-control {
position: relative;
color: #6EAEFF;
}
#chat-statusmessage-control .glyphicon.glyphicon-ban-circle {
display: initial;
color: #9b1414;
left: 0;
position: absolute;
}
#chat-statusmessage-control.checked .glyphicon.glyphicon-ban-circle {
display: none;
}
/* Users icon */
.usercount span.glyphicon {
background-color: initial;
}
/* Left menu CSS. */
#left-menu-wrapper {
display: inline-block;
float: left;
position: fixed;
width: 50%;
}
#chat-tabs {
margin: 0;
float: right;
width: 99%;
}
#chat-tabs > li {
margin: 0;
margin-top: 2px;
width: 100% !important;
}
#chat-tabs > li:first-of-type {
margin-top: 0;
}
#chat-tabs a.transition {
display: none;
}
#chat-tabs a.label {
border-radius: 3px 0 0 3px;
text-align: left;
width: 100%;
}
#chat-tabs a.close {
right: -5px;
top: -7px;
}
/* Extra details (badges, non-specific hovers, background colors, etc...) */
#chat-tabs small.unread {
border-radius: 50%;
cursor: default;
height: 17px;
padding: 0;
top: 3px;
text-align: center;
width: 17px;
}
.label[href]:hover, .label[href]:focus {
color: #858585;
}
#chat-pane, #roster-pane {
background: #b0e1f2; /* Old browsers */
background: -moz-linear-gradient(top, #b0e1f2 26%, #81bfe2 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(26%,#b0e1f2), color-stop(100%,#81bfe2)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b0e1f2 26%,#81bfe2 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b0e1f2 26%,#81bfe2 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b0e1f2 26%,#81bfe2 100%); /* IE10+ */
background: linear-gradient(to bottom, #b0e1f2 26%,#81bfe2 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b0e1f2', endColorstr='#81bfe2',GradientType=0 ); /* IE6-9 */
}
/* Compatibility with CreateRoom plugin. */
#create-group {
background: #eee;
border-radius: 3px 0 0 3px;
cursor: pointer !important;
float: right;
height: 18px !important;
margin-right: 1px;
margin-top: 9px;
position: initial;
width: 99%;
}
#create-group .click {
font-size: 75%;
font-weight: 700;
line-height: 1;
vertical-align: baseline;
position: initial;
text-align: left;
}
.row {
margin: 0 !important;
}
/* Align tooltip context menu properly in the roster. */
#context-menu {
margin-top: 48px !important;
}

View File

@ -1,104 +0,0 @@
/** File: lefttabs.js
* Candy Plugin Left Tabs + Bootstrap3 Layout
* Author: Melissa Adamaitis <madamei@mojolingo.com>
*/
/* global window, Candy, jQuery */
var CandyShop = (function(self) { return self; }(CandyShop || {}));
CandyShop.LeftTabs = (function(self, Candy, $) {
/**
* Initializes the LeftTabs plugin with the default settings.
*/
self.init = function(){
Candy.View.Template.Chat = {
pane: '<div class="row" id="chat-pane">{{> tabs}}{{> toolbar}}{{> rooms}}</div>{{> modal}}',
rooms: '<div id="chat-rooms" class="rooms"></div>',
tabs: '<div id="left-menu-wrapper"><iframe width="100%" height="510" src="https://www.youtube.com/embed/yG0oBPtyNb0" frameborder="0" allowfullscreen autoplay="1"></iframe></div>',
tab: '<li class="roomtype-{{roomType}}" data-roomjid="{{roomJid}}" data-roomtype="{{roomType}}">' +
'<a href="#" class="label">{{#privateUserChat}}<span class="glyphicon glyphicon-user"></span> {{/privateUserChat}}{{name}}</a>' +
'<a href="#" class="transition"></a><a href="#" class="close">\u00D7</a>' +
'<small class="unread"></small></li>',
modal: '<div id="chat-modal"><a id="admin-message-cancel" class="close" href="#">\u00D7</a>' +
'<span id="chat-modal-body"></span>' +
'<img src="{{resourcesPath}}img/modal-spinner.gif" id="chat-modal-spinner" />' +
'</div><div id="chat-modal-overlay"></div>',
adminMessage: '<li><small>{{time}}</small><div class="adminmessage">' +
'<span class="label">{{sender}}</span>' +
'<span class="spacer">▸</span>{{subject}} {{message}}</div></li>',
infoMessage: '<li><small>{{time}}</small><div class="infomessage">' +
'<span class="spacer">•</span>{{subject}} {{message}}</div></li>',
toolbar: '<ul id="chat-toolbar">' +
'<li id="emoticons-icon" data-tooltip="{{tooltipEmoticons}}"><span class="glyphicon glyphicon-asterisk"></span></li>' +
'<li id="chat-sound-control" class="checked" data-tooltip="{{tooltipSound}}"><span class="glyphicon glyphicon-volume-up"></span><span class="glyphicon glyphicon-volume-off"></span>{{> soundcontrol}}</li>' +
'<li id="chat-autoscroll-control" class="checked" data-tooltip="{{tooltipAutoscroll}}"><span class="glyphicon glyphicon-arrow-down"></span><span class="glyphicon glyphicon-ban-circle"></span></li>' +
'<li class="checked" id="chat-statusmessage-control" data-tooltip="{{tooltipStatusmessage}}"><span class="glyphicon glyphicon-info-sign"></span><span class="glyphicon glyphicon-ban-circle"></span></li>' +
'<li class="context" data-tooltip="{{tooltipAdministration}}"></li>' +
'<li class="usercount" data-tooltip="{{tooltipUsercount}}"><span class="glyphicon glyphicon-user"></span>' +
'<span id="chat-usercount"></span></li></ul>',
soundcontrol: '<script type="text/javascript">var audioplayerListener = new Object();' +
' audioplayerListener.onInit = function() { };' +
'</script><object id="chat-sound-player" type="application/x-shockwave-flash" data="{{resourcesPath}}audioplayer.swf"' +
' width="0" height="0"><param name="movie" value="{{resourcesPath}}audioplayer.swf" /><param name="AllowScriptAccess"' +
' value="always" /><param name="FlashVars" value="listener=audioplayerListener&amp;mp3={{resourcesPath}}notify.mp3" />' +
'</object>',
Context: {
menu: '<div id="context-menu"><i class="arrow arrow-top"></i>' +
'<ul></ul><i class="arrow arrow-bottom"></i></div>',
menulinks: '<li class="{{class}}" id="context-menu-{{id}}">{{label}}</li>',
contextModalForm: '<form action="#" id="context-modal-form">' +
'<label for="context-modal-label">{{_label}}</label>' +
'<input type="text" name="contextModalField" id="context-modal-field" />' +
'<input type="submit" class="button" name="send" value="{{_submit}}" /></form>',
adminMessageReason: '<a id="admin-message-cancel" class="close" href="#">×</a>' +
'<p>{{_action}}</p>{{#reason}}<p>{{_reason}}</p>{{/reason}}'
},
tooltip: '<div id="tooltip"><i class="arrow arrow-top"></i>' +
'<div></div><i class="arrow arrow-bottom"></i></div>'
};
// Make the message pane the full height of the window.
self.heights();
// Make sure that the window heights are the right size after the window is resized.
$(window).resize(function() {
self.heights();
});
// Make sure that the window heights are the right size after a new room is added.
$(Candy).on('candy:view.room.after-add', function() {
self.heights();
if(typeof CandyShop.CreateRoom === "object") {
self.createRoomPluginCompatibility();
}
});
$(Candy).on('candy:view.message.after-show', function(ev, obj) {
if(Candy.View.Pane.Window.autoscroll) {
$('div[data-roomjid="' + obj.roomJid + '"] .message-pane').scrollTop($('div[data-roomjid="' + obj.roomJid + '"] .message-pane').prop('scrollHeight') + $('div[data-roomjid="' + obj.roomJid + '"] .message-form-wrapper').height());
}
});
};
self.heights = function() {
var barless_height = $(window).height() - $('.message-form-wrapper').height();
var message_pane_height = barless_height;
var message_pane_wrapper_height = (barless_height - parseInt($('.message-pane-wrapper').css('padding-bottom')));
if(CandyShop.RoomBar) {
message_pane_height = barless_height - parseInt($('.roombar').css('height'));
$('.message-pane').css('margin-top', parseInt($('.roombar').css('height')) + 'px');
}
$('.message-pane-wrapper').height(message_pane_wrapper_height + 'px');
$('.message-pane').height(message_pane_height + 'px');
$('.roster-pane').height(barless_height + 'px');
};
self.createRoomPluginCompatibility = function() {
$('#create-group-form button').addClass('btn');
$('#create-group-form .close-button').html('<span class="glyphicon glyphicon-remove"></span>');
};
return self;
}(CandyShop.LeftTabs || {}, Candy, jQuery));

View File

@ -13,7 +13,7 @@
<link rel="stylesheet" type="text/css" href="candy-plugins/namecomplete/candy.css" /> <link rel="stylesheet" type="text/css" href="candy-plugins/namecomplete/candy.css" />
<link rel="stylesheet" type="text/css" href="candy-plugins/nickchange/candy.css" /> <link rel="stylesheet" type="text/css" href="candy-plugins/nickchange/candy.css" />
<link rel="stylesheet" type="text/css" href="candy-plugins/replies/candy.css" /> <link rel="stylesheet" type="text/css" href="candy-plugins/replies/candy.css" />
<link rel="stylesheet" type="text/css" href="candy-plugins/lefttabs/lefttabs.css" /> <link rel="stylesheet" type="text/css" href="style/style.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="libs.min.js"></script> <script type="text/javascript" src="libs.min.js"></script>
@ -28,11 +28,11 @@
<script type="text/javascript" src="candy-plugins/nickchange/candy.js"></script> <script type="text/javascript" src="candy-plugins/nickchange/candy.js"></script>
<script type="text/javascript" src="candy-plugins/notifications/candy.js"></script> <script type="text/javascript" src="candy-plugins/notifications/candy.js"></script>
<script type="text/javascript" src="candy-plugins/replies/candy.js"></script> <script type="text/javascript" src="candy-plugins/replies/candy.js"></script>
<script type="text/javascript" src="candy-plugins/lefttabs/lefttabs.js"></script> <script type="text/javascript" src="style/style.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
CandyShop.LeftTabs.init(); CandyShop.Webinar.init();
Candy.init('https://oreolek.ru:5281/http-bind/', { Candy.init('https://oreolek.ru:5281/http-bind/', {
core: { core: {
debug: false, debug: false,

21
style/style.css Normal file
View File

@ -0,0 +1,21 @@
/**
* @author Alexander Yakovlev <keloero@oreolek.ru>
*/
.column-left {
position: absolute;
top: 0;
left: 0;
width: 49%;
color: lightgrey;
height: 100%;
padding-top: 30px;
}
.column-right {
position: absolute;
top: 0;
right: 0;
width: 49%;
height: 100%;
}

22
style/style.js Normal file
View File

@ -0,0 +1,22 @@
/**
* Author: Alexander Yakovlev <keloero@oreolek.ru>
*/
/* global window, Candy, jQuery */
var CandyShop = (function(self) { return self; }(CandyShop || {}));
CandyShop.Webinar = (function(self, Candy, $) {
self.init = function(){
template = {
pane: '<div class="row"><div class="column-left"><iframe width="960" height="720" src="https://www.youtube.com/embed/yG0oBPtyNb0?rel=0&amp;controls=1&amp;showinfo=0" frameborder="0" allowfullscreen></iframe></div><div class="column-right" id="chat-pane">{{> toolbar}}{{> rooms}}</div></div>{{> modal}}'
};
for (var attrname in template) {
Candy.View.Template.Chat[attrname] = template[attrname];
}
//$(Candy).on('candy:view.message.after-show', function(ev, obj) {
//});
};
return self;
}(CandyShop.Webinar || {}, Candy, jQuery));