mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-01 01:30:58 +01:00
1
config/env/torrents.js
vendored
1
config/env/torrents.js
vendored
@@ -691,6 +691,7 @@ module.exports = {
|
||||
* @expires: banned expires time setting, in this time, user cannot connect chat server
|
||||
*/
|
||||
chat: {
|
||||
messageMaxLength: 1000,
|
||||
ban: {
|
||||
expires: 60 * 60 * 1000 * 1
|
||||
}
|
||||
|
||||
@@ -128,12 +128,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* selectRange
|
||||
* @param start
|
||||
* @param end
|
||||
* @returns {*}
|
||||
*/
|
||||
$.fn.selectRange = function (start, end) {
|
||||
if (!end) end = start;
|
||||
return this.each(function () {
|
||||
if (this.setSelectionRange) {
|
||||
this.focus();
|
||||
this.setSelectionRange(start, end);
|
||||
} else if (this.createTextRange) {
|
||||
var range = this.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', end);
|
||||
range.moveStart('character', start);
|
||||
range.select();
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* $watch 'vm.messages'
|
||||
* when changed, scroll to bottom
|
||||
*/
|
||||
$scope.$watch('vm.messages.length', function (newValue, oldValue) {
|
||||
//mtDebug.info('vm.messages changed');
|
||||
$scope.$watch('vm.messageText', function (newValue, oldValue) {
|
||||
if (newValue.length > vm.chatConfig.messageMaxLength) {
|
||||
vm.messageText = newValue.substr(0, vm.chatConfig.messageMaxLength);
|
||||
$('#messageText').focus().val(vm.messageText).selectRange(vm.cursorPosition + 1);
|
||||
}
|
||||
});
|
||||
$scope.$watch('vm.fontStyleBold', function (newValue, oldValue) {
|
||||
if (newValue) {
|
||||
@@ -231,6 +255,8 @@
|
||||
evt.preventDefault();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
vm.cursorPosition = evt.currentTarget.selectionStart;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
}
|
||||
.chat-body {
|
||||
height: ~"calc(100% - 160px)";
|
||||
height: ~"calc(100% - 180px)";
|
||||
padding: 10px 10px;
|
||||
overflow-y: auto;
|
||||
word-break: break-all;
|
||||
@@ -187,7 +187,7 @@
|
||||
}
|
||||
}
|
||||
.chat-footer {
|
||||
height: 120px;
|
||||
height: 140px;
|
||||
border-top: solid 1px lighten(@gray-light, 40%);
|
||||
background-color: lighten(@gray-light, 43%);
|
||||
.footer-function {
|
||||
@@ -218,7 +218,7 @@
|
||||
textarea {
|
||||
resize: none;
|
||||
width: ~"calc(100% + 2px)";
|
||||
height: 80px;
|
||||
height: 100px;
|
||||
margin-left: -1px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user