Removed unused code, cleaned up styles

This commit is contained in:
Dan Seripap 2016-02-25 09:28:19 -05:00
parent 0a9db6f85a
commit 3ba25cd14a
5 changed files with 7 additions and 22 deletions

View File

@ -11,7 +11,6 @@ export default class Darkwire {
this._users = []; this._users = [];
this._fileQueue = []; this._fileQueue = [];
this._keys = {}; this._keys = {};
this._autoEmbedImages = false;
} }
getFile(id) { getFile(id) {
@ -24,15 +23,6 @@ export default class Darkwire {
return file.data; return file.data;
} }
get autoEmbedImages() {
return this._autoEmbedImages;
}
set autoEmbedImages(state) {
this._autoEmbedImages = state;
return this._autoEmbedImages;
}
get keys() { get keys() {
return this._keys; return this._keys;
} }

View File

@ -51,7 +51,6 @@ $(function() {
chat.log('WARNING: Your browser is not in incognito mode!', {error: true}); chat.log('WARNING: Your browser is not in incognito mode!', {error: true});
}); });
} }
chat.log(moment().format('MMMM Do YYYY, h:mm:ss a'), {info: true}); chat.log(moment().format('MMMM Do YYYY, h:mm:ss a'), {info: true});
darkwire.updateUsername(username).then((socketData) => { darkwire.updateUsername(username).then((socketData) => {
chat.chatPage.show(); chat.chatPage.show();
@ -194,16 +193,11 @@ $(function() {
}); });
let audioSwitch = $('input.sound-enabled').bootstrapSwitch(); let audioSwitch = $('input.sound-enabled').bootstrapSwitch();
let autoEmbedImages = $('input.auto-embed-files').bootstrapSwitch();
audioSwitch.on('switchChange.bootstrapSwitch', function(event, state) { audioSwitch.on('switchChange.bootstrapSwitch', function(event, state) {
darkwire.audio.soundEnabled = state; darkwire.audio.soundEnabled = state;
}); });
autoEmbedImages.on('switchChange.bootstrapSwitch', (event, state) => {
darkwire.autoEmbedImages = state;
});
function handleMessageSending() { function handleMessageSending() {
let message = chat.inputMessage; let message = chat.inputMessage;
let cleanedMessage = cleanInput(message.val()); let cleanedMessage = cleanInput(message.val());

View File

@ -30,11 +30,14 @@ export default class WindowHandler {
} }
enableFileTransfer() { enableFileTransfer() {
if (this.fileHandler.isSupported) { if (!this.fileHandler.isSupported) {
$('#send-file').click((e) => { $('#send-file').click((e) => {
e.preventDefault(); e.preventDefault();
$('#fileInput').trigger('click'); $('#fileInput').trigger('click');
}); });
} else {
$('#send-file').remove();
$('#fileInput').remove();
} }
} }

View File

@ -207,6 +207,7 @@ textarea {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
padding-bottom: 10px; padding-bottom: 10px;
height: 60px;
} }
.inputMessage{ .inputMessage{
@ -214,7 +215,7 @@ textarea {
color: white !important; color: white !important;
border: none; border: none;
border-top: 1px solid #282828; border-top: 1px solid #282828;
height: 60px; // height: 60px;
outline: none; outline: none;
width: 100%; width: 100%;
padding: 10px 75px 10px 10px; padding: 10px 75px 10px 10px;
@ -227,7 +228,7 @@ textarea {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
right: 0px; right: 0px;
padding: 22px; padding: 15px;
cursor: pointer; cursor: pointer;
} }

View File

@ -103,8 +103,6 @@
<h6>Sound</h6> <h6>Sound</h6>
<input type="checkbox" name="sound-enabled" class="form-control bs-switch sound-enabled" checked> <input type="checkbox" name="sound-enabled" class="form-control bs-switch sound-enabled" checked>
<br> <br>
<h6>Auto-embed images?</h6>
<input type="checkbox" name="embed-images" class="form-control bs-switch auto-embed-files">
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default encryption-active" data-dismiss="modal">Close</button> <button type="button" class="btn btn-default encryption-active" data-dismiss="modal">Close</button>
@ -179,7 +177,6 @@
<script src="/vendor/bootstrap-switch.min.js"></script> <script src="/vendor/bootstrap-switch.min.js"></script>
<script src="/vendor/web-crypto-shim.js"></script> <script src="/vendor/web-crypto-shim.js"></script>
<script src="/vendor/fastclick-1.0.6.min.js"></script> <script src="/vendor/fastclick-1.0.6.min.js"></script>
<script src="/vendor/autogrow.js"></script>
<script src="/main.js"></script> <script src="/main.js"></script>
</body> </body>
</html> </html>