Skip to content

Commit

Permalink
version change 0.6.0, fix scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
nanu-c committed Sep 14, 2019
1 parent 1047cae commit 3bc92bf
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 73 deletions.
2 changes: 1 addition & 1 deletion app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

var AppName = "textsecure.nanuc"

var AppVersion = "0.4.6"
var AppVersion = "0.6.0"

// Do not allow sending attachments larger than 100M for now
var MaxAttachmentSize int64 = 100 * 1024 * 1024
Expand Down
82 changes: 41 additions & 41 deletions axolotl-web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,47 +45,47 @@ export default {
// "Your screen resolution is: " + screen.width + "x" + screen.height+"<br>"+navigator.userAgent;
// const viewportmeta = document.querySelector('meta[name=viewport]');
// viewportmeta.setAttribute('content', "initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0");
console.log('websocket: start injection');
var that = this;
function initWebSocket() {
window.blobsaverSocket = new WebSocket('ws://localhost:12345');
window.blobsaverSocket.onclose = function() {
console.error('BlobSaver: websocket closed');
};
window.blobsaverSocket.onerror = function(error) {
console.error('BlobSaver: websocket', error);
};
window.blobsaverSocket.onopen = function() {
console.log('BlobSaver: websocket opened');
};
window.blobsaverSocket.onmessage = function (event) {
console.log(event.data);
that.$store.dispatch("addDesktopSync",event.data);
}
}
window.addEventListener('load', initWebSocket, false);
window.URL.createObjectURL = function(obj) {
// TODO check if the obj is a blob
console.log('BlobSaver: createObjectURL interceptor');
var reader = new FileReader();
reader.readAsDataURL(obj);
reader.onloadend = function() {
console.log('BlobSaver: createObjectURL sending message');
window.blobsaverSocket.send({type:file,
data:reader.result});
};
throw 'stop'; // Throw an error here to stop execution (continuing execution would likely result in an error from the download manager)
};
console.log('websocket: end injection');
// console.log('websocket: start injection');
// var that = this;
// function initWebSocket() {
// window.blobsaverSocket = new WebSocket('ws://localhost:12345');
//
// window.blobsaverSocket.onclose = function() {
// console.error('BlobSaver: websocket closed');
// };
//
// window.blobsaverSocket.onerror = function(error) {
// console.error('BlobSaver: websocket', error);
// };
//
// window.blobsaverSocket.onopen = function() {
// console.log('BlobSaver: websocket opened');
// };
// window.blobsaverSocket.onmessage = function (event) {
// console.log(event.data);
// that.$store.dispatch("addDesktopSync",event.data);
// }
// }
//
// window.addEventListener('load', initWebSocket, false);
//
// window.URL.createObjectURL = function(obj) {
// // TODO check if the obj is a blob
//
// console.log('BlobSaver: createObjectURL interceptor');
//
// var reader = new FileReader();
// reader.readAsDataURL(obj);
// reader.onloadend = function() {
// console.log('BlobSaver: createObjectURL sending message');
// window.blobsaverSocket.send({type:file,
// data:reader.result});
// };
//
// throw 'stop'; // Throw an error here to stop execution (continuing execution would likely result in an error from the download manager)
// };
//
// console.log('websocket: end injection');
},
computed: {
error () {
Expand Down
2 changes: 1 addition & 1 deletion axolotl-web/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Vue.use(BootstrapVue)
Vue.config.productionTip = false
var websocketAdress = "ws://[::1]:9080/ws";
if(process.env.NODE_ENV=="development")
websocketAdress = 'ws://localhost:9080/ws';
websocketAdress = 'ws://10.0.10.196:9080/ws';
Vue.use(VueNativeSock, websocketAdress,
{ store: store,
// format: 'json',
Expand Down
25 changes: 15 additions & 10 deletions axolotl-web/src/pages/MessageList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<template>
<div class="chat">
<div class="chatList-container">
<div id="messageList" class="chatList row" v-if="messages && messages.length>0" v-chat-scroll="{always: false, smooth: true}" v-on:scroll="handleScroll">
<div id="messageList" class="chatList row" v-if="messages && messages.length>0" v-chat-scroll="{always: false, smooth: true}" @scroll="handleScroll($event)">

<div v-for="message in messages.slice().reverse()" :class="{'col-12':true, 'sent':message.Outgoing, 'reply':!message.Outgoing}" >
<div class="row w-100">
Expand Down Expand Up @@ -88,8 +88,10 @@ export default {
}
},
handleScroll (event) {
console.log(event)
if(event.target.scrollTop==0){
if(event.target.scrollTop<50){
console.log("load more messages")
this.$store.dispatch("getMoreMessages");
}
// Any code to be executed when the window is scrolled
Expand All @@ -110,11 +112,7 @@ export default {
back(){
this.$router.go(-1)
},scrollDown(){
if(!this.scrolled){
var objDiv = document.getElementById("messageList");
objDiv.scrollTop = objDiv.scrollHeight;
this.scrolled=true;
}
window.scrollTo(0,document.body.scrollHeight);
}
},
Expand All @@ -124,7 +122,15 @@ export default {
mounted(){
this.$store.dispatch("getMessageList", this.getId());
setTimeout(this.scrollDown
, 500)
, 800)
document.addEventListener("scroll", (e) => {
var scrolled = document.scrollingElement.scrollTop;
console.log(scrolled)
if(scrolled==0){
console.log("load more messages")
this.$store.dispatch("getMoreMessages");
}
});
},
computed: {
messages () {
Expand All @@ -140,7 +146,6 @@ export default {
text-align: left;
}
.chatList{
height:calc(100vh - 200px);
overflow: hidden auto;
-ms-overflow-style: none;
scrollbar-width: none;
Expand All @@ -160,7 +165,7 @@ export default {
scrollbar-width: none;
}
.chatList > div:last-child {
padding-bottom: 50px;
padding-bottom: 100px;
}
.avatar {
justify-content: center;
Expand Down
2 changes: 1 addition & 1 deletion click/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "textsecure.nanuc",
"version": "0.5.0",
"version": "0.6.0",
"description": "A Signal compatible messaging client for Ubuntu phones",
"title": "Signal",
"architecture": "armhf",
Expand Down
9 changes: 9 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
0.6.0 (Sept 14 2019) Axolotl-Alpha
--------------------
* remove go-qml bindings
* new ux
* display attachments inline
* know bugs because of the complete rewrite of the client:
** no group creation, no notification config, no content hub integration(no contact import, no saving)
** no support of encrypted db

0.4.5 (Aug 31 2019)
--------------------
* import a singel contact thats not in the contact Book
Expand Down
38 changes: 19 additions & 19 deletions qml/ut/MainUt.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ UITK.Page {
property QtObject requestTest
property QtObject wsClient
id: root
WebSocketServer {
id: server
listen: true
port: 12345

onClientConnected: {
console.log('BlobSaver: websocket server connected');
wsClient = webSocket
webSocket.onTextMessageReceived.connect(function(base64data) {
console.log('base64data');
var path = BlobSaver.write(base64data);
fileDownloaded(path);
});
}

onErrorStringChanged: {
console.log('BlobSaver: websocket server error', errorString);
}
}
// WebSocketServer {
// id: server
// listen: true
// port: 12345
//
// onClientConnected: {
// console.log('BlobSaver: websocket server connected');
// wsClient = webSocket
// webSocket.onTextMessageReceived.connect(function(base64data) {
// console.log('base64data');
// var path = BlobSaver.write(base64data);
// fileDownloaded(path);
// });
// }
//
// onErrorStringChanged: {
// console.log('BlobSaver: websocket server error', errorString);
// }
// }
WebEngineView {
id: webView
profile:webProfile
Expand Down

0 comments on commit 3bc92bf

Please sign in to comment.